@@ -127,11 +127,6 @@ def _get_attrs_network(client_manager, parsed_args):
127127 attrs ['qos_policy_id' ] = _qos_policy .id
128128 if 'no_qos_policy' in parsed_args and parsed_args .no_qos_policy :
129129 attrs ['qos_policy_id' ] = None
130- # Update VLAN Transparency for networks
131- if parsed_args .transparent_vlan :
132- attrs ['vlan_transparent' ] = True
133- if parsed_args .no_transparent_vlan :
134- attrs ['vlan_transparent' ] = False
135130 return attrs
136131
137132
@@ -170,16 +165,6 @@ def _add_additional_network_options(parser):
170165 help = _ ("VLAN ID for VLAN networks or Tunnel ID for "
171166 "GENEVE/GRE/VXLAN networks" ))
172167
173- vlan_transparent_grp = parser .add_mutually_exclusive_group ()
174- vlan_transparent_grp .add_argument (
175- '--transparent-vlan' ,
176- action = 'store_true' ,
177- help = _ ("Make the network VLAN transparent" ))
178- vlan_transparent_grp .add_argument (
179- '--no-transparent-vlan' ,
180- action = 'store_true' ,
181- help = _ ("Do not make the network VLAN transparent" ))
182-
183168
184169# TODO(sindhu): Use the SDK resource mapped attribute names once the
185170# OSC minimum requirements include SDK 1.0.
@@ -282,6 +267,16 @@ def update_parser_network(self, parser):
282267 metavar = '<qos-policy>' ,
283268 help = _ ("QoS policy to attach to this network (name or ID)" )
284269 )
270+ vlan_transparent_grp = parser .add_mutually_exclusive_group ()
271+ vlan_transparent_grp .add_argument (
272+ '--transparent-vlan' ,
273+ action = 'store_true' ,
274+ help = _ ("Make the network VLAN transparent" ))
275+ vlan_transparent_grp .add_argument (
276+ '--no-transparent-vlan' ,
277+ action = 'store_true' ,
278+ help = _ ("Do not make the network VLAN transparent" ))
279+
285280 _add_additional_network_options (parser )
286281 return parser
287282
@@ -296,6 +291,11 @@ def update_parser_compute(self, parser):
296291
297292 def take_action_network (self , client , parsed_args ):
298293 attrs = _get_attrs_network (self .app .client_manager , parsed_args )
294+ if parsed_args .transparent_vlan :
295+ attrs ['vlan_transparent' ] = True
296+ if parsed_args .no_transparent_vlan :
297+ attrs ['vlan_transparent' ] = False
298+
299299 obj = client .create_network (** attrs )
300300 display_columns , columns = _get_columns_network (obj )
301301 data = utils .get_item_properties (obj , columns , formatters = _formatters )
0 commit comments