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; }