fix add interface

This commit is contained in:
IluaAir
2026-02-05 00:52:19 +03:00
parent 7d071004fa
commit ec5430a9d4

View File

@@ -52,7 +52,6 @@ class Vchassis_checker(Script):
interfaces_qs = Interface.objects.filter(
device_id__in=device_ids
).select_related("device")
to_update = []
for iface in interfaces_qs:
m = self.IFACE_RE.match(iface.name)
@@ -61,6 +60,7 @@ class Vchassis_checker(Script):
slot = m.group("slot")
rest = m.group("rest")
iface.name = f"{prefix}{iface.device.vc_position}/{rest}"
to_update.append(iface)
if commit:
Interface.objects.bulk_update(to_update, fields=["name"], batch_size=100)
vc.tags.add(tag)