diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-12-02 05:28:21 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-12-02 05:28:21 +0000 |
| commit | 9b19a35bb7a55eb9b280c03ca3c20c2eb875c284 (patch) | |
| tree | 9a4ce74ecf00f75155919771ac8ed6a74d23f732 /openstackclient/network | |
| parent | 3a509be871ec104e46f4a2c11503bdfee0e863b4 (diff) | |
| parent | 246f60ab13b57df0cdff2190ebaca316a946f3e7 (diff) | |
| download | python-openstackclient-9b19a35bb7a55eb9b280c03ca3c20c2eb875c284.tar.gz | |
Merge "Add `--enable/disable-port-security` option to `port set` and `port create`"
Diffstat (limited to 'openstackclient/network')
| -rw-r--r-- | openstackclient/network/v2/port.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/openstackclient/network/v2/port.py b/openstackclient/network/v2/port.py index 64b30c7c..6cae87ee 100644 --- a/openstackclient/network/v2/port.py +++ b/openstackclient/network/v2/port.py @@ -148,6 +148,12 @@ def _get_attrs(client_manager, parsed_args): ).id attrs['tenant_id'] = project_id + if parsed_args.disable_port_security: + attrs['port_security_enabled'] = False + + if parsed_args.enable_port_security: + attrs['port_security_enabled'] = True + return attrs @@ -304,6 +310,17 @@ class CreatePort(command.ShowOne): action='store_true', help=_("Associate no security groups with this port") ) + port_security = parser.add_mutually_exclusive_group() + port_security.add_argument( + '--enable-port-security', + action='store_true', + help=_("Enable port security for this port (Default)") + ) + port_security.add_argument( + '--disable-port-security', + action='store_true', + help=_("Disable port security for this port") + ) return parser @@ -526,6 +543,17 @@ class SetPort(command.Command): action='store_true', help=_("Clear existing security groups associated with this port") ) + port_security = parser.add_mutually_exclusive_group() + port_security.add_argument( + '--enable-port-security', + action='store_true', + help=_("Enable port security for this port") + ) + port_security.add_argument( + '--disable-port-security', + action='store_true', + help=_("Disable port security for this port") + ) return parser |
