Fix puppet 8 compatibility of nova_flavor

Fix the following error detected by puppet 8.

Munging failed for value true in class is_public: undefined method `=~'
for true:TrueClass ...

Change-Id: I7d078ea72c5c1c4898247f61422986f277ee9a98
This commit is contained in:
Takashi Kajinami 2024-05-31 15:04:41 +09:00
parent 2c0c052297
commit 8593d289d1

View File

@ -115,6 +115,7 @@ Puppet::Type.newtype(:nova_flavor) do
newvalues(/(y|Y)es/, /(n|N)o/, /(t|T)rue/, /(f|F)alse/, true, false) newvalues(/(y|Y)es/, /(n|N)o/, /(t|T)rue/, /(f|F)alse/, true, false)
defaultto(true) defaultto(true)
munge do |v| munge do |v|
if v.is_a?(String)
if v =~ /^(y|Y)es$/ if v =~ /^(y|Y)es$/
:true :true
elsif v =~ /^(n|N)o$/ elsif v =~ /^(n|N)o$/
@ -122,6 +123,9 @@ Puppet::Type.newtype(:nova_flavor) do
else else
v.to_s.downcase.to_sym v.to_s.downcase.to_sym
end end
else
v.to_s.downcase.to_sym
end
end end
end end