From 04e6d506a13d6ce2aeca5de758266004bd77e0ec Mon Sep 17 00:00:00 2001 From: Joachim Lusiardi Date: Fri, 25 Mar 2016 23:46:51 +0100 Subject: [PATCH] Fixed issue when container does not have a environment variables. --- nginx_proxy.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nginx_proxy.py b/nginx_proxy.py index eb0bff5..4c0c19c 100755 --- a/nginx_proxy.py +++ b/nginx_proxy.py @@ -47,6 +47,8 @@ def analyse_env_vars(inspect_data): """Extracts the environment variables from the given result of an 'inspect container' call.""" 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']: t = env_var.split("=") env_data[t[0]] = t[1]