Refactor of domain_name_from_id

Small refactoring of domain_name_from_id for keystone provider.

Change-Id: I5f63fb2705a59ac233c0dc1c2e323322751ebb87
This commit is contained in:
Denis Egorenko 2016-01-13 20:00:10 +03:00
parent 4d1fd0ea3b
commit ae556eec8f
1 changed files with 2 additions and 4 deletions

View File

@ -105,10 +105,8 @@ class Puppet::Provider::Keystone < Puppet::Provider::Openstack
end
unless @domain_hash.include?(id)
name = request('domain', 'show', id)[:name]
@domain_hash[id] = name if name
end
unless @domain_hash.include?(id)
err("Could not find domain with id [#{id}]")
err("Could not find domain with id [#{id}]") unless name
@domain_hash[id] = name
end
@domain_hash[id]
end