trove_datastore_version: Handle missing datastore
The trove_datastore_version resource fails if the datastore is not yet created. This fixes that problem. Change-Id: I403f0ede9061eb0a9361b084ada26954250fb2e6
This commit is contained in:
parent
ea9d67ad7b
commit
4e25bbbe9f
@ -51,10 +51,15 @@ Puppet::Type.type(:trove_datastore_version).provide(
|
||||
|
||||
def self.build_datastore_version_hash(datastore)
|
||||
dvs = {}
|
||||
request('datastore version', 'list', datastore).each do |attrs|
|
||||
dvs[attrs[:name]] = attrs
|
||||
begin
|
||||
request('datastore version', 'list', datastore).each do |attrs|
|
||||
dvs[attrs[:name]] = attrs
|
||||
end
|
||||
rescue Puppet::ExecutionFailure => e
|
||||
if ! e.message.match("Datastore '#{datastore}' cannot be found")
|
||||
raise e
|
||||
end
|
||||
end
|
||||
dvs
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user