From b390210173cb14cf8cd31f1d92e18979d9b49c3a Mon Sep 17 00:00:00 2001 From: Difrex Date: Wed, 17 Aug 2016 17:16:43 +0300 Subject: [PATCH] Fix ports discovery --- surok/discovery.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/surok/discovery.py b/surok/discovery.py index 310900c..5e5ad05 100644 --- a/surok/discovery.py +++ b/surok/discovery.py @@ -17,7 +17,7 @@ def resolve(app, conf): group = app['env']['SUROK_DISCOVERY_GROUP'] for service in services: - hosts[service['name']] = [] + hosts[service['name']] = {} # Check group configuration if group is not None: @@ -40,7 +40,7 @@ def resolve(app, conf): if ports is not None: for port_name in ports: fqdn = '_' + port_name + '.' + '_' + service['name'] + '.' + group + '._tcp.' + domain - hosts[service['name']]['ports'][port_name] = do_query(fqdn, conf['loglevel']) + hosts[service['name']][port_name] = do_query(fqdn, conf['loglevel']) else: fqdn = '_' + service['name'] + '.' + group + '._tcp.' + domain hosts[service['name']] = do_query(fqdn, conf['loglevel'])