From c03aeddd192c45645a43d0052bd7608a509c9891 Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Wed, 17 Apr 2013 07:17:42 +0000 Subject: [PATCH] fix bug 3502 rspconfig support for USERID= for CMM in genesis case git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@16002 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/blade.pm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/blade.pm b/xCAT-server/lib/xcat/plugins/blade.pm index 64e8c097c..0e8bcaf3d 100644 --- a/xCAT-server/lib/xcat/plugins/blade.pm +++ b/xCAT-server/lib/xcat/plugins/blade.pm @@ -4497,13 +4497,16 @@ 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'})) { + push @cfgtext, "Cannot find the temporary IP from the hosts.otherinterfaces"; + return ([1,\@unhandled,""]); + } } else { $curraddr = $hostdata->{'otherinterfaces'}; } @@ -4638,6 +4641,14 @@ sub clicmds { } 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; }