diff options
author | Joffrey F <joffrey@docker.com> | 2016-12-02 14:50:40 -0800 |
---|---|---|
committer | Joffrey F <joffrey@docker.com> | 2016-12-02 14:50:40 -0800 |
commit | 88b733b0f446440f8d8ef1a73e09daadee67dcb5 (patch) | |
tree | 8e077b2d9350e5a6d2fa547499464bc8719e94a6 /docker | |
parent | 9f2f93de0ed4d9dd4c43e445ca5127752e380a2d (diff) | |
parent | cb967ef6825d62d10d2bebeda5ab89be8056a014 (diff) | |
download | docker-py-88b733b0f446440f8d8ef1a73e09daadee67dcb5.tar.gz |
Merge branch 'patch-1' of https://github.com/manics/docker-py into manics-patch-1manics-patch-1
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'docker')
-rw-r--r-- | docker/types/services.py | 7 | ||||
-rw-r--r-- | docker/utils/__init__.py | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/docker/types/services.py b/docker/types/services.py index 82d1e60..5041f89 100644 --- a/docker/types/services.py +++ b/docker/types/services.py @@ -1,7 +1,7 @@ import six from .. import errors -from ..utils import split_command +from ..utils import format_environment, split_command class TaskTemplate(dict): @@ -82,7 +82,10 @@ class ContainerSpec(dict): self['Args'] = args if env is not None: - self['Env'] = env + if isinstance(env, dict): + self['Env'] = format_environment(env) + else: + self['Env'] = env if workdir is not None: self['Dir'] = workdir if user is not None: diff --git a/docker/utils/__init__.py b/docker/utils/__init__.py index 061c26e..747743c 100644 --- a/docker/utils/__init__.py +++ b/docker/utils/__init__.py @@ -6,6 +6,7 @@ from .utils import ( create_host_config, parse_bytes, ping_registry, parse_env_file, version_lt, version_gte, decode_json_header, split_command, create_ipam_config, create_ipam_pool, parse_devices, normalize_links, convert_service_networks, + format_environment ) from .decorators import check_resource, minimum_version, update_headers |