diff --git a/lib/puppet/provider/cinder_type/openstack.rb b/lib/puppet/provider/cinder_type/openstack.rb index 72cf7f46..7504e36e 100644 --- a/lib/puppet/provider/cinder_type/openstack.rb +++ b/lib/puppet/provider/cinder_type/openstack.rb @@ -114,7 +114,7 @@ Puppet::Type.type(:cinder_type).provide( end def self.pythondict2array(input) - json_input = JSON.parse(input.gsub(/u'([^']*)'/, '"\1"').gsub(/'/, '"')) + json_input = JSON.parse(input.gsub(/'/, '"')) output = [] json_input.each do | k, v | output = output + ["#{k}=#{v}"] diff --git a/spec/unit/provider/cinder_type/openstack_spec.rb b/spec/unit/provider/cinder_type/openstack_spec.rb index 5a0a6fe9..85c6677b 100644 --- a/spec/unit/provider/cinder_type/openstack_spec.rb +++ b/spec/unit/provider/cinder_type/openstack_spec.rb @@ -122,7 +122,7 @@ access_project_ids="54f4d231201b4944a5fa4587a09bda23, 54f4d231201b4944a5fa4587a0 describe '#pythondict2array' do it 'should return an array with key-value when provided with a unicode python dict' do - s = "{u'key': 'value', u'key2': 'value2'}" + s = "{'key': 'value', 'key2': 'value2'}" expect(provider_class.pythondict2array(s)).to eq(['key=value', 'key2=value2']) end @@ -139,7 +139,7 @@ access_project_ids="54f4d231201b4944a5fa4587a09bda23, 54f4d231201b4944a5fa4587a0 end it 'should call pythondict2array when provided with a hash' do - s = "{u'key': 'value', u'key2': 'value2'}" + s = "{'key': 'value', 'key2': 'value2'}" expect(provider_class.parsestring(s)).to eq(['key=value', 'key2=value2']) end end