diff options
author | Jenkins <jenkins@review.openstack.org> | 2017-07-24 19:54:34 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2017-07-24 19:54:34 +0000 |
commit | 3e0ac73abc4a7da0e8f40f77c6dc84614e548ddb (patch) | |
tree | e974609b7149dd7f25c243336155f766e1bf5194 | |
parent | 19b3128034512ae4f33df5956e8c93da9c5e047c (diff) | |
parent | ed058c46a1b016e53cf8312a69e13a0bc832dc2a (diff) | |
download | python-novaclient-3e0ac73abc4a7da0e8f40f77c6dc84614e548ddb.tar.gz |
Merge "Expect id and disabled_reason in GET /os-services response"
-rw-r--r-- | novaclient/v2/shell.py | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/novaclient/v2/shell.py b/novaclient/v2/shell.py index c00f88be..947fc31a 100644 --- a/novaclient/v2/shell.py +++ b/novaclient/v2/shell.py @@ -3469,17 +3469,8 @@ def do_reset_network(cs, args): def do_service_list(cs, args): """Show a list of all running services. Filter by host & binary.""" result = cs.services.list(host=args.host, binary=args.binary) - columns = ["Binary", "Host", "Zone", "Status", "State", "Updated_at"] - # NOTE(sulo): we check if the response has disabled_reason - # so as not to add the column when the extended ext is not enabled. - if result and hasattr(result[0], 'disabled_reason'): - columns.append("Disabled Reason") - - # NOTE(gtt): After https://review.openstack.org/#/c/39998/ nova will - # show id in response. - if result and hasattr(result[0], 'id'): - columns.insert(0, "Id") - + columns = ["Id", "Binary", "Host", "Zone", "Status", + "State", "Updated_at", "Disabled Reason"] utils.print_list(result, columns) |