- new_xvu = row.external_ids.get("xs-vif-uuid", "")
- old_xvu = interfaces.get(row.name)
- if old_xvu != new_xvu:
- iface_id = get_iface_id(row.name, new_xvu)
- if iface_id and row.external_ids.get("iface-id") != iface_id:
- set_external_id(row, "iface-id", iface_id)
+ xvu = row.external_ids.get("xs-vif-uuid")
+ if xvu:
+ iface_id = (new_iface_ids.get(xvu)
+ or iface_ids.get(xvu)
+ or get_iface_id(row.name, xvu))
+ new_iface_ids[xvu] = iface_id
+ else:
+ # No xs-vif-uuid therefore no iface-id.
+ iface_id = None
+ set_external_id(row, "iface-id", iface_id)