From b2fdaedaa978c141e8b9316165aab57dfb7d39de Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 2 May 2008 01:37:02 +0000 Subject: [PATCH] -Restore optional disparate tftp directory support to the yaboot plugin, only triggered on explicit request git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1245 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server-2.0/lib/xcat/plugins/yaboot.pm | 33 +++++++++++++++------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/xCAT-server-2.0/lib/xcat/plugins/yaboot.pm b/xCAT-server-2.0/lib/xcat/plugins/yaboot.pm index 7082ff12b..3a340bdd6 100644 --- a/xCAT-server-2.0/lib/xcat/plugins/yaboot.pm +++ b/xCAT-server-2.0/lib/xcat/plugins/yaboot.pm @@ -149,9 +149,18 @@ sub pass_along { -#sub preprocess_request { -# return xCAT::Scope->get_broadcast_scope(@_); -#} +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; # my $callback = shift; @@ -206,13 +215,17 @@ sub process_request { } return; } - @nodes = @rnodes; - #@nodes = (); - #foreach (@rnodes) { - # if (xCAT::Utils->nodeonmynet($_)) { - # push @nodes,$_; - # } - #} + #if not shared tftpdir, then filter, otherwise, set up everything + if ($req->{_disparatetftp}) { #reading hint from preprocess_command + @nodes = (); + foreach (@rnodes) { + if (xCAT::Utils->nodeonmynet($_)) { + push @nodes,$_; + } + } + } else { + @nodes = @rnodes; + } if (ref($request->{arg})) { @args=@{$request->{arg}};