Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix exists? to return the correct values

  • Loading branch information...
commit 99dd28380946b04d9e6517fd5bb898b2df26de78 1 parent 2f79a27
@rodjek authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/puppet/provider/ha_crm_property/crm.rb
View
8 lib/puppet/provider/ha_crm_property/crm.rb
@@ -13,15 +13,15 @@ def destroy
end
def exists?
- if resource[:only_run_on_dc] and Facter.value(:ha_cluster_dc) != Facter.value(:fqdn)
- resource[:value]
+ if (resource[:only_run_on_dc] == :true) and (Facter.value(:ha_cluster_dc) != Facter.value(:fqdn))
+ true
else
cib = REXML::Document.new File.open("/var/lib/heartbeat/crm/cib.xml")
property = REXML::XPath.first(cib, "/cib/configuration/crm_config/cluster_property_set/nvpair[@name='#{resource[:name]}']")
if property.nil?
- :absent
+ false
else
- property.attribute(:value).value
+ property.attribute(:value).value == resource[:value] ? true : false
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.