summaryrefslogtreecommitdiff
path: root/openstackclient
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 /openstackclient
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
Diffstat (limited to 'openstackclient')
-rw-r--r--openstackclient/network/v2/network.py30
-rw-r--r--openstackclient/tests/unit/network/v2/test_network.py3
2 files changed, 15 insertions, 18 deletions
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,
}