Filter docker events by type

This commit is contained in:
David Darias 2018-06-30 16:55:28 -04:00
parent 5d130b9303
commit ceb275ce2d
1 changed files with 4 additions and 1 deletions

View File

@ -39,7 +39,10 @@ def main():
#listen for events to keep the hosts file updated #listen for events to keep the hosts file updated
for e in events: for e in events:
status = e["status"]; if e["Type"]!="container":
continue
status = e["status"]
if status =="start": if status =="start":
container_id = e["id"] container_id = e["id"]
container = get_container_data(dockerClient, container_id) container = get_container_data(dockerClient, container_id)