Skip to content

Commit 5e19e11

Browse files
author
Marcin Przepiorowski
committed
v.2.4.19.2
2 parents dcdf270 + f08d4a2 commit 5e19e11

File tree

4 files changed

+44
-24
lines changed

4 files changed

+44
-24
lines changed

bin/dx_get_hierarchy.pl

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@
111111
{'dSource', 30},
112112
{'dS time', 35},
113113
{'Physical DB', 30},
114-
{'First child DB', 30}
114+
{'First child DB', 30},
115+
{'Parent database', 30}
115116
);
116117

117118

@@ -212,6 +213,8 @@
212213
my $hierc = $databases->generateHierarchy($object_map, $databases_parent);
213214

214215
my $parentname;
216+
my $parent1leveldb;
217+
my $parent1levelname;
215218

216219
# for filtered databases on current engine - display status
217220
for my $dbitem ( @{$db_list} ) {
@@ -254,6 +257,18 @@
254257
($topdsc, $childc) = $databases->finddSource($dbitem, $hierc);
255258

256259

260+
if ( $dbobj->getParentContainer() ne '' ) {
261+
my $parent1leveldb = $databases->getDB($dbobj->getParentContainer());
262+
if (defined($parent1leveldb)) {
263+
$parent1levelname = $parent1leveldb->getName();
264+
} else {
265+
$parent1levelname = 'N/A';
266+
}
267+
} else {
268+
$parent1levelname = 'N/A';
269+
}
270+
271+
257272
if (defined($topdsc)) {
258273
if ($topdsc eq 'deleted') {
259274
$parentname = 'parent deleted';
@@ -346,6 +361,7 @@
346361
$snaptime = 'N/A';
347362
$childname = 'N/A';
348363
$parentname = '';
364+
$parent1levelname = '';
349365
if ($dbobj->getType() ne 'detached' ) {
350366
$physicaldb = $dbobj->getSourceConfigName();
351367
} else {
@@ -361,7 +377,8 @@
361377
$parentname,
362378
$snaptime,
363379
$physicaldb,
364-
$childname
380+
$childname,
381+
$parent1levelname
365382
);
366383
}
367384

lib/Toolkit_helpers.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use File::Spec;
2929

3030
use lib '../lib';
3131

32-
our $version = '2.4.19';
32+
our $version = '2.4.19.2';
3333

3434
my $tz = new Date::Manip::TZ;
3535
my $dt = new Date::Manip::Date;

test/test_hierarchy/hierarchy.t

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -34,30 +34,30 @@ script_compiles('../../bin/dx_get_hierarchy.pl');
3434
script_runs(['../../bin/dx_get_hierarchy.pl', '-d', 'local32', '-format','csv','-nohead'] , "All hierachy test");
3535

3636
my $expected_stdout = <<EOF;
37-
local32,CDOMLOTG2E25,Analytics,CDB,,N/A,CDOMLOTG2E25,N/A
38-
local32,mssqltest,Analytics,VDB,Soda,2021-12-17 05:08:25 PST,Soda,mssqltest
39-
local32,oramask,Analytics,VDB,DBOMSR3A85E9,2021-12-22 07:53:08 EST,DBOMSR3A85E9,oramask
40-
local32,pdbtest,Analytics,VDB,CDOMLOSRCA1DPDB1,2021-12-17 05:05:09 EST,CDOMLOSRCA1DPDB1,pdbtest
41-
local32,pdbtest2,Analytics,VDB,CDOMLOSRCA1DPDB1,2021-12-17 05:05:09 EST,CDOMLOSRCA1DPDB1,pdbtest2
42-
local32,sybasetest,Analytics,VDB,db_rhel83_160_1,2021-12-17 05:01:49 EST,db_rhel83_160_1,sybasetest
43-
local32,vcdbtest,Analytics,vCDB,,N/A,vcdbtest,N/A
44-
local32,CDOMLOSRCA1D,Sources,CDB,,N/A,CDOMLOSRCA1D,N/A
45-
local32,CDOMLOSRCA1DPDB1,Sources,dSource,,N/A,CDOMLOSRCA1DPDB1,N/A
46-
local32,db_rhel83_160_1,Sources,dSource,,N/A,db_rhel83_160_1,N/A
47-
local32,DBOMSR3A85E9,Sources,dSource,,N/A,DBOMSR3A85E9,N/A
48-
local32,Macaroon,Sources,dSource,,N/A,Macaroon,N/A
49-
local32,Soda,Sources,dSource,,N/A,Soda,N/A
37+
local32,CDOMLOTG2E25,Analytics,CDB,,N/A,CDOMLOTG2E25,N/A,
38+
local32,mssqltest,Analytics,VDB,Soda,2021-12-17 05:08:25 PST,Soda,mssqltest,Soda
39+
local32,oramask,Analytics,VDB,DBOMSR3A85E9,2021-12-22 07:53:08 EST,DBOMSR3A85E9,oramask,DBOMSR3A85E9
40+
local32,pdbtest,Analytics,VDB,CDOMLOSRCA1DPDB1,2021-12-17 05:05:09 EST,CDOMLOSRCA1DPDB1,pdbtest,CDOMLOSRCA1DPDB1
41+
local32,pdbtest2,Analytics,VDB,CDOMLOSRCA1DPDB1,2021-12-17 05:05:09 EST,CDOMLOSRCA1DPDB1,pdbtest2,CDOMLOSRCA1DPDB1
42+
local32,sybasetest,Analytics,VDB,db_rhel83_160_1,2021-12-17 05:01:49 EST,db_rhel83_160_1,sybasetest,db_rhel83_160_1
43+
local32,vcdbtest,Analytics,vCDB,,N/A,vcdbtest,N/A,
44+
local32,CDOMLOSRCA1D,Sources,CDB,,N/A,CDOMLOSRCA1D,N/A,
45+
local32,CDOMLOSRCA1DPDB1,Sources,dSource,,N/A,CDOMLOSRCA1DPDB1,N/A,
46+
local32,db_rhel83_160_1,Sources,dSource,,N/A,db_rhel83_160_1,N/A,
47+
local32,DBOMSR3A85E9,Sources,dSource,,N/A,DBOMSR3A85E9,N/A,
48+
local32,Macaroon,Sources,dSource,,N/A,Macaroon,N/A,
49+
local32,Soda,Sources,dSource,,N/A,Soda,N/A,
5050
EOF
5151

5252
script_stdout_is $expected_stdout, "All hierachy results compare";
5353

5454
script_runs(['../../bin/dx_get_hierarchy.pl', '-d', 'local33', '-format','csv','-nohead','-parent_engine','local32'] , "2 engine test");
5555

5656
my $expected_stdout = <<EOF;
57-
local33,oramask\@ip-10-110-251-90-1,Analytics\@ip-10-110-251-90-1,VDB,DBOMSR3A85E9,2021-12-22 07:53:08 EST,DBOMSR3A85E9,oramask
58-
local33,clony,Untitled,VDB,DBOMSR3A85E9,2021-12-17 06:30:40 EST,DBOMSR3A85E9,oramask
59-
local33,mask2,Untitled,VDB,DBOMSR3A85E9,2021-12-17 06:30:40 EST,DBOMSR3A85E9,oramask
60-
local33,maskmask,Untitled,VDB,DBOMSR3A85E9,2021-12-22 07:53:08 EST,DBOMSR3A85E9,oramask
57+
local33,oramask\@ip-10-110-251-90-1,Analytics\@ip-10-110-251-90-1,VDB,DBOMSR3A85E9,2021-12-22 07:53:08 EST,DBOMSR3A85E9,oramask,N/A
58+
local33,clony,Untitled,VDB,DBOMSR3A85E9,2021-12-17 06:30:40 EST,DBOMSR3A85E9,oramask,mask2
59+
local33,mask2,Untitled,VDB,DBOMSR3A85E9,2021-12-17 06:30:40 EST,DBOMSR3A85E9,oramask,oramask\@ip-10-110-251-90-1
60+
local33,maskmask,Untitled,VDB,DBOMSR3A85E9,2021-12-22 07:53:08 EST,DBOMSR3A85E9,oramask,oramask\@ip-10-110-251-90-1
6161
EOF
6262

6363
script_stdout_is $expected_stdout, "2 engine results compare";
@@ -66,10 +66,10 @@ script_stdout_is $expected_stdout, "2 engine results compare";
6666
script_runs(['../../bin/dx_get_hierarchy.pl', '-d', 'local33', '-format','csv','-nohead'] , "target engine test");
6767

6868
my $expected_stdout = <<EOF;
69-
local33,oramask\@ip-10-110-251-90-1,Analytics\@ip-10-110-251-90-1,VDB,dSource on other DE,N/A,N/A,N/A
70-
local33,clony,Untitled,VDB,dSource on other DE,N/A,N/A,N/A
71-
local33,mask2,Untitled,VDB,dSource on other DE,N/A,N/A,N/A
72-
local33,maskmask,Untitled,VDB,dSource on other DE,N/A,N/A,N/A
69+
local33,oramask\@ip-10-110-251-90-1,Analytics\@ip-10-110-251-90-1,VDB,dSource on other DE,N/A,N/A,N/A,N/A
70+
local33,clony,Untitled,VDB,dSource on other DE,N/A,N/A,N/A,mask2
71+
local33,mask2,Untitled,VDB,dSource on other DE,N/A,N/A,N/A,oramask\@ip-10-110-251-90-1
72+
local33,maskmask,Untitled,VDB,dSource on other DE,N/A,N/A,N/A,oramask\@ip-10-110-251-90-1
7373
EOF
7474

7575
script_stdout_is $expected_stdout, "target engine results compare";

test/test_hierarchy/start_server.pl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
use lib '../../lib/';
2+
use lib '../';
3+
use lib '.';
14
use server;
25

36
my $server = server->new(8080);

0 commit comments

Comments
 (0)