Merge "Make sure we test for Promoted when looking for constraints"

This commit is contained in:
Zuul 2021-09-06 17:50:47 +00:00 committed by Gerrit Code Review
commit 1cd0951df0
1 changed files with 3 additions and 1 deletions

View File

@ -66,7 +66,9 @@ Puppet::Type.type(:pcmk_constraint).provide(:default) do
resource_location = @resource[:location].gsub(':', '.')
resource_resource = @resource[:resource].gsub(':', '.')
if @resource[:master_slave]
return true if line.include? resource_resource + ' with ' + resource_location and line.include? "with-rsc-role:Master"
# 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")
else
return true if line.include? resource_resource + ' with ' + resource_location
end