Fixed one problem in nimnodeset that if SN doesnt have nim master setup, nimnodeset cannot read all the NIM resouce types and this leads to several unpected errors. Putting the NIM resource reading code right after nim_master_setup.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10799 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
wanghuaz 2011-10-17 15:57:44 +00:00
parent aa4edd01ef
commit 7c531590dc

View File

@ -678,20 +678,6 @@ sub nimnodeset
# don't fail - maybe just don't have any defined!
#
# Get a list of all nim resource types
#
$cmd =
qq~/usr/sbin/lsnim -P -c resources | /usr/bin/cut -f1 -d' ' 2>/dev/null~;
@nimrestypes = xCAT::Utils->runcmd("$cmd", -1);
if ($::RUNCMD_RC != 0)
{
my $rsp;
push @{$rsp->{data}}, "$Sname: Could not get NIM resource types.";
xCAT::MsgUtils->message("E", $rsp, $callback);
return 1;
}
#
# get all the image names needed and make sure they are defined on the
# local server
@ -768,6 +754,20 @@ sub nimnodeset
}
my %resolv_conf_hash = %{$RChash};
#
# Get a list of all nim resource types
#
$cmd =
qq~/usr/sbin/lsnim -P -c resources | /usr/bin/cut -f1 -d' ' 2>/dev/null~;
@nimrestypes = xCAT::Utils->runcmd("$cmd", -1);
if ($::RUNCMD_RC != 0)
{
my $rsp;
push @{$rsp->{data}}, "$Sname: Could not get NIM resource types.";
xCAT::MsgUtils->message("E", $rsp, $callback);
return 1;
}
$error = 0;
foreach my $node (@nodelist)
{