Handle case where /containers/json returns "Labels": null

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
Aanand Prasad 2015-07-15 17:13:33 +01:00
commit 0c5c8d1f00
2 changed files with 18 additions and 1 deletions

View file

@ -149,7 +149,7 @@ def _get_legacy_containers_iter(
for service in services:
for container in containers:
if LABEL_VERSION in container['Labels']:
if LABEL_VERSION in (container.get('Labels') or {}):
continue
name = get_container_name(container)