Add routine for getting a list of all service nodes get_AllSN
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1174 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
8c28fb7c6b
commit
df00eacd34
@ -2152,4 +2152,45 @@ sub isSN
|
||||
$nodelisttab->close;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head3 get_AllSN
|
||||
|
||||
Returns an array of all service nodes
|
||||
|
||||
Arguments:
|
||||
none
|
||||
Returns:
|
||||
array of Service Nodes or empty array, if none
|
||||
Globals:
|
||||
none
|
||||
Error:
|
||||
1 - error
|
||||
Example:
|
||||
@allSN=xCAT::Utils->get_AllSN
|
||||
Comments:
|
||||
none
|
||||
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
sub get_AllSN
|
||||
{
|
||||
|
||||
# read the node from the nodelist table and see if it
|
||||
# is a member of the service group
|
||||
my @servicenodes;
|
||||
my $nodelisttab = xCAT::Table->new('nodelist');
|
||||
my $recs = $nodelisttab->getAllEntries();
|
||||
foreach (@$recs)
|
||||
{
|
||||
if (grep /service/, $_->{groups})
|
||||
{ # in service group
|
||||
push @servicenodes, $_->{node};
|
||||
}
|
||||
}
|
||||
$nodelisttab->close;
|
||||
return @servicenodes;
|
||||
}
|
||||
1;
|
||||
|
Loading…
Reference in New Issue
Block a user