From ca44cda112eb1f1d6ac324b1b43a762b86847e47 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Wed, 2 Jun 2021 16:02:38 -0400 Subject: [PATCH] Suppress migration output during testing --- netbox/ipam/migrations/0048_prefix_populate_depth_children.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/netbox/ipam/migrations/0048_prefix_populate_depth_children.py b/netbox/ipam/migrations/0048_prefix_populate_depth_children.py index dc5070656..b1c2136b8 100644 --- a/netbox/ipam/migrations/0048_prefix_populate_depth_children.py +++ b/netbox/ipam/migrations/0048_prefix_populate_depth_children.py @@ -1,3 +1,4 @@ +import sys from django.db import migrations from ipam.utils import rebuild_prefixes @@ -22,7 +23,8 @@ def populate_prefix_hierarchy(apps, schema_editor): VRF = apps.get_model('ipam', 'VRF') total_count = Prefix.objects.count() - print(f'\nUpdating {total_count} prefixes...') + if 'test' not in sys.argv: + print(f'\nUpdating {total_count} prefixes...') # Rebuild the global table rebuild_prefixes(None)