diff --git a/lib/puppet/provider/glance_image/openstack.rb b/lib/puppet/provider/glance_image/openstack.rb index 57d46474..e8562ec2 100644 --- a/lib/puppet/provider/glance_image/openstack.rb +++ b/lib/puppet/provider/glance_image/openstack.rb @@ -214,7 +214,7 @@ Puppet::Type.type(:glance_image).provide( end def self.pythondict2hash(input) - return JSON.parse(input.gsub(/u'(\w*)'/, '"\1"').gsub(/'/, '"').gsub(/False/,'false').gsub(/True/,'true')) + return JSON.parse(input.gsub(/'/, '"').gsub(/False/,'false').gsub(/True/,'true')) end def self.parsestring(input) diff --git a/spec/unit/provider/glance_image_spec.rb b/spec/unit/provider/glance_image_spec.rb index 02d299b5..7bae2138 100644 --- a/spec/unit/provider/glance_image_spec.rb +++ b/spec/unit/provider/glance_image_spec.rb @@ -81,7 +81,7 @@ visibility="public" describe '#pythondict2hash' do it 'should return a hash 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.pythondict2hash(s)).to eq({"key"=>"value", "key2"=>"value2"}) end @@ -103,7 +103,7 @@ visibility="public" end it 'should call pythondict2hash 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