From ef155bf67827817a8b21c47c262c892eaad0cc4a Mon Sep 17 00:00:00 2001 From: wanghuaz Date: Mon, 10 Nov 2008 03:11:12 +0000 Subject: [PATCH] Added verboses to chdef, mkdef. Defect 2186000 [https://sourceforge.net/tracker/index.php?func=detail&aid=2186000&group_id=208749&atid=1006945] git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2489 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/DBobjectdefs.pm | 40 +++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm index 5943ea7ef..cd34deee7 100644 --- a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm +++ b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm @@ -848,6 +848,13 @@ sub defmk else { $::CLIATTRS{$objname}{$attr} = $::ATTRS{$attr}; + if ($::verbose) + { + my $rsp; + $rsp->{data}->[0] = "\nFunction: defmk-->set the attrs for each object definition"; + $rsp->{data}->[1] = "defmk: objname=$objname, attr=$attr, value=$::ATTRS{$attr}"; + xCAT::MsgUtils->message("I", $rsp, $::callback); + } } } # end - foreach attr @@ -878,6 +885,13 @@ sub defmk @{$objTypeLists{$t}} = xCAT::DBobjUtils->getObjectsOfType($t); } + if ($::verbose) + { + my $rsp; + $rsp->{data}->[0] = "\ndefmk: list objects that are defined for each type"; + $rsp->{data}->[1] = "@{$objTypeLists{$t}}\n"; + xCAT::MsgUtils->message("I", $rsp, $::callback); + } } foreach my $obj (keys %::FINALATTRS) @@ -898,6 +912,12 @@ sub defmk # if object already exists if (grep(/$obj/, @{$objTypeLists{$type}})) { + if ($::verbose) + { + my $rsp; + $rsp->{data}->[0] = "defmk: object already exists, remove old ones"; + xCAT::MsgUtils->message("I", $rsp, $::callback); + } if ($::opt_f) { @@ -1061,6 +1081,12 @@ sub defmk my $newgroups; foreach my $n (@memberlist) { + if ($::verbose) + { + my $rsp; + $rsp->{data}->[0] = "defmk: add group name [$n] to nodelist table"; + xCAT::MsgUtils->message("I", $rsp, $::callback); + } # add this group name to the node entry in # the nodelist table @@ -1129,7 +1155,12 @@ sub defmk } if (defined(%GroupHash)) { - + if ($::verbose) + { + my $rsp; + $rsp->{data}->[0] = "Write GroupHash: %GroupHash to xCAT database\n"; + xCAT::MsgUtils->message("I", $rsp, $::callback); + } if (xCAT::DBobjUtils->setobjdefs(\%GroupHash) != 0) { my $rsp; @@ -1364,6 +1395,13 @@ sub defch { @{$objTypeLists{$t}} = xCAT::DBobjUtils->getObjectsOfType($t); } + if ($::verbose) + { + my $rsp; + $rsp->{data}->[0] = "\ndefch: list objects that are defined for each type"; + $rsp->{data}->[1] = "@{$objTypeLists{$t}}\n"; + xCAT::MsgUtils->message("I", $rsp, $::callback); + } } foreach my $obj (keys %::FINALATTRS)