From 23b9097e8f8d77217da3b0cad7a93ac7f432ba86 Mon Sep 17 00:00:00 2001 From: mellor Date: Wed, 18 Mar 2009 19:37:54 +0000 Subject: [PATCH] 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 --- xCAT-server/lib/xcat/plugins/pxe.pm | 13 ++++++++++++- xCAT-server/lib/xcat/plugins/yaboot.pm | 13 ++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/pxe.pm b/xCAT-server/lib/xcat/plugins/pxe.pm index 3cf8a6fae..d90759ee5 100644 --- a/xCAT-server/lib/xcat/plugins/pxe.pm +++ b/xCAT-server/lib/xcat/plugins/pxe.pm @@ -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; diff --git a/xCAT-server/lib/xcat/plugins/yaboot.pm b/xCAT-server/lib/xcat/plugins/yaboot.pm index 494bd0511..0517eb5f4 100644 --- a/xCAT-server/lib/xcat/plugins/yaboot.pm +++ b/xCAT-server/lib/xcat/plugins/yaboot.pm @@ -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;