From dea0beff1afe24b79429d952334fa7aaa3df5d0a Mon Sep 17 00:00:00 2001 From: Evgeny Antyshev Date: Tue, 13 Jun 2017 15:30:11 +0000 Subject: [PATCH] Fix parsing of image properties when more then one pair of key/value's are given then this code shows wrong behavior: vm_mode=exe,cinder_img_volume_type=vstorage it makes this: vm_mode=''exe',cinder_img_volume_type=vstorage' Reason is the first conversion being to broad, and 2nd match matches the whole string. Change-Id: I5bcf23374b57197680b87b554392ee172bf90571 --- lib/puppet/type/glance_image.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/puppet/type/glance_image.rb b/lib/puppet/type/glance_image.rb index d33f33ef..d33c7728 100644 --- a/lib/puppet/type/glance_image.rb +++ b/lib/puppet/type/glance_image.rb @@ -89,9 +89,7 @@ Puppet::Type.newtype(:glance_image) do munge do |value| return value if value.is_a? Hash - # wrap property value in commas - value.gsub!(/=(\w+)/, '=\'\1\'') - Hash[value.scan(/(\S+)='([^']*)'/)] + Hash[value.scan(/([^,=]+)=([^,]*)/)] end validate do |value|