Merge "Remove handling of 'u' prefix"
This commit is contained in:
@@ -125,7 +125,7 @@ Puppet::Type.type(:nova_aggregate).provide(
|
||||
end
|
||||
|
||||
def self.pythondict2hash(input)
|
||||
return JSON.parse(input.gsub(/u'([^']*)'/, '"\1"').gsub(/'/, '"'))
|
||||
return JSON.parse(input.gsub(/'/, '"'))
|
||||
end
|
||||
|
||||
def self.parsestring(input)
|
||||
|
||||
@@ -96,7 +96,7 @@ hosts="[u\'example\']"
|
||||
|
||||
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(described_class.pythondict2hash(s)).to eq({"key"=>"value", "key2"=>"value2"})
|
||||
end
|
||||
|
||||
@@ -113,7 +113,7 @@ hosts="[u\'example\']"
|
||||
end
|
||||
|
||||
it 'should call pythondict2hash when provided with a hash' do
|
||||
s = "{u'key': 'value', u'key2': 'value2'}"
|
||||
s = "{'key': 'value', 'key2': 'value2'}"
|
||||
expect(described_class.parsestring(s)).to eq({"key"=>"value", "key2"=>"value2"})
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user