get discovery group from OS environment

This commit is contained in:
Difrex 2016-08-09 16:15:45 +03:00
parent 9120d723a2
commit 2e4758a3e8

View File

@ -8,12 +8,18 @@ def resolve(app, conf):
services = app['services']
domain = conf['domain']
group = None
if app['env'].get('SUROK_DISCOVERY_GROUP') is not None:
group = app['env']['SUROK_DISCOVERY_GROUP']
for service in services:
hosts[service['name']] = []
if app['env'].get('SUROK_GROUP') is not None:
group = app['env']['SUROK_GROUP']
if group is not None:
pass
else:
group = service['group']
try:
for rdata in dns.resolver.query('_' +
service['name'] + '.' +