-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
This commit is contained in:
jbjohnso 2009-03-27 21:00:36 +00:00
parent 74e5cf6e40
commit beeeada23b
2 changed files with 14 additions and 6 deletions

View File

@ -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";

View File

@ -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