From 2b66c71a7c2798dc1f9149574d54062b9086a01a Mon Sep 17 00:00:00 2001 From: Hong Hui Xiao Date: Thu, 18 May 2017 22:53:29 +0800 Subject: [PATCH] Don't show hint about vlan transparent in network set Update this attribute is not allowed in neutron. Change-Id: I38010b26e116246c13dbb6cc6a777d2f22f6dc30 Closes-Bug: #1691776 --- doc/source/command-objects/network.rst | 9 ------ openstackclient/network/v2/network.py | 30 +++++++++---------- .../tests/unit/network/v2/test_network.py | 3 -- ...set-vlan-transparent-eeff412264ae7c09.yaml | 7 +++++ 4 files changed, 22 insertions(+), 27 deletions(-) create mode 100644 releasenotes/notes/remove-unsupported-set-vlan-transparent-eeff412264ae7c09.yaml diff --git a/doc/source/command-objects/network.rst b/doc/source/command-objects/network.rst index 636409b90..ed9fd13d1 100644 --- a/doc/source/command-objects/network.rst +++ b/doc/source/command-objects/network.rst @@ -318,7 +318,6 @@ Set network properties [--provider-physical-network ] [--provider-segment ] [--qos-policy | --no-qos-policy] - [--transparent-vlan | --no-transparent-vlan] .. option:: --name @@ -393,14 +392,6 @@ Set network properties Remove the QoS policy attached to this network -.. option:: --transparent-vlan - - Make the network VLAN transparent - -.. option:: --no-transparent-vlan - - Do not make the network VLAN transparent - .. _network_set-network: .. describe:: diff --git a/openstackclient/network/v2/network.py b/openstackclient/network/v2/network.py index e4cf54bfb..58ed6841f 100644 --- a/openstackclient/network/v2/network.py +++ b/openstackclient/network/v2/network.py @@ -127,11 +127,6 @@ def _get_attrs_network(client_manager, parsed_args): attrs['qos_policy_id'] = _qos_policy.id if 'no_qos_policy' in parsed_args and parsed_args.no_qos_policy: attrs['qos_policy_id'] = None - # Update VLAN Transparency for networks - if parsed_args.transparent_vlan: - attrs['vlan_transparent'] = True - if parsed_args.no_transparent_vlan: - attrs['vlan_transparent'] = False return attrs @@ -170,16 +165,6 @@ def _add_additional_network_options(parser): help=_("VLAN ID for VLAN networks or Tunnel ID for " "GENEVE/GRE/VXLAN networks")) - vlan_transparent_grp = parser.add_mutually_exclusive_group() - vlan_transparent_grp.add_argument( - '--transparent-vlan', - action='store_true', - help=_("Make the network VLAN transparent")) - vlan_transparent_grp.add_argument( - '--no-transparent-vlan', - action='store_true', - help=_("Do not make the network VLAN transparent")) - # TODO(sindhu): Use the SDK resource mapped attribute names once the # OSC minimum requirements include SDK 1.0. @@ -282,6 +267,16 @@ class CreateNetwork(common.NetworkAndComputeShowOne): metavar='', help=_("QoS policy to attach to this network (name or ID)") ) + vlan_transparent_grp = parser.add_mutually_exclusive_group() + vlan_transparent_grp.add_argument( + '--transparent-vlan', + action='store_true', + help=_("Make the network VLAN transparent")) + vlan_transparent_grp.add_argument( + '--no-transparent-vlan', + action='store_true', + help=_("Do not make the network VLAN transparent")) + _add_additional_network_options(parser) return parser @@ -296,6 +291,11 @@ class CreateNetwork(common.NetworkAndComputeShowOne): def take_action_network(self, client, parsed_args): attrs = _get_attrs_network(self.app.client_manager, parsed_args) + if parsed_args.transparent_vlan: + attrs['vlan_transparent'] = True + if parsed_args.no_transparent_vlan: + attrs['vlan_transparent'] = False + obj = client.create_network(**attrs) display_columns, columns = _get_columns_network(obj) data = utils.get_item_properties(obj, columns, formatters=_formatters) diff --git a/openstackclient/tests/unit/network/v2/test_network.py b/openstackclient/tests/unit/network/v2/test_network.py index 1bd7bac61..4065e5ca4 100644 --- a/openstackclient/tests/unit/network/v2/test_network.py +++ b/openstackclient/tests/unit/network/v2/test_network.py @@ -821,7 +821,6 @@ class TestSetNetwork(TestNetwork): '--provider-network-type', 'vlan', '--provider-physical-network', 'physnet1', '--provider-segment', '400', - '--no-transparent-vlan', '--enable-port-security', '--qos-policy', self.qos_policy.name, ] @@ -836,7 +835,6 @@ class TestSetNetwork(TestNetwork): ('provider_network_type', 'vlan'), ('physical_network', 'physnet1'), ('segmentation_id', '400'), - ('no_transparent_vlan', True), ('enable_port_security', True), ('qos_policy', self.qos_policy.name), ] @@ -854,7 +852,6 @@ class TestSetNetwork(TestNetwork): 'provider:network_type': 'vlan', 'provider:physical_network': 'physnet1', 'provider:segmentation_id': '400', - 'vlan_transparent': False, 'port_security_enabled': True, 'qos_policy_id': self.qos_policy.id, } diff --git a/releasenotes/notes/remove-unsupported-set-vlan-transparent-eeff412264ae7c09.yaml b/releasenotes/notes/remove-unsupported-set-vlan-transparent-eeff412264ae7c09.yaml new file mode 100644 index 000000000..36c9cd1ed --- /dev/null +++ b/releasenotes/notes/remove-unsupported-set-vlan-transparent-eeff412264ae7c09.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + Remove ``--transparent-vlan`` and ``--no-transparent-vlan`` + from ``network set``, because updating ``vlan-transparent`` + is not supported in Neutron. + [Bug `1691776 `_]