diff --git a/perl-xCAT/xCAT/DBobjUtils.pm b/perl-xCAT/xCAT/DBobjUtils.pm index c0ba9e4e6..d1b09c937 100644 --- a/perl-xCAT/xCAT/DBobjUtils.pm +++ b/perl-xCAT/xCAT/DBobjUtils.pm @@ -204,6 +204,9 @@ sub getobjattrs foreach $a (@{$tableattrs{$table}}) { if (defined($tmp1->{$a})) { $tabhash{$table}{$n}{$a} = $tmp1->{$a}; +#print "obj = $n, table = $table, attr =$a, val = $tabhash{$table}{$n}{$a}\n"; + + } } } @@ -241,7 +244,7 @@ sub getobjattrs #----------------------------------------------------------------------------- sub getobjdefs { - my ($class, $hash_ref) = @_; + my ($class, $hash_ref, $verbose) = @_; my %objhash; my %typehash = %$hash_ref; my %tabhash; @@ -293,7 +296,7 @@ sub getobjdefs { if (defined($_->{value}) ) { $foundinfo++; - if ($::VERBOSE) { + if ($verbose == 1) { $objhash{$objname}{$_->{key}} = "$_->{value}\t(Table:site - Key:$_->{key})"; } else { $objhash{$objname}{$_->{key}} = $_->{value}; @@ -390,7 +393,7 @@ sub getobjdefs if ( ($lookup_attr eq 'node') && ($type eq 'node') ) { if (defined($tabhash{$lookup_table}{$objname}{$tabattr}) ) { - if ($::VERBOSE) { + if ($verbose == 1) { $objhash{$objname}{$attr} = "$tabhash{$lookup_table}{$objname}{$tabattr}\t(Table:$lookup_table - Key:$lookup_attr - Lookup:$tabattr)"; } else { $objhash{$objname}{$attr} = $tabhash{$lookup_table}{$objname}{$tabattr}; @@ -409,7 +412,7 @@ sub getobjdefs if ($_->{$lookup_attr} eq $objname) { if (defined($_->{$tabattr}) ) { - if ($::VERBOSE) { + if ($verbose == 1) { $objhash{$objname}{$attr} = "$_->{$tabattr}\t(Table:$lookup_table - Key:$lookup_attr - Lookup:$tabattr)"; } else { $objhash{$objname}{$attr} = $_->{$tabattr}; @@ -451,7 +454,7 @@ sub getobjdefs $foundinfo++; if (defined($_->{value}) ) { $foundinfo++; - if ($::VERBOSE) { + if ($verbose == 1) { $objhash{$objname}{$_->{key}} = "$_->{value}\t(Table:monsetting)"; } else { $objhash{$objname}{$_->{key}} = $_->{value}; diff --git a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm index f4629f6a5..42b03716c 100644 --- a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm +++ b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm @@ -331,7 +331,10 @@ sub processArgs { $::verbose = 1; $::VERBOSE = 1; - } + } else { + $::verbose = 0; + $::VERBOSE = 0; + } # # process the input file - if provided @@ -439,7 +442,7 @@ sub processArgs my $schema = xCAT::Table->getTableSchema('site'); my $desc; - $rsp->{data}->[0] = "\nThere can only be one xCAT site definition. This definition consists \nof an unlimited list of user-defined attributes and values that represent \nglobal settings for the whole cluster. The following is a list \nof the attributes currently supported by xCAT.\n"; + $rsp->{data}->[0] = "\nThere can only be one xCAT site definition. This definition consists \nof an unlimited list of user-defined attributes and values that represent \nglobal settings for the whole cluster. The following is a list \nof the attributes currently supported by xCAT.\n"; $desc = $schema->{descriptions}->{'key'}; $rsp->{data}->[1] = $desc; @@ -2107,7 +2110,7 @@ sub defls } - %myhash = xCAT::DBobjUtils->getobjdefs(\%objhash); + %myhash = xCAT::DBobjUtils->getobjdefs(\%objhash, $::VERBOSE); if (!defined(%myhash)) { my $rsp; @@ -2124,7 +2127,9 @@ sub defls { %objhash = %::ObjTypeHash; - %myhash = xCAT::DBobjUtils->getobjdefs(\%objhash); +print "defls: verb = $::VERBOSE\n"; + + %myhash = xCAT::DBobjUtils->getobjdefs(\%objhash, $::VERBOSE); if (!defined(%myhash)) { my $rsp; @@ -2178,7 +2183,7 @@ sub defls else { - %myhash = xCAT::DBobjUtils->getobjdefs(\%::AllObjTypeHash); + %myhash = xCAT::DBobjUtils->getobjdefs(\%::AllObjTypeHash, $::VERBOSE); if (!defined(%myhash)) { my $rsp;