From 50b518bc8b729257abddb9217d7dd7200fd070b1 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Mon, 17 Dec 2018 18:08:20 +0100 Subject: [PATCH] Add capability for subfolders Signed-off-by: Knut Ahlers --- consul.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/consul.py b/consul.py index ff40fb7..15d0a5c 100644 --- a/consul.py +++ b/consul.py @@ -64,8 +64,8 @@ def parse_raw_consul(zone): # Key consists of at least 2 elements: dns/ahlers.me/subdomain OR dns/ahlers.me key = raw_entry['Key'].split('/')[2:] name = '' - if len(key) > 0 and key[0] != '@': - name = key[0] + if key not in [[], ['@']]: + name = '.'.join(reversed(key)) for entry in sub_entries: entry['name'] = name