fix bug 3502 rspconfig support for USERID=<password> for CMM in genesis case

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15996 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
zhaoertao 2013-04-17 06:55:48 +00:00
parent 44c9aea4e2
commit ab402d90a0

View File

@ -4187,13 +4187,15 @@ sub clicmds {
my $curraddr = $mpa;
if ($args{curraddr}) {
$curraddr = $args{curraddr};
} elsif (defined($handled{'initnetwork'})) {
} elsif (defined($handled{'initnetwork'}) or defined($handled{'USERID'})) {
# get the IP of mpa from the hosts.otherinterfaces
my $hoststab = xCAT::Table->new('hosts');
if ($hoststab) {
my $hostdata = $hoststab->getNodeAttribs($node, ['otherinterfaces']);
if (!$hostdata->{'otherinterfaces'}) {
return ([1,\@unhandled,"Cannot find the temporary IP from the hosts.otherinterfaces"]);
if (!defined($handled{'USERID'})) {
return ([1,\@unhandled,"Cannot find the temporary IP from the hosts.otherinterfaces"]);
}
} else {
$curraddr = $hostdata->{'otherinterfaces'};
}
@ -4307,6 +4309,14 @@ sub clicmds {
elsif (/^userpassword$/) {$result = passwd($t, $mpa, $1, $handled{$_}, $promote_pass, $mm);}
if (!defined($result)) {next;}
push @data, "$_: @$result";
if (/^initnetwork$/) {
if (!@$result[0]) {
my $hoststab = xCAT::Table->new('hosts');
if ($hoststab) {
$hoststab->setNodeAttribs($mpa, {otherinterfaces=>''});
}
}
}
$Rc |= shift(@$result);
push @cfgtext,@$result;
}