From 78bb2e12fe33522b788f9624826bb6fd9858887e Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Thu, 23 Jul 2020 14:03:19 -0400 Subject: [PATCH] Clean up migration output --- netbox/virtualization/migrations/0016_replicate_interfaces.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/netbox/virtualization/migrations/0016_replicate_interfaces.py b/netbox/virtualization/migrations/0016_replicate_interfaces.py index a8960b101..455a82869 100644 --- a/netbox/virtualization/migrations/0016_replicate_interfaces.py +++ b/netbox/virtualization/migrations/0016_replicate_interfaces.py @@ -18,7 +18,7 @@ def replicate_interfaces(apps, schema_editor): # Replicate dcim.Interface instances assigned to VirtualMachines original_interfaces = Interface.objects.filter(virtual_machine__isnull=False) if show_output: - print(f"\n Replicating {len(original_interfaces)} VM interfaces...", flush=True) + print(f"\n Replicating {len(original_interfaces)} VM interfaces...", end='', flush=True) for i, interface in enumerate(original_interfaces, start=1): vminterface = VMInterface( virtual_machine=interface.virtual_machine, @@ -56,8 +56,6 @@ def replicate_interfaces(apps, schema_editor): # Verify that all interfaces have been replicated replicated_count = VMInterface.objects.count() assert replicated_count == original_interfaces.count(), "Replicated interfaces count does not match original count!" - if show_output: - print(f"\n Replicated {replicated_count} interfaces ", end='', flush=True) # Delete all interfaces not assigned to a Device Interface.objects.filter(device__isnull=True).delete()