diff --git a/lib/puppet/type/cinder_type.rb b/lib/puppet/type/cinder_type.rb index cd203b79..616509d1 100644 --- a/lib/puppet/type/cinder_type.rb +++ b/lib/puppet/type/cinder_type.rb @@ -9,14 +9,14 @@ Puppet::Type.newtype(:cinder_type) do end newproperty(:properties, :array_matching => :all) do - desc 'The properties of the cinder type. Should be an array, all items should match pattern ' + desc 'The properties of the cinder type. Should be an array, all items should match pattern ' defaultto [] def insync?(is) return false unless is.is_a? Array is.sort == should.sort end validate do |value| - raise ArgumentError, "Properties doesn't match" unless value.match(/^\s*[^=\s]+=\S(([^=,])+((?<=\S),(?=\S))?)+([^\s=,])+$/) + raise ArgumentError, "Properties doesn't match" unless value.match(/^[^=\s]+=[^=]+$/) end end diff --git a/spec/acceptance/10_basic_cinder_spec.rb b/spec/acceptance/10_basic_cinder_spec.rb index 4694ffc0..aacc4e5b 100644 --- a/spec/acceptance/10_basic_cinder_spec.rb +++ b/spec/acceptance/10_basic_cinder_spec.rb @@ -14,6 +14,10 @@ describe 'basic cinder' do include openstack_integration::memcached include openstack_integration::keystone include openstack_integration::cinder + + cinder_type { 'testvolumetype' : + properties => ['k=v', 'key1=val1', 'key2= True'] + } EOS