@@ -308,14 +308,15 @@ def create_route_domain(self, bigip, rd_id, name,
308308 name += '_aux_' + str (rd_id )
309309 payload = NetworkHelper .route_domain_defaults
310310 payload ['name' ] = name
311- payload ['partition' ] = '/' + partition
311+ payload ['partition' ] = partition
312312 payload ['id' ] = rd_id
313313
314314 if strictness :
315315 payload ['strict' ] = 'enabled'
316316 else :
317317 payload ['parent' ] = '/' + const .DEFAULT_PARTITION + '/0'
318- return rd .create (bigip , payload )
318+
319+ rd .create (bigip , payload )
319320
320321 @log_helpers .log_method_call
321322 def delete_route_domain (self , bigip , partition = const .DEFAULT_PARTITION ,
@@ -440,16 +441,24 @@ def create_vlan(self, bigip, model):
440441 if not name :
441442 return None
442443 v = Vlan ()
443- if v .exists (bigip , name = name , partition = partition ):
444- obj = v .load (bigip , name = name , partition = partition )
445- else :
446- payload = {'name' : name ,
447- 'partition' : partition ,
448- 'tag' : tag }
449444
450- if description :
451- payload ['description' ] = description
452- obj = v .create (bigip , payload )
445+ payload = {'name' : name ,
446+ 'partition' : partition ,
447+ 'tag' : tag }
448+
449+ if description :
450+ payload ['description' ] = description
451+
452+ vlan_exists = False
453+ try :
454+ obj = v .create (bigip , payload , ignore = [])
455+ except HTTPError as ex :
456+ if ex .response .status_code == 409 :
457+ vlan_exists = True
458+ else :
459+ raise
460+
461+ if not vlan_exists :
453462 interface = model .get ('interface' , None )
454463 if interface :
455464 payload = {'name' : interface }
@@ -469,7 +478,6 @@ def create_vlan(self, bigip, model):
469478 if not partition == const .DEFAULT_PARTITION :
470479 self .add_vlan_to_domain_by_id (bigip , name , partition ,
471480 route_domain_id )
472- return obj
473481
474482 @log_helpers .log_method_call
475483 def delete_vlan (
0 commit comments