From 1ce00d81cb7d9c25b3622ed8eb63c946e06fa9d5 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Mon, 31 Jul 2023 18:45:36 +0200 Subject: [PATCH] better tls zone calculation --- src/risotto/machine.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/risotto/machine.py b/src/risotto/machine.py index f463cb1..84fa5e7 100644 --- a/src/risotto/machine.py +++ b/src/risotto/machine.py @@ -332,10 +332,9 @@ class Loader: """) def add_tls(self): - zones = set() dns_module_name = None for host in self.servers_json['hosts'].values(): - zones = [self.servers_json['zones']['external_zone'], None] + zones = [self.servers_json['zones']['external_zone']] for server_name, datas in host['servers'].items(): if not 'applicationservice' in datas: raise Exception(f'cannot find applicationservice for "{server_name}"') @@ -346,13 +345,10 @@ class Loader: if dns_module_name: break zones[1] = datas['provider_zone'] - if None in zones: - zones = [] - else: - if zones[0] == zones[1]: - zones = [zones[0]] + if zones[0] == zones[1]: + zones = [zones[0]] host['servers']['tls'] = {'applicationservice': 'tls', - 'zones_name': list(zones), + 'zones_name': zones, } def load_dictionaries(self, cfg, module_info, server_name, rougail):