Comment 11 for bug 1853047

Revision history for this message
Jason Hobbs (jason-hobbs) wrote :

Here's our attempt at a workaround:

        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?