fix add interface
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user