Change special case from '_', None to ()

Signed-off-by: jrabbit <jackjrabbit@gmail.com>
This commit is contained in:
jrabbit 2016-02-06 02:54:06 -05:00
parent 0019037712
commit 677c50650c
1 changed files with 3 additions and 9 deletions

View File

@ -464,18 +464,12 @@ def resolve_environment(service_dict):
env.update(env_vars_from_file(env_file))
env.update(parse_environment(service_dict.get('environment')))
d = dict(resolve_env_var(k, v) for k, v in six.iteritems(env))
if '_' in d.keys():
del d['_']
return d
return dict(filter(None, (resolve_env_var(k, v) for k, v in six.iteritems(env))))
def resolve_build_args(build):
args = parse_build_arguments(build.get('args'))
d = dict(resolve_env_var(k, v) for k, v in six.iteritems(args))
if '_' in d.keys():
del d['_']
return d
return dict(filter(None, (resolve_env_var(k, v) for k, v in six.iteritems(args))))
def validate_extended_service_dict(service_dict, filename, service):
@ -736,7 +730,7 @@ def resolve_env_var(key, val):
elif key in os.environ:
return key, os.environ[key]
else:
return "_", None
return ()
def env_vars_from_file(filename):