bundles/docker-engine: turns out, filtering by name means getting everything where the name contains the filter ...
This commit is contained in:
parent
79680e2119
commit
45c52c62ca
1 changed files with 7 additions and 1 deletions
|
@ -18,7 +18,13 @@ try:
|
||||||
f'name={container_name}'
|
f'name={container_name}'
|
||||||
])
|
])
|
||||||
|
|
||||||
containers = loads(f"[{','.join([l for l in docker_ps.decode().splitlines() if l])}]")
|
docker_json = loads(f"[{','.join([l for l in docker_ps.decode().splitlines() if l])}]")
|
||||||
|
|
||||||
|
containers = [
|
||||||
|
container
|
||||||
|
for container in docker_json
|
||||||
|
if container['Names'] == container_name
|
||||||
|
]
|
||||||
|
|
||||||
if not containers:
|
if not containers:
|
||||||
print(f'CRITICAL: container {container_name} not found!')
|
print(f'CRITICAL: container {container_name} not found!')
|
||||||
|
|
Loading…
Add table
Reference in a new issue