streamline nova.server_show() & avoid shadowing server_list()

This commit is contained in:
Chris Rebert 2013-11-19 17:51:59 -08:00
parent 38a229503c
commit ac36665d38

View File

@ -530,11 +530,10 @@ def server_show(server_id, profile=None):
salt '*' nova.server_show <server_id> salt '*' nova.server_show <server_id>
''' '''
ret = {} ret = {}
server_list = server_list_detailed(profile) servers = server_list_detailed(profile)
for item in server_list: for server_name, server in servers.iteritems():
id_ = server_list[item]['id'] if str(server['id']) == server_id:
if str(id_) == server_id: ret[server_name] = server
ret[server_list[item]['name']] = server_list[item]
return ret return ret