nova_compute: remove ternary statement
This commit is contained in:
parent
ce5939c507
commit
10f36e8c62
1 changed files with 2 additions and 1 deletions
|
@ -197,7 +197,8 @@ def _get_server_state(module, nova):
|
||||||
# with names that partially match the server name, so we have to
|
# with names that partially match the server name, so we have to
|
||||||
# strictly filter here
|
# strictly filter here
|
||||||
servers = [x for x in servers if x.name == module.params['name']]
|
servers = [x for x in servers if x.name == module.params['name']]
|
||||||
server = servers[0] if servers else None
|
if servers:
|
||||||
|
server = servers[0]
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
module.fail_json(msg = "Error in getting the server list: %s" % e.message)
|
module.fail_json(msg = "Error in getting the server list: %s" % e.message)
|
||||||
if server and module.params['state'] == 'present':
|
if server and module.params['state'] == 'present':
|
||||||
|
|
Loading…
Reference in a new issue