summaryrefslogtreecommitdiff
path: root/openstackclient/network
diff options
context:
space:
mode:
authorCarlos Goncalves <carlos.goncalves@neclab.eu>2017-01-18 11:16:39 +0000
committerSteve Martinelli <s.martinelli@gmail.com>2017-07-12 22:50:09 +0000
commit1ae904a4912494b3d0ac87f22aaf958129744548 (patch)
treeb88a0193104c5726e2272a99ca3ae3c621e8fa84 /openstackclient/network
parent3cba09e767c6af3f715828966f0d0fa21edc00a8 (diff)
downloadpython-openstackclient-1ae904a4912494b3d0ac87f22aaf958129744548.tar.gz
Add 'data_plane_status' option to Port classes
Adds 'data_plane_status' option to SetPort and UnsetPort classes. Closes-Bug: #1684989 Change-Id: I26e23b551afb8c37e6babdea1655efb7c5c6873b
Diffstat (limited to 'openstackclient/network')
-rw-r--r--openstackclient/network/v2/port.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/openstackclient/network/v2/port.py b/openstackclient/network/v2/port.py
index 42291bf2..1409a194 100644
--- a/openstackclient/network/v2/port.py
+++ b/openstackclient/network/v2/port.py
@@ -685,6 +685,15 @@ class SetPort(command.Command):
"(Specify both --allowed-address and --no-allowed-address"
"to overwrite the current allowed-address pairs)")
)
+ parser.add_argument(
+ '--data-plane-status',
+ metavar='<status>',
+ choices=['ACTIVE', 'DOWN'],
+ help=_("Set data plane status of this port (ACTIVE | DOWN). "
+ "Unset it to None with the 'port unset' command "
+ "(requires data plane status extension)")
+ )
+
return parser
def take_action(self, parsed_args):
@@ -737,6 +746,8 @@ class SetPort(command.Command):
attrs['allowed_address_pairs'].extend(
_convert_address_pairs(parsed_args)
)
+ if parsed_args.data_plane_status:
+ attrs['data_plane_status'] = parsed_args.data_plane_status
client.update_port(obj, **attrs)
@@ -816,6 +827,11 @@ class UnsetPort(command.Command):
default=False,
help=_("Remove the QoS policy attached to the port")
)
+ parser.add_argument(
+ '--data-plane-status',
+ action='store_true',
+ help=_("Clear existing information of data plane status")
+ )
return parser
@@ -867,6 +883,8 @@ class UnsetPort(command.Command):
attrs['allowed_address_pairs'] = tmp_addr_pairs
if parsed_args.qos_policy:
attrs['qos_policy_id'] = None
+ if parsed_args.data_plane_status:
+ attrs['data_plane_status'] = None
if attrs:
client.update_port(obj, **attrs)