diff --git a/surok/discovery.py b/surok/discovery.py index 6c1a6ad..310900c 100644 --- a/surok/discovery.py +++ b/surok/discovery.py @@ -28,21 +28,22 @@ def resolve(app, conf): group = service['group'] # Port name from app config - port_name = None + ports = None try: - port_name = service['port_name'] + ports = service['ports'] except: pass # This is fast fix for port naming # Will be rewrite later fqdn = '' - if port_name is not None: - fqdn = '_' + port_name + '.' + '_' + service['name'] + '.' + group + '._tcp.' + domain + 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']) else: fqdn = '_' + service['name'] + '.' + group + '._tcp.' + domain - - hosts[service['name']] = do_query(fqdn, conf['loglevel']) + hosts[service['name']] = do_query(fqdn, conf['loglevel']) return hosts