summaryrefslogtreecommitdiff
path: root/openstackclient/network
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-05-16 22:57:25 +0000
committerGerrit Code Review <review@openstack.org>2016-05-16 22:57:25 +0000
commit3d12ae8e0364a9cd745d10e260e4918e6658e1e7 (patch)
tree5bcf667a985a0ef10ea613bc455322270ce260ed /openstackclient/network
parentf0e64eb55abb3957073e82bd669c044bda1d8148 (diff)
parent00c149a28f72ee7236e836a7f128fce9ca5e1e09 (diff)
downloadpython-openstackclient-3d12ae8e0364a9cd745d10e260e4918e6658e1e7.tar.gz
Merge "Add VLAN Transparent option to ``osc network``"
Diffstat (limited to 'openstackclient/network')
-rw-r--r--openstackclient/network/v2/network.py24
1 files changed, 20 insertions, 4 deletions
diff --git a/openstackclient/network/v2/network.py b/openstackclient/network/v2/network.py
index 9fd7e28b..6730ce85 100644
--- a/openstackclient/network/v2/network.py
+++ b/openstackclient/network/v2/network.py
@@ -90,11 +90,17 @@ def _get_attrs(client_manager, parsed_args):
attrs['provider:physical_network'] = parsed_args.physical_network
if parsed_args.segmentation_id:
attrs['provider:segmentation_id'] = parsed_args.segmentation_id
+ # 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
-def _add_provider_network_options(parser):
- # Add provider network options
+def _add_additional_network_options(parser):
+ # Add additional network options
+
parser.add_argument(
'--provider-network-type',
metavar='<provider-network-type>',
@@ -116,6 +122,16 @@ def _add_provider_network_options(parser):
help=_("VLAN ID for VLAN networks or Tunnel ID for 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"))
+
def _get_attrs_compute(client_manager, parsed_args):
attrs = {}
@@ -206,7 +222,7 @@ class CreateNetwork(common.NetworkAndComputeShowOne):
help=_("Do not use the network as the default external network. "
"(default)")
)
- _add_provider_network_options(parser)
+ _add_additional_network_options(parser)
return parser
def update_parser_compute(self, parser):
@@ -410,7 +426,7 @@ class SetNetwork(command.Command):
action='store_true',
help=_("Do not use the network as the default external network")
)
- _add_provider_network_options(parser)
+ _add_additional_network_options(parser)
return parser
def take_action(self, parsed_args):