Feature network gui improvements
- closes #358 (closed) Automatically select a free ipv4 address based on vlan (host creation)
- closes #357 (closed) Automatically generate ipv6 address from ipv4 (host creation/edit)
- closes #354 (closed) MAC address autocomplete
- closes #360 (closed) Add sensible default and help_text to Vlan.ipv6_template
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
-
396 super(Vlan, self).clean() 397 if self.ipv6_template: 398 if not self.network6: 399 raise ValidationError( 400 _("You cannot specify an IPv6 template if there is no " 401 "IPv6 network set.")) 402 for i in (self.network4[1], self.network4[-1]): 403 i6 = self.convert_ipv4_to_ipv6(i) 404 if i6 not in self.network6: 405 raise ValidationError( 406 _("%(ip6)s (translated from %(ip4)s) is outside of " 407 "the IPv6 network.") % {"ip4": i, "ip6": i6}) 408 if not self.ipv6_template and self.network6: 409 # come up with some sensible default 410 self.ipv6_template = self._magic_ipv6_template() 411 host4_bytes = int(ceil((32 - self.network4.prefixlen) / 8)) -
Owner
32.0
-
-
365 366 ipv6_template = models.TextField( 366 validators=[val_ipv6_template], 367 verbose_name=_('ipv6 template'), 368 default="2001:738:2001:4031:%(b)d:%(c)d:%(d)d:0") 367 blank=True, 368 help_text=_('Template for translating IPv4 addresses to IPv6. ' 369 'Automatically generated hosts in dual-stack networks ' 370 'will get this address. The template ' 371 'can contain four tokens: "%(a)d", "%(b)d", ' 372 '"%(c)d", and "%(d)d", representing the four bytes ' 373 'of the IPv4 address, respectively, in decimal notation. ' 374 'Moreover you can use any standard printf format ' 375 'specification like %(a)02x to get the first byte as two ' 376 'hexadecimal digits. Usual choices for mapping ' 377 '198.51.100.0/24 to 2001:0DB8:1:1::/64 would be ' 378 '"2001:0DB8:51:1:1:%(d)d::" and ' -
Owner
"2001:0DB8:1:1:%(d)d::" -
Owner
>>> Vlan._magic_ipv6_template(IPNetwork("198.51.100.0/24"), ... IPNetwork("2001:0DB8:1:1::/64")) '2001:db8:1:1:%(d)d::' >>> Vlan._magic_ipv6_template(IPNetwork("198.51.100.0/24"), ... IPNetwork("2001:0DB8:1:1::/64"), 0) '2001:db8:1:1:%(d)02x00::'
-
-
Added 6 new commits:
Toggle commit list -
-
-
-
-
851 959 else: 852 960 raise WorkerNotFound() 853 961 962 @method_cache(20) 963 def get_dhcp_clients(self): 964 try: 965 return get_dhcp_clients.apply_async( 966 queue=self.get_remote_queue_name(), expires=60).get(timeout=2) 967 except TimeoutError: -
Owner
Handle other Exceptions669402
-
-
Owner
👍 -
-