Don't show hint about vlan transparent in network set

Update this attribute is not allowed in neutron.

Change-Id: I38010b26e116246c13dbb6cc6a777d2f22f6dc30
Closes-Bug: #1691776
This commit is contained in:
Hong Hui Xiao 2017-05-18 22:53:29 +08:00
parent 411cda722b
commit 2b66c71a7c
4 changed files with 22 additions and 27 deletions

View File

@ -318,7 +318,6 @@ Set network properties
[--provider-physical-network <provider-physical-network>] [--provider-physical-network <provider-physical-network>]
[--provider-segment <provider-segment>] [--provider-segment <provider-segment>]
[--qos-policy <qos-policy> | --no-qos-policy] [--qos-policy <qos-policy> | --no-qos-policy]
[--transparent-vlan | --no-transparent-vlan]
<network> <network>
.. option:: --name <name> .. option:: --name <name>
@ -393,14 +392,6 @@ Set network properties
Remove the QoS policy attached to this network 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: .. _network_set-network:
.. describe:: <network> .. describe:: <network>

View File

@ -127,11 +127,6 @@ def _get_attrs_network(client_manager, parsed_args):
attrs['qos_policy_id'] = _qos_policy.id attrs['qos_policy_id'] = _qos_policy.id
if 'no_qos_policy' in parsed_args and parsed_args.no_qos_policy: if 'no_qos_policy' in parsed_args and parsed_args.no_qos_policy:
attrs['qos_policy_id'] = None 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 return attrs
@ -170,16 +165,6 @@ def _add_additional_network_options(parser):
help=_("VLAN ID for VLAN networks or Tunnel ID for " help=_("VLAN ID for VLAN networks or Tunnel ID for "
"GENEVE/GRE/VXLAN networks")) "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 # TODO(sindhu): Use the SDK resource mapped attribute names once the
# OSC minimum requirements include SDK 1.0. # OSC minimum requirements include SDK 1.0.
@ -282,6 +267,16 @@ class CreateNetwork(common.NetworkAndComputeShowOne):
metavar='<qos-policy>', metavar='<qos-policy>',
help=_("QoS policy to attach to this network (name or ID)") 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) _add_additional_network_options(parser)
return parser return parser
@ -296,6 +291,11 @@ class CreateNetwork(common.NetworkAndComputeShowOne):
def take_action_network(self, client, parsed_args): def take_action_network(self, client, parsed_args):
attrs = _get_attrs_network(self.app.client_manager, 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) obj = client.create_network(**attrs)
display_columns, columns = _get_columns_network(obj) display_columns, columns = _get_columns_network(obj)
data = utils.get_item_properties(obj, columns, formatters=_formatters) data = utils.get_item_properties(obj, columns, formatters=_formatters)

View File

@ -821,7 +821,6 @@ class TestSetNetwork(TestNetwork):
'--provider-network-type', 'vlan', '--provider-network-type', 'vlan',
'--provider-physical-network', 'physnet1', '--provider-physical-network', 'physnet1',
'--provider-segment', '400', '--provider-segment', '400',
'--no-transparent-vlan',
'--enable-port-security', '--enable-port-security',
'--qos-policy', self.qos_policy.name, '--qos-policy', self.qos_policy.name,
] ]
@ -836,7 +835,6 @@ class TestSetNetwork(TestNetwork):
('provider_network_type', 'vlan'), ('provider_network_type', 'vlan'),
('physical_network', 'physnet1'), ('physical_network', 'physnet1'),
('segmentation_id', '400'), ('segmentation_id', '400'),
('no_transparent_vlan', True),
('enable_port_security', True), ('enable_port_security', True),
('qos_policy', self.qos_policy.name), ('qos_policy', self.qos_policy.name),
] ]
@ -854,7 +852,6 @@ class TestSetNetwork(TestNetwork):
'provider:network_type': 'vlan', 'provider:network_type': 'vlan',
'provider:physical_network': 'physnet1', 'provider:physical_network': 'physnet1',
'provider:segmentation_id': '400', 'provider:segmentation_id': '400',
'vlan_transparent': False,
'port_security_enabled': True, 'port_security_enabled': True,
'qos_policy_id': self.qos_policy.id, 'qos_policy_id': self.qos_policy.id,
} }

View File

@ -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>`_]