defect 3851, further enhancements
This commit is contained in:
parent
3cae77406c
commit
4bac666675
@ -3174,7 +3174,7 @@ sub isSELINUX
|
||||
Input:
|
||||
array of nodes in the noderange
|
||||
Example:
|
||||
my $mn=xCAT::Utils->noderangecontainsMN($noderange);
|
||||
my @mn=xCAT::Utils->noderangecontainsMN($noderange);
|
||||
Comments:
|
||||
=cut
|
||||
|
||||
@ -3183,26 +3183,30 @@ sub noderangecontainsMn
|
||||
{
|
||||
my ($class, @noderange)=@_;
|
||||
# check if any node in the noderange is the Management Node return the
|
||||
# name
|
||||
my $mname;
|
||||
# name
|
||||
my @mnames; # management node names in the database, members of __mgmtnode
|
||||
my $tab = xCAT::Table->new('nodelist');
|
||||
my @nodelist=$tab->getAllNodeAttribs(['node','groups']);
|
||||
foreach my $n (@nodelist) {
|
||||
if (defined($n->{'groups'})) {
|
||||
my @groups=split(",",$n->{'groups'});
|
||||
if ((grep (/__mgmtnode/,@groups))) { # this is the MN
|
||||
$mname=$n->{'node'};
|
||||
last;
|
||||
push @mnames,$n->{'node'};
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($mname) { # if Management Node defined in the database
|
||||
if (grep(/^$mname$/, @noderange)) { # if MN in the noderange
|
||||
return $mname;
|
||||
} else {
|
||||
return ;
|
||||
my @MNs; # management node names found the noderange
|
||||
if (@mnames) { # if any Management Node defined in the database
|
||||
foreach my $mn (@mnames) {
|
||||
if (grep(/^$mn$/, @noderange)) { # if MN in the noderange
|
||||
push @MNs, $mn;
|
||||
}
|
||||
}
|
||||
if (@MNs) { # management nodes in the noderange
|
||||
return @MNs;
|
||||
}
|
||||
}
|
||||
return; # if no MN in the noderange, return nothing
|
||||
}
|
||||
|
||||
=head3 filter_nodes
|
||||
|
Loading…
Reference in New Issue
Block a user