Commit 5bbc2966 authored by jithu.tagore's avatar jithu.tagore

Update infra_as_service_monitor.py

parent cfd8b20a
......@@ -179,7 +179,10 @@ def docker_container():
if len(container_list)!=0:
for each in container_list:
print(each)
container = docker_client.containers.get(each)
try:
container = docker_client.containers.get(each)
except docker.errors.NotFound as exc:
print(f"Check container name!\n{exc.explanation}")
print(container)
if container in containers:
print("1")
......@@ -236,7 +239,7 @@ def docker_container():
timing=str(int(time))+"minute"
data.append([each.name, each.id, each.attrs["State"]["Status"],timing])
except Exception as e:
logger.error("Error connecting to kairos")
logger.info(e)
......
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