From a5b5cc1c8b4f11d0cd45c6343ea739e0d1afb502 Mon Sep 17 00:00:00 2001 From: nott Date: Tue, 14 Aug 2012 15:11:07 +0000 Subject: [PATCH] fix error msgs git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@13507 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/aixinstall.pm | 86 ++++++++++++++-------- 1 file changed, 55 insertions(+), 31 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/aixinstall.pm b/xCAT-server/lib/xcat/plugins/aixinstall.pm index 2c9eafc8d..541555ea1 100644 --- a/xCAT-server/lib/xcat/plugins/aixinstall.pm +++ b/xCAT-server/lib/xcat/plugins/aixinstall.pm @@ -829,22 +829,35 @@ sub nimnodeset push(@nodesfailed, $node); next; } - # could be diskful - # mask, gateway, cosi, root, dump, paging - # TODO - need to fix this check for shared_root - if ( !$nethash{$node}{'mask'} - || !$nethash{$node}{'gateway'} - || !$imagehash{$image_name}{spot}) - { - my $rsp; - push @{$rsp->{data}}, - "$Sname: Missing required information for node \'$node\'.\n"; + + my $foundneterror; + if (!$nethash{$node}{'mask'} ) + { + my $rsp; + push @{$rsp->{data}},"$Sname: Missing network mask for node \'$node\'.\n"; + xCAT::MsgUtils->message("E", $rsp, $callback); + $foundneterror++; + } + if (!$nethash{$node}{'gateway'}) + { + my $rsp; + push @{$rsp->{data}},"$Sname: Missing network gateway for node \'$node\'.\n"; xCAT::MsgUtils->message("E", $rsp, $callback); - $error++; + $foundneterror++; + } + if (!$imagehash{$image_name}{spot}) + { + my $rsp; + push @{$rsp->{data}},"$Sname: Missing spot name for osimage \n'$image_name\'.\n"; + xCAT::MsgUtils->message("E", $rsp, $callback); + $foundneterror++; + } + if ($foundneterror) { + $error++; push(@nodesfailed, $node); next; - } - + } + # set some default values # overwrite with cmd line values - if any my $speed = "100"; @@ -9984,22 +9997,34 @@ sub mkdsklsnode # check for required attrs if (($type ne "standalone")) { - - # could be diskless or dataless - # mask, gateway, cosi, root, dump, paging - # TODO - need to fix this check for shared_root - if ( !$nethash{$node}{'mask'} - || !$nethash{$node}{'gateway'} - || !$imagehash{$image_name}{spot}) - { - my $rsp; - push @{$rsp->{data}}, - "$Sname: Missing required information for node \'$node\'.\n"; - xCAT::MsgUtils->message("E", $rsp, $callback); - $error++; - push(@nodesfailed, $node); - next; - } + # check for missing info + my $foundneterror; + if (!$nethash{$node}{'mask'} ) + { + my $rsp; + push @{$rsp->{data}},"$Sname: Missing network mask for node \'$node\'.\n"; + xCAT::MsgUtils->message("E", $rsp, $callback); + $foundneterror++; + } + if (!$nethash{$node}{'gateway'}) + { + my $rsp; + push @{$rsp->{data}},"$Sname: Missing network gateway for node \'$node\'.\n"; + xCAT::MsgUtils->message("E", $rsp, $callback); + $foundneterror++; + } + if (!$imagehash{$image_name}{spot}) + { + my $rsp; + push @{$rsp->{data}},"$Sname: Missing spot name for osimage \n'$image_name\'.\n"; + xCAT::MsgUtils->message("E", $rsp, $callback); + $foundneterror++; + } + if ($foundneterror) { + $error++; + push(@nodesfailed, $node); + next; + } } # set some default values @@ -10114,8 +10139,7 @@ sub mkdsklsnode if (!$imagehash{$image_name}{paging}) { my $rsp; - push @{$rsp->{data}}, - "$Sname: Missing required information for node \'$node\'.\n"; + push @{$rsp->{data}}, "$Sname: Missing paging resource name for osimage \'$image_name\'.\n"; xCAT::MsgUtils->message("E", $rsp, $callback); $error++; push(@nodesfailed, $node);