Commit e3431cba authored by jithu.tagore's avatar jithu.tagore

Update infra_as_service_monitor.py

parent 775b1649
......@@ -176,7 +176,6 @@ def restart(service_name):
def docker_container():
docker_client = docker.from_env()
containers = docker_client.containers.list(all=True)
try:
if len(container_list)!=0:
print(container_list)
......@@ -187,7 +186,7 @@ def docker_container():
print(container)
except docker.errors.NotFound as exc:
print(f"Check container name!\n{exc.explanation}")
if container in containers:
else:
if container.attrs["State"]["Status"] =="restarting" or container.attrs["State"]["Status"] =="exited":
container_restart.append(container)
start=container.attrs["State"]["StartedAt"]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment