fixed error processing if call to my_ip_facing did not find an ip

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2936 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
mellor 2009-03-18 19:37:54 +00:00
parent a392cd6880
commit 23b9097e8f
2 changed files with 24 additions and 2 deletions

View File

@ -68,7 +68,18 @@ sub setstate {
my $kern = $bphash{$node}->[0]; #$bptab->getNodeAttribs($node,['kernel','initrd','kcmdline']);
if ($kern->{kcmdline} =~ /!myipfn!/) {
my $ipfn = xCAT::Utils->my_ip_facing($node);
unless ($ipfn) { return (1,"Unable to identify IP facing client node"); }
unless ($ipfn) {
my @myself = xCAT::Utils->determinehostname();
my $myname = $myself[(scalar @myself)-1];
$callback->(
{
error => [
"$myname: Unable to determine or reasonably guess the image server for $node"
],
errorcode => [1]
}
);
}
$kern->{kcmdline} =~ s/!myipfn!/$ipfn/;
}
my $pcfg;

View File

@ -72,7 +72,18 @@ sub setstate {
my $kern = $bphash{$node}->[0]; #$bptab->getNodeAttribs($node,['kernel','initrd','kcmdline']);
if ($kern->{kcmdline} =~ /!myipfn!/) {
my $ipfn = xCAT::Utils->my_ip_facing($node);
unless ($ipfn) { return (1,"Unable to identify IP facing client node"); }
unless ($ipfn) {
my @myself = xCAT::Utils->determinehostname();
my $myname = $myself[(scalar @myself)-1];
$callback->(
{
error => [
"$myname: Unable to determine the image server for $node"
],
errorcode => [1]
}
);
}
$kern->{kcmdline} =~ s/!myipfn!/$ipfn/;
}
my $pcfg;