This commit is contained in:
brent s. 2020-05-18 06:31:05 -04:00
parent d1a9972786
commit 3d238dda22
Signed by: bts
GPG Key ID: 8C004C2F93481F6B
2 changed files with 8 additions and 3 deletions

View File

@ -36,7 +36,7 @@ ra-param = {{ assignment.iface }}, mtu:{{ common_opts.mtu }}, high, {{ common_op
dhcp-range = {{ id_set }}, {{ assignment.dhcp6_ranges[assign_loop.index0]|join(', ') }}, {{ ra_opts|join(', ') }}, {{ common_opts.lease_life }} dhcp-range = {{ id_set }}, {{ assignment.dhcp6_ranges[assign_loop.index0]|join(', ') }}, {{ ra_opts|join(', ') }}, {{ common_opts.lease_life }}
{%- endfor %} {%- endfor %}
{%- else %} {%- else %}
dhcp-range = {{ id_set }}, ::, constructor={{ assignment.iface }}, {{ ra_opts|join(', ') }}, {{ common_opts.lease_life }}{#- TODO: check this. #} dhcp-range = {{ id_set }}, [::], constructor={{ assignment.iface }}, {{ ra_opts|join(', ') }}, {{ common_opts.lease_life }}{#- TODO: check this. #}
{%- endif %} {%- endif %}
dhcp-option = {{ identifier }}, option6:information-refresh-time, {{ common_opts.opts_life }} dhcp-option = {{ identifier }}, option6:information-refresh-time, {{ common_opts.opts_life }}
{%- if assignment.ra_dns %} {%- if assignment.ra_dns %}

View File

@ -68,12 +68,17 @@ class Assignment(object):
self.ra_dns = ra_dns self.ra_dns = ra_dns
self.ra_tag = ra_tag self.ra_tag = ra_tag
self.ra_other = ra_other self.ra_other = ra_other
self.ra_dhcp = ra_dhcp
for a in ('dns', 'tag', 'other', 'dhcp'):
k = 'ra_{0}'.format(a)
v = getattr(self, k)
logger.debug('{0}: {1}'.format(k, v))
self.ra_domains = set() self.ra_domains = set()
if isinstance(ra_domains, list): if isinstance(ra_domains, list):
self.ra_domains.update(ra_domains) self.ra_domains.update(ra_domains)
elif isinstance(ra_domains, str): elif isinstance(ra_domains, str):
self.ra_domains.update([i.lower().strip() for i in ra_domains if i.strip() != '']) self.ra_domains.update([i.lower().strip() for i in ra_domains if i.strip() != ''])
self.ra_dhcp = ra_dhcp logger.debug('ra_domains: {0}'.format(', '.join(self.ra_domains)))
self.iface = None self.iface = None
self.iface_ll = None self.iface_ll = None
self.iface_idx = None self.iface_idx = None
@ -122,8 +127,8 @@ class Assignment(object):


def parse_alloc(self): def parse_alloc(self):
self.alloc_block = self.alloc.ip.alloc_block self.alloc_block = self.alloc.ip.alloc_block
# NOT AN IP6 OBJECT!
self.iface_blocks = self.alloc_block.extract_subnet(self.prefix, count = 1) self.iface_blocks = self.alloc_block.extract_subnet(self.prefix, count = 1)
logger.debug('Allocation blocks for {0}: {1}'.format(self.iface, ','.join(self.iface_blocks)))
for i in self.iface_blocks: for i in self.iface_blocks:
# DHCPv6 range. # DHCPv6 range.
_base = str(i.ip).rstrip(':') _base = str(i.ip).rstrip(':')