Browse Source

Allow for a more permissible regex

Some openstack installations use characters that are not in \w, the
old regex, now moved to string2hash was more permissible, and
there's probably no reason the regex in pythondict2hash can't be
just as permissible.

Change-Id: I35b964d96e6a558f1a10daa2391a398db60ea800
(cherry picked from commit 7111aa75f9)
(cherry picked from commit 7ff77f8225)
(cherry picked from commit 99f8e1b458)
changes/02/806702/1
Erik Berg 11 months ago committed by Ebbex
parent
commit
b4be9b148a
  1. 2
      lib/puppet/provider/nova_aggregate/openstack.rb

2
lib/puppet/provider/nova_aggregate/openstack.rb

@ -123,7 +123,7 @@ Puppet::Type.type(:nova_aggregate).provide(
end
def self.pythondict2hash(input)
return JSON.parse(input.gsub(/u'(\w*)'/, '"\1"').gsub(/'/, '"'))
return JSON.parse(input.gsub(/u'([^']*)'/, '"\1"').gsub(/'/, '"'))
end
def self.parsestring(input)

Loading…
Cancel
Save