diff options
| author | Rui Chen <chenrui.momo@gmail.com> | 2016-03-14 18:07:23 +0800 |
|---|---|---|
| committer | Rui Chen <chenrui.momo@gmail.com> | 2016-03-14 18:07:23 +0800 |
| commit | 8664a2f8aecd3d91a929e7e2b76772cae20f41e1 (patch) | |
| tree | a367f5b52ab77c7db050a6cffb3d6d174f3f0b49 /openstackclient/compute | |
| parent | 76081239d2f99acb36bdddddf5339e5d3cc8ae4a (diff) | |
| download | python-openstackclient-8664a2f8aecd3d91a929e7e2b76772cae20f41e1.tar.gz | |
Support "--long" option in ListService
Add "--long" option in ListService so that compute service
disabled reason can be showed.
Change-Id: I1ace8f1c4e4efe0a1a8f6710425d73eb5db9e5e1
Closes-Bug: #1556815
Diffstat (limited to 'openstackclient/compute')
| -rw-r--r-- | openstackclient/compute/v2/service.py | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/openstackclient/compute/v2/service.py b/openstackclient/compute/v2/service.py index 1cc91711..89f5cad9 100644 --- a/openstackclient/compute/v2/service.py +++ b/openstackclient/compute/v2/service.py @@ -49,19 +49,37 @@ class ListService(command.Lister): "--service", metavar="<service>", help="Name of service") + parser.add_argument( + "--long", + action="store_true", + default=False, + help="List additional fields in output" + ) return parser def take_action(self, parsed_args): compute_client = self.app.client_manager.compute - columns = ( - "Id", - "Binary", - "Host", - "Zone", - "Status", - "State", - "Updated At" - ) + if parsed_args.long: + columns = ( + "Id", + "Binary", + "Host", + "Zone", + "Status", + "State", + "Updated At", + "Disabled Reason" + ) + else: + columns = ( + "Id", + "Binary", + "Host", + "Zone", + "Status", + "State", + "Updated At" + ) data = compute_client.services.list(parsed_args.host, parsed_args.service) return (columns, |
