2008-02-03 00:01:35 +00:00
|
|
|
package xCAT::Scope;
|
|
|
|
use xCAT::Utils;
|
|
|
|
use xCAT::Table;
|
|
|
|
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
|
2008-05-19 16:01:29 +00:00
|
|
|
foreach (xCAT::Utils->getSNList()) {
|
2008-02-03 00:01:35 +00:00
|
|
|
if (xCAT::Utils->thishostisnot($_)) {
|
|
|
|
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}) {
|
|
|
|
# if (xCAT::Utils->thishostisnot($_)) {
|
|
|
|
# my $reqcopy = {%$req};
|
|
|
|
# $reqcopy->{'_xcatdest'} = $_;
|
|
|
|
# push @requests,$reqcopy;
|
|
|
|
# }
|
|
|
|
# }
|
|
|
|
#}
|
|
|
|
#return \@requests;
|
2008-02-03 00:01:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
1;
|