Forráskód Böngészése

Fixes #6544: Fix migration error when upgrading with VRF(s) defined

jeremystretch 4 éve
szülő
commit
5e08b2be37

+ 8 - 0
docs/release-notes/version-2.11.md

@@ -1,5 +1,13 @@
 # NetBox v2.11
 # NetBox v2.11
 
 
+## v2.11.6 (FUTURE)
+
+### Bug Fixes
+
+* [#6544](https://github.com/netbox-community/netbox/issues/6544) - Fix migration error when upgrading with VRF(s) defined
+
+---
+
 ## v2.11.5 (2021-06-04)
 ## v2.11.5 (2021-06-04)
 
 
 **NOTE:** This release includes a database migration that calculates and annotates prefix depth. It may impose a noticeable delay on the upgrade process: Users should anticipate roughly one minute of delay per 100 thousand prefixes being updated.
 **NOTE:** This release includes a database migration that calculates and annotates prefix depth. It may impose a noticeable delay on the upgrade process: Users should anticipate roughly one minute of delay per 100 thousand prefixes being updated.

+ 1 - 1
netbox/ipam/management/commands/rebuild_prefixes.py

@@ -22,6 +22,6 @@ class Command(BaseCommand):
         for vrf in VRF.objects.all():
         for vrf in VRF.objects.all():
             vrf_count = Prefix.objects.filter(vrf=vrf).count()
             vrf_count = Prefix.objects.filter(vrf=vrf).count()
             self.stdout.write(f'VRF {vrf}: {vrf_count} prefixes...')
             self.stdout.write(f'VRF {vrf}: {vrf_count} prefixes...')
-            rebuild_prefixes(vrf)
+            rebuild_prefixes(vrf.pk)
 
 
         self.stdout.write(self.style.SUCCESS('Finished.'))
         self.stdout.write(self.style.SUCCESS('Finished.'))

+ 1 - 1
netbox/ipam/migrations/0048_prefix_populate_depth_children.py

@@ -20,7 +20,7 @@ def populate_prefix_hierarchy(apps, schema_editor):
 
 
     # Iterate through all VRFs, rebuilding each
     # Iterate through all VRFs, rebuilding each
     for vrf in VRF.objects.all():
     for vrf in VRF.objects.all():
-        rebuild_prefixes(vrf)
+        rebuild_prefixes(vrf.pk)
 
 
 
 
 class Migration(migrations.Migration):
 class Migration(migrations.Migration):

+ 1 - 1
netbox/netbox/settings.py

@@ -16,7 +16,7 @@ from django.core.validators import URLValidator
 # Environment setup
 # Environment setup
 #
 #
 
 
-VERSION = '2.11.5'
+VERSION = '2.11.6-dev'
 
 
 # Hostname
 # Hostname
 HOSTNAME = platform.node()
 HOSTNAME = platform.node()