Fixed issue when container does not have a environment variables.

This commit is contained in:
Joachim Lusiardi 2016-03-25 23:46:51 +01:00
parent 73bddc7bcc
commit 04e6d506a1
1 changed files with 2 additions and 0 deletions

View File

@ -47,6 +47,8 @@ def analyse_env_vars(inspect_data):
"""Extracts the environment variables from the given result of an 'inspect """Extracts the environment variables from the given result of an 'inspect
container' call.""" container' call."""
env_data = {} env_data = {}
if not 'Env' in inspect_data['Config'] or inspect_data['Config']['Env'] is None:
return env_data
for env_var in inspect_data['Config']['Env']: for env_var in inspect_data['Config']['Env']:
t = env_var.split("=") t = env_var.split("=")
env_data[t[0]] = t[1] env_data[t[0]] = t[1]