Adapt providers to new pcs-0.11.5 output

Pcs `constraint colocation show` output changed since ff1d564830 .

pcs-0.11.4:

Colocation Constraints:
  ip-172.31.0.1 with haproxy-bundle (score:INFINITY)
  ip-172.31.0.1 with galera-bundle (score:INFINITY) (rsc-role:Started) (with-rsc-role:Promoted)

pcs-0.11.5:

Colocation Constraints:
  resource 'ip-172.31.0.1' with resource 'haproxy-bundle'
  Started resource 'ip-172.31.0.1' with Promoted resource 'galera-bundle'

Our helper functions need to be adapted to the new output.

Change-Id: I4e916b20dedf8e40d2ffd032d8950fe16d1a7079
Co-authored-by: Luca Miccini <lmiccini@redhat.com>
Related-Bug: #2023019
This commit is contained in:
Damien Ciabrini 2023-06-08 12:52:40 +02:00
parent 3a9081f612
commit f10ce89117
1 changed files with 2 additions and 2 deletions

View File

@ -68,9 +68,9 @@ Puppet::Type.type(:pcmk_constraint).provide(:default) do
if @resource[:master_slave]
# pacemaker 2.1 started returning Promoted instead of Master
# so we need to cater to both
return true if line.include? resource_resource + ' with ' + resource_location and (line.include? "with-rsc-role:Master" or line.include? "with-rsc-role:Promoted")
return true if line =~ /(resource )?'?#{resource_resource}'? with ((Promoted )?resource )?'?#{resource_location}'?/ and line =~ /(with-rsc-role:(Master|Promoted)|Promoted resource)/
else
return true if line.include? resource_resource + ' with ' + resource_location
return true if line =~ /(resource )?'?#{resource_resource}'? with (resource )?'?#{resource_location}'?/
end
when :order
return true if line.include? resource_name