Add option to allow filtering by mac-address on port list

Bug #1634333 reported by Yan Xing'an
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-openstackclient
Fix Released
Undecided
Yan Xing'an

Bug Description

yanxa@ubuntu:python-openstackclient$ openstack port list --help
usage: openstack port list [-h] [-f {csv,json,table,value,yaml}] [-c COLUMN]
                           [--max-width <integer>] [--noindent]
                           [--quote {all,minimal,none,nonnumeric}]
                           [--device-owner <device-owner>]
                           [--network <network>]
                           [--router <router> | --server <server>] [--long]

List ports

optional arguments:
  -h, --help show this help message and exit
  --device-owner <device-owner>
                        List only ports with the specified device owner. This
                        is the entity that uses the port (for example,
                        network:dhcp).
  --network <network> List only ports connected to this network (name or ID)
  --router <router> List only ports attached to this router (name or ID)
  --server <server> List only ports attached to this server (name or ID)
  --long List additional fields in output

yanxa@ubuntu:python-openstackclient$ openstack port list
+--------------------------------------+------+-------------------+-----------------------------------------------+--------+
| ID | Name | MAC Address | Fixed IP Addresses | Status |
+--------------------------------------+------+-------------------+-----------------------------------------------+--------+
| 00b61d62-7efd-40db-9f67-df53b3756b60 | | fa:16:3e:cc:43:67 | ip_address='10.0.0.1', subnet_id='e82a77a0 | DOWN |
| | | | -3b6c-4b4b-b047-125b225fc8a2' | |
| 5a1b9e14-ee68-4aa9-a72f-039e2cb8341e | | fa:16:3e:26:a8:39 | ip_address='172.24.4.3', subnet_id='6600978a- | DOWN |
| | | | 193c-4c6e-84dc-b259d812ab1e' | |
| | | | ip_address='2001:db8::c', | |
| | | | subnet_id='8b1e8469-7765-40bc- | |
| | | | b48d-e79085403467' | |
| 6e57a4e6-3021-4300-8130-d2623c7824cc | | fa:16:3e:1c:df:d9 | ip_address='10.0.0.2', subnet_id='e82a77a0 | DOWN |
| | | | -3b6c-4b4b-b047-125b225fc8a2' | |
| | | | ip_address='2001:db8:8000:0:f816:3eff:fe1c:df | |
| | | | d9', subnet_id='550e7ced-48fe- | |
| | | | 42b8-b4f6-9ccdae901266' | |
| cba034bc-62ab-4275-9500-8bf2b54f2c95 | | fa:16:3e:33:3c:3c | ip_address='2001:db8:8000::1', subnet_id | DOWN |
| | | | ='550e7ced-48fe-42b8-b4f6-9ccdae901266' | |
+--------------------------------------+------+-------------------+-----------------------------------------------+--------+

If the port number is large scale, it spend too many time via "os port list |grep xx:xx:xx:xx:xx:xx", and "grep" can not give all fields of a port.

We may import the "--mac-address" option.

Tags: network
Yan Xing'an (yanxingan)
Changed in python-openstackclient:
assignee: nobody → Yan Xing'an (yanxingan)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-openstackclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/387795

Changed in python-openstackclient:
status: New → In Progress
Richard Theis (rtheis)
tags: added: network
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-openstackclient (master)

Reviewed: https://review.openstack.org/387795
Committed: https://git.openstack.org/cgit/openstack/python-openstackclient/commit/?id=a1e305641430af48b72c941f87c7ffcc182b3f9a
Submitter: Jenkins
Branch: master

commit a1e305641430af48b72c941f87c7ffcc182b3f9a
Author: Yan Xing'an <email address hidden>
Date: Mon Oct 17 22:33:35 2016 -0700

    Add option to allow filtering by mac-address on port list

    Added support to allow filtering ports via --mac-address
    option to the port list command.

    Change-Id: I903e443f2f9057571d46520c4cafb88d1972c0cb
    Partial-bug: #1634333
    Partially-Implements: blueprint network-commands-options

Yan Xing'an (yanxingan)
Changed in python-openstackclient:
status: In Progress → Fix Committed
Yan Xing'an (yanxingan)
Changed in python-openstackclient:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.