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: I1f96bf979e67fd7fb8fd1d984809fd072783224c
This commit is contained in:
Mathieu Gagné 2013-05-21 19:30:22 -04:00
parent 44a82aa06a
commit f126d462ab
5 changed files with 20 additions and 15 deletions

View File

@ -9,10 +9,11 @@ Puppet::Type.newtype(:glance_api_config) 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

View File

@ -9,10 +9,11 @@ Puppet::Type.newtype(:glance_api_paste_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

View File

@ -9,10 +9,11 @@ Puppet::Type.newtype(:glance_cache_config) 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

View File

@ -9,10 +9,11 @@ Puppet::Type.newtype(:glance_registry_config) 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

View File

@ -9,10 +9,11 @@ Puppet::Type.newtype(:glance_registry_paste_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