From ce7ced64e2e41b8344137b07f6c2e7aa253143bb Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Mon, 9 Jul 2018 00:31:05 +0200 Subject: [PATCH] Renvoie la taille du prefix notation cidr --- machines/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/machines/models.py b/machines/models.py index b33693d9..d790e0a8 100644 --- a/machines/models.py +++ b/machines/models.py @@ -386,6 +386,7 @@ class IpType(RevMixin, AclMixin, models.Model): { 'network': str(ip_set.network), 'netmask': str(ip_set.netmask), + 'netmask_cidr': str(ip_set.prefixlen), 'broadcast': str(ip_set.broadcast), 'vlan': str(self.vlan), 'vlan_id': self.vlan.vlan_id @@ -398,6 +399,7 @@ class IpType(RevMixin, AclMixin, models.Model): return { 'network' : str(self.prefix_v6), 'netmask' : 'ffff:ffff:ffff:ffff::', + 'netmask_cidr' : '64', 'vlan': str(self.vlan), 'vlan_id': str(self.vlan.vlan_id) }