From beeeada23b7111b0159119503c268557e6df2e98 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 27 Mar 2009 21:00:36 +0000 Subject: [PATCH] -Ensure that dhcp/conserver cfg is only manipulated on local service node on start -Enable makedhcp to allow local only operation git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3020 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/AAsn.pm | 3 +++ xCAT-server/lib/xcat/plugins/dhcp.pm | 17 +++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/AAsn.pm b/xCAT-server/lib/xcat/plugins/AAsn.pm index 1780f8e2f..245e9014e 100644 --- a/xCAT-server/lib/xcat/plugins/AAsn.pm +++ b/xCAT-server/lib/xcat/plugins/AAsn.pm @@ -388,6 +388,7 @@ sub setup_CONS # make the consever 8 configuration file my $cmdref; $cmdref->{command}->[0] = "makeconservercf"; + $cmdref->{arg}->[0] = "-l"; $cmdref->{cwd}->[0] = "/opt/xcat/sbin"; $cmdref->{svboot}->[0] = "yes"; @@ -448,6 +449,7 @@ sub setup_DHCP } my $cmdref; $cmdref->{command}->[0] = "makedhcp"; + $cmdref->{arg}->[0] = "-l"; $cmdref->{cwd}->[0] = "/opt/xcat/sbin"; $cmdref->{arg}->[0] = "-n"; @@ -462,6 +464,7 @@ sub setup_DHCP } $cmdref; $cmdref->{command}->[0] = "makedhcp"; + $cmdref->{arg}->[0] = "-l"; $cmdref->{cwd}->[0] = "/opt/xcat/sbin"; $cmdref->{arg}->[0] = "-a"; diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 2782cdc80..e92737537 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -298,18 +298,23 @@ sub preprocess_request { my $req = shift; $callback = shift; + my $localonly + @ARGV = @{$req->{arg}}; + GetOptions('l' => \$localonly); if ($req->{_xcatdest}) { return [$req]; } #Exit if the packet has been preprocessed in its history my @requests = ({%$req}); #Start with a straight copy to reflect local instance - my @sn = xCAT::Utils->getSNList('dhcpserver'); - foreach my $s (@sn) - { - my $reqcopy = {%$req}; - $reqcopy->{'_xcatdest'} = $s; - push @requests, $reqcopy; + unless ($localonly) { + my @sn = xCAT::Utils->getSNList('dhcpserver'); + foreach my $s (@sn) + { + my $reqcopy = {%$req}; + $reqcopy->{'_xcatdest'} = $s; + push @requests, $reqcopy; + } } if (scalar(@requests) > 1) { #hierarchy detected, enforce more rigorous sanity