From 2c1282cecf33162b5483f5cb558f98395945380b Mon Sep 17 00:00:00 2001 From: Nam Nguyen Hoai Date: Thu, 18 Aug 2016 15:24:51 +0700 Subject: Add a new column and a new option the 'os port list' cmd This patch will add a new column called status to the result of the 'os port list' command and --long option to 'os port list' command. Co-Authored-By: Ha Van Tu Change-Id: I4f942414e969687304b578ed7f003dd219c0f2f8 Closes-Bug: #1613995 Closes-Bug: #1614321 Partially-Implements: blueprint network-commands-options --- openstackclient/network/v2/port.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'openstackclient/network') diff --git a/openstackclient/network/v2/port.py b/openstackclient/network/v2/port.py index 92b286a9..abdc5f05 100644 --- a/openstackclient/network/v2/port.py +++ b/openstackclient/network/v2/port.py @@ -360,6 +360,12 @@ class ListPort(command.Lister): metavar='', help=_("List only ports attached to this server (name or ID)"), ) + parser.add_argument( + '--long', + action='store_true', + default=False, + help=_("List additional fields in output") + ) return parser def take_action(self, parsed_args): @@ -371,15 +377,20 @@ class ListPort(command.Lister): 'name', 'mac_address', 'fixed_ips', + 'status', ) column_headers = ( 'ID', 'Name', 'MAC Address', 'Fixed IP Addresses', + 'Status', ) filters = {} + if parsed_args.long: + columns += ('security_groups', 'device_owner',) + column_headers += ('Security Groups', 'Device Owner',) if parsed_args.device_owner is not None: filters['device_owner'] = parsed_args.device_owner if parsed_args.router: -- cgit v1.2.1