mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-16 04:02:52 -06:00
Suppress migration output during testing
This commit is contained in:
parent
1935f8b27f
commit
ca44cda112
@ -1,3 +1,4 @@
|
|||||||
|
import sys
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|
||||||
from ipam.utils import rebuild_prefixes
|
from ipam.utils import rebuild_prefixes
|
||||||
@ -22,7 +23,8 @@ def populate_prefix_hierarchy(apps, schema_editor):
|
|||||||
VRF = apps.get_model('ipam', 'VRF')
|
VRF = apps.get_model('ipam', 'VRF')
|
||||||
|
|
||||||
total_count = Prefix.objects.count()
|
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 the global table
|
||||||
rebuild_prefixes(None)
|
rebuild_prefixes(None)
|
||||||
|
Loading…
Reference in New Issue
Block a user