summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHong Hui Xiao <honghui_xiao@yeah.net>2017-05-18 22:53:29 +0800
committerHong Hui Xiao <honghui_xiao@yeah.net>2017-06-12 19:20:30 +0800
commit2b66c71a7c2798dc1f9149574d54062b9086a01a (patch)
tree06a5615bda2005223b77fabe531f99b21d81ad5d
parent411cda722b082bc9274dd23f7e6b0c47e2cc9765 (diff)
downloadpython-openstackclient-2b66c71a7c2798dc1f9149574d54062b9086a01a.tar.gz
Don't show hint about vlan transparent in network set
Update this attribute is not allowed in neutron. Change-Id: I38010b26e116246c13dbb6cc6a777d2f22f6dc30 Closes-Bug: #1691776
-rw-r--r--doc/source/command-objects/network.rst9
-rw-r--r--openstackclient/network/v2/network.py30
-rw-r--r--openstackclient/tests/unit/network/v2/test_network.py3
-rw-r--r--releasenotes/notes/remove-unsupported-set-vlan-transparent-eeff412264ae7c09.yaml7
4 files changed, 22 insertions, 27 deletions
diff --git a/doc/source/command-objects/network.rst b/doc/source/command-objects/network.rst
index 636409b9..ed9fd13d 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-physical-network>]
[--provider-segment <provider-segment>]
[--qos-policy <qos-policy> | --no-qos-policy]
- [--transparent-vlan | --no-transparent-vlan]
<network>
.. option:: --name <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:: <network>
diff --git a/openstackclient/network/v2/network.py b/openstackclient/network/v2/network.py
index e4cf54bf..58ed6841 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='<qos-policy>',
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 1bd7bac6..4065e5ca 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 00000000..36c9cd1e
--- /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 <https://bugs.launchpad.net/python-openstackclient/+bug/1691776>`_]