From 241506a48dc2dc0f20bce0feafe67c95b0d2bbf0 Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Date: Tue, 8 Mar 2016 17:27:50 +0000 Subject: [PATCH] Add empty string to KOLLA_BOOTSTRAP env variable. A change in docker-py made this fix needed, to allow to create env variables with empty values. Change-Id: Ife6dfc242b600fe386c02dd23d6a142b25c86567 Closes-Bug: #1554126 --- ansible/library/kolla_docker.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ansible/library/kolla_docker.py b/ansible/library/kolla_docker.py index 9fe84f8cb9..d5bf658cf1 100644 --- a/ansible/library/kolla_docker.py +++ b/ansible/library/kolla_docker.py @@ -458,11 +458,15 @@ class DockerWorker(object): return self.dc.create_host_config(**options) + def _format_env_vars(self): + env = self.params.get('environment') + return {k: "" if env[k] is None else env[k] for k in env} + def build_container_options(self): volumes, binds = self.generate_volumes() return { 'detach': self.params.get('detach'), - 'environment': self.params.get('environment'), + 'environment': self._format_env_vars(), 'host_config': self.build_host_config(binds), 'labels': self.params.get('labels'), 'image': self.params.get('image'),