try: set_vlan_attr(client, vlan, attr="fabric", value=fabric) # Move the vlan
return
except CallError as error: error_dict = yaml.safe_load(error.content)
if ( error_dict.get("__all__")[0]
== "A VLAN with the specified VID already exists in the destination fabric."
): [surprise_vlan] = [ maybe_vlan for maybe_vlan in fabric.vlans if maybe_vlan.vid == vlan.vid
] surprise_vlan.delete() continue # retries
Is the error string stable and considered part of the API? does this seem reasonable?
Here's our attempt at a workaround:
try:
set_ vlan_attr( client, vlan, attr="fabric", value=fabric) # Move the vlan
error_ dict = yaml.safe_ load(error. content)
error_ dict.get( "__all_ _")[0]
[surprise_ vlan] = [
maybe_ vlan
for maybe_vlan in fabric.vlans
if maybe_vlan.vid == vlan.vid
surprise_ vlan.delete( )
continue # retries
return
except CallError as error:
if (
== "A VLAN with the specified VID already exists in the destination fabric."
):
]
Is the error string stable and considered part of the API? does this seem reasonable?