summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Antyshev <eantyshev@virtuozzo.com>2017-06-13 15:30:11 +0000
committerEvgeny Antyshev <eantyshev@virtuozzo.com>2017-06-13 15:35:50 +0000
commitdea0beff1afe24b79429d952334fa7aaa3df5d0a (patch)
treed0063ea2ccae7b89ca76cf12e8854f52731c3518
parent08cbeacf55eb762ee21f9bf110f948a5021b62f1 (diff)
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
Notes
Notes (review): Code-Review+2: Emilien Macchi <emilien@redhat.com> Code-Review+2: Alex Schultz <aschultz@redhat.com> Workflow+1: Alex Schultz <aschultz@redhat.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Thu, 15 Jun 2017 21:52:51 +0000 Reviewed-on: https://review.openstack.org/473883 Project: openstack/puppet-glance Branch: refs/heads/master
-rw-r--r--lib/puppet/type/glance_image.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/puppet/type/glance_image.rb b/lib/puppet/type/glance_image.rb
index d33f33e..d33c772 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
89 munge do |value| 89 munge do |value|
90 return value if value.is_a? Hash 90 return value if value.is_a? Hash
91 91
92 # wrap property value in commas 92 Hash[value.scan(/([^,=]+)=([^,]*)/)]
93 value.gsub!(/=(\w+)/, '=\'\1\'')
94 Hash[value.scan(/(\S+)='([^']*)'/)]
95 end 93 end
96 94
97 validate do |value| 95 validate do |value|