Capitalize boolean values in config files

This patch allows the usage of Puppet boolean values and still
configure values with OpenStack boolean style: True/False.

Change-Id: I6e66b9b64cd63dee4f73e4f6b6121a62573c8cfe
This commit is contained in:
Mathieu Gagné
2013-05-14 14:11:38 -04:00
parent 7de7e1bed7
commit 3eac0fd0cc
2 changed files with 8 additions and 4 deletions

View File

@@ -11,8 +11,11 @@ Puppet::Type.newtype(:nova_config) do
end
newproperty(:value) do
desc 'The value of the setting to be defined.'
munge do |value|
value.to_s
value = value.to_s.strip
value.capitalize! if value =~ /^(true|false)$/i
value
end
newvalues(/^[\S ]*$/)
end

View File

@@ -9,10 +9,11 @@ Puppet::Type.newtype(:nova_paste_api_ini) do
newproperty(:value) do
desc 'The value of the setting to be defined.'
munge do |v|
v.to_s.strip
munge do |value|
value = value.to_s.strip
value.capitalize! if value =~ /^(true|false)$/i
value
end
end
end