enh(pacemaker/local): mode crm - modify nodes online/offline regexp (#3347)

This commit is contained in:
qgarnier 2021-12-28 11:44:10 +01:00 committed by GitHub
parent 88ad48fa73
commit ca5d80f37d
1 changed files with 2 additions and 2 deletions

View File

@ -332,10 +332,10 @@ sub parse_crm {
if ($lines[$i] !~ /partition with quorum$/) {
$self->{cluster}->{global}->{quorum}->{quorum_status} = 'noQuorum';
}
} elsif ($lines[$i] =~ /^(offline|online):\s*\[\s*(.*?)\s*\]/i) {
} elsif ($lines[$i] =~ /^(?:(?:\s*\*\s*)?(offline|online)):\s*\[\s*(.*?)\s*\]/i) {
my @nodes = split(/\s+/, $2);
$self->{cluster}->{global}->{nodes}->{lc($1)} = scalar(@nodes);
$self->{cluster}->{global}->{nodes}->{lc($1) . '_names'} = ' ' . join(' ', @nodes);
$self->{cluster}->{global}->{nodes}->{lc($1) . '_names'} = join(' ', @nodes);
} elsif ($lines[$i] =~ /^node\s+(\S+?):\s*standby/i) {
$self->{cluster}->{global}->{nodes}->{standby}++;
$self->{cluster}->{global}->{nodes}->{standby_names} .= ' ' . $1;