2008-02-03 00:01:35 +00:00
|
|
|
package xCAT::Scope;
|
|
|
|
use xCAT::Utils;
|
|
|
|
use xCAT::Table;
|
2012-08-09 03:48:50 +00:00
|
|
|
use xCAT::ServiceNodeUtils qw(getSNList);
|
2008-02-03 00:01:35 +00:00
|
|
|
sub get_broadcast_scope {
|
|
|
|
my $req = shift;
|
|
|
|
if ($req =~ /xCAT::Scope/) {
|
|
|
|
$req = shift;
|
|
|
|
}
|
|
|
|
$callback = shift;
|
2009-07-15 19:25:15 +00:00
|
|
|
if ($req->{_xcatpreprocessed}->[0] == 1) { return [$req]; }
|
|
|
|
#Exit if the packet has been preprocessed in its history
|
2008-02-03 00:01:35 +00:00
|
|
|
my @requests = ({%$req}); #Start with a straight copy to reflect local instance
|
2012-08-09 03:48:50 +00:00
|
|
|
foreach (xCAT::ServiceNodeUtils->getSNList()) {
|
|
|
|
if (xCAT::NetworkUtils->thishostisnot($_)) {
|
2008-02-03 00:01:35 +00:00
|
|
|
my $reqcopy = {%$req};
|
|
|
|
$reqcopy->{'_xcatdest'} = $_;
|
2009-07-15 19:25:15 +00:00
|
|
|
$reqcopy->{_xcatpreprocessed}->[0] = 1;
|
2008-02-03 00:01:35 +00:00
|
|
|
push @requests,$reqcopy;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return \@requests;
|
2008-05-19 16:01:29 +00:00
|
|
|
#my $sitetab = xCAT::Table->new('site');
|
|
|
|
#(my $ent) = $sitetab->getAttribs({key=>'xcatservers'},'value');
|
|
|
|
#$sitetab->close;
|
|
|
|
#if ($ent and $ent->{value}) {
|
|
|
|
# foreach (split /,/,$ent->{value}) {
|
2012-08-09 03:48:50 +00:00
|
|
|
# if (xCAT::NetworkUtils->thishostisnot($_)) {
|
2008-05-19 16:01:29 +00:00
|
|
|
# my $reqcopy = {%$req};
|
|
|
|
# $reqcopy->{'_xcatdest'} = $_;
|
|
|
|
# push @requests,$reqcopy;
|
|
|
|
# }
|
|
|
|
# }
|
|
|
|
#}
|
|
|
|
#return \@requests;
|
2008-02-03 00:01:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
1;
|