-Restore disparate tftp directory support to pxe plugin when requested

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1246 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2008-05-02 01:43:35 +00:00
parent b2fdaedaa9
commit 13c1aa146a

View File

@ -143,9 +143,18 @@ sub pass_along {
# Removing hierarchy, command will be processed on the MN.
# If hierachy is put back the code my change to use Utils->get_Servicenode
# and not use xcatservers from the site table.
sub preprocess_request {
#Assume shared tftp directory for boring people, but for cool people, help sync up tftpdirectory contents when
#they specify no sharedtftp in site table
my $stab = xCAT::Table->new('site');
my $req = shift;
my $sent = $stab->getAttribs({key=>'sharedtftp'},'value');
if ($sent and ($sent->{value} == 0 or $ent->{value} =~ /no/i)) {
$req->{'_disparatetftp'}=[1];
return xCAT::Scope->get_broadcast_scope($req,@_);
}
return [$req];
}
#sub preprocess_request {
# my $req = shift;
# $callback = shift;
@ -217,13 +226,18 @@ sub process_request {
}
return;
}
@nodes = @rnodes;
#@nodes = ();
#foreach (@rnodes) {
#if (xCAT::Utils->nodeonmynet($_)) {
# push @nodes,$_;
#}
#}
#if not shared, then help sync up
if ($req->{_disparatetftp}) { #reading hint from preprocess_command
@nodes = ();
foreach (@rnodes) {
if (xCAT::Utils->nodeonmynet($_)) {
push @nodes,$_;
}
}
} else {
@nodes = @rnodes;
}
if (! -r "$tftpdir/pxelinux.0") {
unless (-r "/usr/lib/syslinux/pxelinux.0") {
$callback->({error=>["Unable to find pxelinux.0 "],errorcode=>[1]});