Use common function to parse python dict
Depends-on: https://review.opendev.org/931722 Change-Id: I1ea417f17ef6a216bc79ddf9fd1d152c40b511c1
This commit is contained in:
parent
51fbe71584
commit
059110316d
@ -65,15 +65,11 @@ Puppet::Type.type(:manila_type).provide(
|
|||||||
@property_hash[:ensure] == :present
|
@property_hash[:ensure] == :present
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.parse_specs(specs)
|
|
||||||
JSON.parse(specs.gsub(/'/, '"'))
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.instances
|
def self.instances
|
||||||
self.do_not_manage = true
|
self.do_not_manage = true
|
||||||
list = request('share type', 'list').collect do |type|
|
list = request('share type', 'list').collect do |type|
|
||||||
required_extra_specs = self.parse_specs(type[:required_extra_specs])
|
required_extra_specs = self.parse_python_dict(type[:required_extra_specs])
|
||||||
optional_extra_specs = self.parse_specs(type[:optional_extra_specs])
|
optional_extra_specs = self.parse_python_dict(type[:optional_extra_specs])
|
||||||
|
|
||||||
new({
|
new({
|
||||||
:name => type[:name],
|
:name => type[:name],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user