From 21df4284a0eee6e262ef764e02e53c5e5bec1ecc Mon Sep 17 00:00:00 2001 From: wanghuaz Date: Tue, 6 Dec 2011 13:18:46 +0000 Subject: [PATCH] Fixed the problem which adding lpars into dhcpsd.cnf with makedhcp command. lpar os deployment should be handled by NIM git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11137 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/dhcp.pm | 33 +++++++++++++++------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index d04eef543..ee087a3c1 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -737,10 +737,10 @@ sub preprocess_request my $ntable = xCAT::Table->new('nodetype'); if ($ntable) { my $mytype = $ntable->getNodeAttribs($n,['nodetype']); - if ($mytype =~ /osi/) { + if ($mytype->{nodetype} =~ /osi/) { $Imsg++; } - unless ($mytype =~ /osi/) { + unless ($mytype->{nodetype} =~ /osi/) { push @tmplist, $n; } } @@ -787,20 +787,23 @@ sub preprocess_request } } } else { #send the request to every dhservers - @requests = ({%$req}); #Start with a straight copy to reflect local instance - unless ($localonly) { - my @sn = xCAT::Utils->getSNList('dhcpserver'); - if (@sn > 0) { $hasHierarchy=1; } + if (@nodes > 0) { + $req->{'node'}=\@nodes; + @requests = ({%$req}); #Start with a straight copy to reflect local instance + unless ($localonly) { + my @sn = xCAT::Utils->getSNList('dhcpserver'); + if (@sn > 0) { $hasHierarchy=1; } - foreach my $s (@sn) - { - if (scalar @nodes == 1 and $nodes[0] eq $s) { next; } - my $reqcopy = {%$req}; - $reqcopy->{'_xcatdest'} = $s; - $reqcopy->{_xcatpreprocessed}->[0] = 1; - push @requests, $reqcopy; + foreach my $s (@sn) + { + if (scalar @nodes == 1 and $nodes[0] eq $s) { next; } + my $reqcopy = {%$req}; + $reqcopy->{'_xcatdest'} = $s; + $reqcopy->{_xcatpreprocessed}->[0] = 1; + push @requests, $reqcopy; + } } - } + } } if ( $hasHierarchy) @@ -1240,7 +1243,7 @@ sub process_request my $ntype = $ntable->getNodeAttribs($n,['nodetype']); # don't add if it is type "osi" - unless ($ntype =~ /osi/) { + unless ($ntype->{nodetype} =~ /osi/) { push @tmplist, $n; } }