summaryrefslogtreecommitdiff
path: root/openstackclient/network/v2/network.py
diff options
context:
space:
mode:
authorreedip <reedip.banerjee@nectechnologies.in>2016-04-19 13:46:15 +0900
committerReedip <reedip.banerjee@nectechnologies.in>2016-05-16 08:32:07 +0000
commit00c149a28f72ee7236e836a7f128fce9ca5e1e09 (patch)
tree800c172c48384f5b66b539ada281037a80de8b25 /openstackclient/network/v2/network.py
parent4639148b1dc059efab0d00a886e3f05f547a439f (diff)
downloadpython-openstackclient-00c149a28f72ee7236e836a7f128fce9ca5e1e09.tar.gz
Add VLAN Transparent option to ``osc network``
osc network set and network create now support --transparent-vlan|--no-transparent-vlan options to add/remove vlan transparency from the network. Change-Id: I845eb8f541cd32a4c4b28f929a63b205e7e31756 Closes-Bug: 1545537
Diffstat (limited to 'openstackclient/network/v2/network.py')
-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 4b77971a..dab20b74 100644
--- a/openstackclient/network/v2/network.py
+++ b/openstackclient/network/v2/network.py
@@ -93,11 +93,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>',
@@ -119,6 +125,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 = {}
@@ -209,7 +225,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):
@@ -413,7 +429,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):