From 7dd32288c651cc53a8b74e78d757790a8787de16 Mon Sep 17 00:00:00 2001 From: Jonathan Petersson Date: Mon, 16 Sep 2019 20:08:18 +0200 Subject: [PATCH] Added new role BGP P2P for IPaddresses --- netbox/ipam/constants.py | 4 ++++ ...ique_squashed_0018_remove_service_uniqueness_constraint.py | 2 +- netbox/ipam/migrations/0017_ipaddress_roles.py | 2 +- ...19_virtualization_squashed_0020_ipaddress_add_role_carp.py | 2 +- netbox/ipam/migrations/0020_ipaddress_add_role_carp.py | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/netbox/ipam/constants.py b/netbox/ipam/constants.py index eeb17eddd..e15c4bf78 100644 --- a/netbox/ipam/constants.py +++ b/netbox/ipam/constants.py @@ -38,6 +38,7 @@ IPADDRESS_ROLE_VRRP = 41 IPADDRESS_ROLE_HSRP = 42 IPADDRESS_ROLE_GLBP = 43 IPADDRESS_ROLE_CARP = 44 +IPADDRESS_ROLE_BGPP2P = 50 IPADDRESS_ROLE_CHOICES = ( (IPADDRESS_ROLE_LOOPBACK, 'Loopback'), (IPADDRESS_ROLE_SECONDARY, 'Secondary'), @@ -47,6 +48,7 @@ IPADDRESS_ROLE_CHOICES = ( (IPADDRESS_ROLE_HSRP, 'HSRP'), (IPADDRESS_ROLE_GLBP, 'GLBP'), (IPADDRESS_ROLE_CARP, 'CARP'), + (IPADDRESS_ROLE_BGPP2P, 'BGP P2P'), ) IPADDRESS_ROLES_NONUNIQUE = ( @@ -57,6 +59,7 @@ IPADDRESS_ROLES_NONUNIQUE = ( IPADDRESS_ROLE_HSRP, IPADDRESS_ROLE_GLBP, IPADDRESS_ROLE_CARP, + IPADDRESS_ROLE_BGPP2P, ) # VLAN statuses @@ -87,6 +90,7 @@ ROLE_CHOICE_CLASSES = { 42: 'success', 43: 'success', 44: 'success', + 50: 'success', } # IP protocols (for services) diff --git a/netbox/ipam/migrations/0002_vrf_add_enforce_unique_squashed_0018_remove_service_uniqueness_constraint.py b/netbox/ipam/migrations/0002_vrf_add_enforce_unique_squashed_0018_remove_service_uniqueness_constraint.py index 61d38a69b..40fa0a0ce 100644 --- a/netbox/ipam/migrations/0002_vrf_add_enforce_unique_squashed_0018_remove_service_uniqueness_constraint.py +++ b/netbox/ipam/migrations/0002_vrf_add_enforce_unique_squashed_0018_remove_service_uniqueness_constraint.py @@ -229,7 +229,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='ipaddress', name='role', - field=models.PositiveSmallIntegerField(blank=True, choices=[(10, 'Loopback'), (20, 'Secondary'), (30, 'Anycast'), (40, 'VIP'), (41, 'VRRP'), (42, 'HSRP'), (43, 'GLBP')], help_text='The functional role of this IP', null=True, verbose_name='Role'), + field=models.PositiveSmallIntegerField(blank=True, choices=[(10, 'Loopback'), (20, 'Secondary'), (30, 'Anycast'), (40, 'VIP'), (41, 'VRRP'), (42, 'HSRP'), (43, 'GLBP'), (50, 'BGP P2P')], help_text='The functional role of this IP', null=True, verbose_name='Role'), ), migrations.AlterUniqueTogether( name='service', diff --git a/netbox/ipam/migrations/0017_ipaddress_roles.py b/netbox/ipam/migrations/0017_ipaddress_roles.py index 11bf37294..81e09fb58 100644 --- a/netbox/ipam/migrations/0017_ipaddress_roles.py +++ b/netbox/ipam/migrations/0017_ipaddress_roles.py @@ -13,7 +13,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='ipaddress', name='role', - field=models.PositiveSmallIntegerField(blank=True, choices=[(10, 'Loopback'), (20, 'Secondary'), (30, 'Anycast'), (40, 'VIP'), (41, 'VRRP'), (42, 'HSRP'), (43, 'GLBP')], help_text='The functional role of this IP', null=True, verbose_name='Role'), + field=models.PositiveSmallIntegerField(blank=True, choices=[(10, 'Loopback'), (20, 'Secondary'), (30, 'Anycast'), (40, 'VIP'), (41, 'VRRP'), (42, 'HSRP'), (43, 'GLBP'), (50, 'BGP P2P')], help_text='The functional role of this IP', null=True, verbose_name='Role'), ), migrations.AlterField( model_name='ipaddress', diff --git a/netbox/ipam/migrations/0019_virtualization_squashed_0020_ipaddress_add_role_carp.py b/netbox/ipam/migrations/0019_virtualization_squashed_0020_ipaddress_add_role_carp.py index e271685a0..773417d4c 100644 --- a/netbox/ipam/migrations/0019_virtualization_squashed_0020_ipaddress_add_role_carp.py +++ b/netbox/ipam/migrations/0019_virtualization_squashed_0020_ipaddress_add_role_carp.py @@ -31,6 +31,6 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='ipaddress', name='role', - field=models.PositiveSmallIntegerField(blank=True, choices=[(10, 'Loopback'), (20, 'Secondary'), (30, 'Anycast'), (40, 'VIP'), (41, 'VRRP'), (42, 'HSRP'), (43, 'GLBP'), (44, 'CARP')], help_text='The functional role of this IP', null=True, verbose_name='Role'), + field=models.PositiveSmallIntegerField(blank=True, choices=[(10, 'Loopback'), (20, 'Secondary'), (30, 'Anycast'), (40, 'VIP'), (41, 'VRRP'), (42, 'HSRP'), (43, 'GLBP'), (44, 'CARP'), (50, 'BGP P2P')], help_text='The functional role of this IP', null=True, verbose_name='Role'), ), ] diff --git a/netbox/ipam/migrations/0020_ipaddress_add_role_carp.py b/netbox/ipam/migrations/0020_ipaddress_add_role_carp.py index e15c12a32..54589b031 100644 --- a/netbox/ipam/migrations/0020_ipaddress_add_role_carp.py +++ b/netbox/ipam/migrations/0020_ipaddress_add_role_carp.py @@ -13,6 +13,6 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='ipaddress', name='role', - field=models.PositiveSmallIntegerField(blank=True, choices=[(10, 'Loopback'), (20, 'Secondary'), (30, 'Anycast'), (40, 'VIP'), (41, 'VRRP'), (42, 'HSRP'), (43, 'GLBP'), (44, 'CARP')], help_text='The functional role of this IP', null=True, verbose_name='Role'), + field=models.PositiveSmallIntegerField(blank=True, choices=[(10, 'Loopback'), (20, 'Secondary'), (30, 'Anycast'), (40, 'VIP'), (41, 'VRRP'), (42, 'HSRP'), (43, 'GLBP'), (44, 'CARP'), (50, 'BGP P2P')], help_text='The functional role of this IP', null=True, verbose_name='Role'), ), ]