Expect id and disabled_reason in GET /os-services response
Since we no longer have v2 extensions, the GET /os-services response is going to have an id and disabled_reason field, so we don't need to have conditional checks around those. Change-Id: I5d11ffb48febb53f70bf1193b2cba5ec839a3f0d
This commit is contained in:
parent
02145d765c
commit
ed058c46a1
|
@ -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)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue