diff options
Diffstat (limited to 'openstackclient/network')
| -rw-r--r-- | openstackclient/network/v2/port.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/openstackclient/network/v2/port.py b/openstackclient/network/v2/port.py index 86174d53..8916fd73 100644 --- a/openstackclient/network/v2/port.py +++ b/openstackclient/network/v2/port.py @@ -385,6 +385,11 @@ class ListPort(command.Lister): help=_("List only ports attached to this server (name or ID)"), ) parser.add_argument( + '--mac-address', + metavar='<mac-address>', + help=_("List only ports with this MAC address") + ) + parser.add_argument( '--long', action='store_true', default=False, @@ -429,6 +434,8 @@ class ListPort(command.Lister): network = network_client.find_network(parsed_args.network, ignore_missing=False) filters['network_id'] = network.id + if parsed_args.mac_address: + filters['mac_address'] = parsed_args.mac_address data = network_client.ports(**filters) |
