From c5d876fe6667c8dd34e32aad3d8edb1af4682362 Mon Sep 17 00:00:00 2001 From: Krist van Besien Date: Mon, 18 Apr 2016 12:32:31 +0200 Subject: [PATCH] Update default.rb In ruby the "truth" value of a set variable is always true, so we need to explicitly compare with :true --- lib/puppet/provider/pcmk_constraint/default.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/puppet/provider/pcmk_constraint/default.rb b/lib/puppet/provider/pcmk_constraint/default.rb index ae397b9c..2e16f83b 100644 --- a/lib/puppet/provider/pcmk_constraint/default.rb +++ b/lib/puppet/provider/pcmk_constraint/default.rb @@ -11,7 +11,7 @@ def create cmd = 'constraint location add ' + resource_name + ' ' + resource_resource + ' ' + @resource[:location] + ' ' + @resource[:score] when :colocation resource_location = @resource[:location].gsub(':', '.') - if @resource[:master_slave] + if @resource[:master_slave] == :true cmd = 'constraint colocation add ' + resource_resource + ' with master ' + resource_location + ' ' + @resource[:score] else cmd = 'constraint colocation add ' + resource_resource + ' with ' + resource_location + ' ' + @resource[:score] @@ -50,7 +50,7 @@ def exists? when :location return true if line.include? resource_name when :colocation - if @resource[:master_slave] + if @resource[:master_slave] == :true return true if line.include? resource_resource + ' with ' + resource_location and line.include? "with-rsc-role:Master" else return true if line.include? resource_resource + ' with ' + resource_location