Extended verbose output should only be for lsdef

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2958 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
nott 2009-03-22 19:15:19 +00:00
parent b7905e9481
commit 11ca1c125e
2 changed files with 18 additions and 10 deletions

View File

@ -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};

View File

@ -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;