Correctly munge glance_image is_public property

glance expects True/False values whereas this type uses Yes/No.

Without this patch, puppet would return the following message with an
existing glance image with is_public attribute already set to 'True'.

puppet-agent[18190]: (/Stage[main]/Site::Controller/Glance_image[raring-server-cloudimg-amd64]/is_public) is_public changed 'True' to 'Yes'

Change-Id: I532e08e6815a8b03f5eb6a9495d886b9855762c8
This commit is contained in:
Francois Deppierraz 2014-11-27 21:49:28 +01:00
parent 99eea1138f
commit 031609b572
1 changed files with 2 additions and 1 deletions

View File

@ -46,7 +46,8 @@ Puppet::Type.newtype(:glance_image) do
newvalues(/(y|Y)es/, /(n|N)o/)
defaultto('Yes')
munge do |v|
v.to_s.capitalize
'True' if v =~ /^(y|Y)es$/
'False' if v =~ /^(n|N)o$/
end
end