add support for ints as record name

This commit is contained in:
nd 2019-06-01 18:14:17 +02:00
parent fcee6b0f36
commit 144736d652
No known key found for this signature in database
GPG key ID: 21B5CD4DEE3670E9

View file

@ -15,9 +15,9 @@ $TTL 60
{% endfor %} {% endfor %}
{% for k, v in records.items() %} {% for k, v in records.items() %}
{% if v is mapping %} {% if v is mapping %}
{% if not k.endswith('.') %} {% if not (k|string).endswith('.') %}
{{ generate_records(v, k + ('.' + scope if scope != '@' else '')) }} {{ generate_records(v, (k|string) + ('.' + scope if scope != '@' else '')) }}
{%- elif k.endswith('.' + item + '.') or k == (item + '.') %} {%- elif (k|string).endswith('.' + item + '.') or (k|string) == (item + '.') %}
{{ generate_records(v, k) }} {{ generate_records(v, k) }}
{%- endif %} {%- endif %}
{%- endif %} {%- endif %}