mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-21 12:52:21 -06:00
IPAddress.role to slug (#3569)
This commit is contained in:
@@ -51,3 +51,37 @@ class IPAddressStatusChoices(ChoiceSet):
|
||||
STATUS_DEPRECATED: 3,
|
||||
STATUS_DHCP: 5,
|
||||
}
|
||||
|
||||
|
||||
class IPAddressRoleChoices(ChoiceSet):
|
||||
|
||||
ROLE_LOOPBACK = 'loopback'
|
||||
ROLE_SECONDARY = 'secondary'
|
||||
ROLE_ANYCAST = 'anycast'
|
||||
ROLE_VIP = 'vip'
|
||||
ROLE_VRRP = 'vrrp'
|
||||
ROLE_HSRP = 'hsrp'
|
||||
ROLE_GLBP = 'glbp'
|
||||
ROLE_CARP = 'carp'
|
||||
|
||||
CHOICES = (
|
||||
(ROLE_LOOPBACK, 'Loopback'),
|
||||
(ROLE_SECONDARY, 'Secondary'),
|
||||
(ROLE_ANYCAST, 'Anycast'),
|
||||
(ROLE_VIP, 'VIP'),
|
||||
(ROLE_VRRP, 'VRRP'),
|
||||
(ROLE_HSRP, 'HSRP'),
|
||||
(ROLE_GLBP, 'GLBP'),
|
||||
(ROLE_CARP, 'CARP'),
|
||||
)
|
||||
|
||||
LEGACY_MAP = {
|
||||
ROLE_LOOPBACK: 10,
|
||||
ROLE_SECONDARY: 20,
|
||||
ROLE_ANYCAST: 30,
|
||||
ROLE_VIP: 40,
|
||||
ROLE_VRRP: 41,
|
||||
ROLE_HSRP: 42,
|
||||
ROLE_GLBP: 43,
|
||||
ROLE_CARP: 44,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user