Avoid key error if 'Status' is not present in container info.

- assumes container is not running if 'Status' not present
This commit is contained in:
Steven Joseph 2015-08-17 22:35:50 +10:00
parent c34c6b992f
commit 1199218bec

View File

@ -2279,7 +2279,7 @@ def ps_(**kwargs):
continue
for item in container:
c_state = 'running' \
if container['Status'].lower().startswith('up ') \
if container.get('Status', '').lower().startswith('up ') \
else 'stopped'
bucket = __context__.setdefault('docker.ps', {}).setdefault(
c_state, {})