add logging

This commit is contained in:
Joachim Lusiardi 2020-06-02 19:07:23 +02:00
parent 1f8ccbabb0
commit ae3a6b04fd

View File

@ -222,10 +222,13 @@ if __name__ == '__main__':
for line in client.events(): for line in client.events():
line_str = line.decode("utf-8") line_str = line.decode("utf-8")
event = json.loads(line_str) event = json.loads(line_str)
logging.info('Event: %s', json.dumps(event))
if event['Action'] in ['create']: if event['Action'] in ['create']:
# check if there is any domain name configured # check if there is any domain name configured
container_id = event['id'] container_id = event['id']
logging.info('Create container id: %s', container_id)
if len(list_domains.handle_container(client, container_id)) > 0: if len(list_domains.handle_container(client, container_id)) > 0:
resolved_domains = list_domains.get_resolving_domains_from_containers(client) resolved_domains = list_domains.get_resolving_domains_from_containers(client)
resolved_domains = sorted(resolved_domains) resolved_domains = sorted(resolved_domains)