Fix #3281: Unexpected result when using build args with default values

Fix the issue when build arg is set to None instead of empty string. Usecase:

cat docker-compose.yml
.... args:
- http_proxy
- https_proxy
- no_proxy

If http_proxy, https_proxy, no_proxy environment variables are not defined then http_proxy,
https_proxy, no_proxy build args will be set to string None which breaks all downloads

With this change undefined build args will be set to empty string instead of string None

Signed-off-by: Andrey Devyatkin <andrey.a.devyatkin@gmail.com>
This commit is contained in:
Andrey Devyatkin 2016-05-27 19:59:27 +02:00
commit c148849f0e
4 changed files with 5 additions and 37 deletions

View file

@ -715,7 +715,7 @@ class ConfigTest(unittest.TestCase):
).services[0]
assert 'args' in service['build']
assert 'foo' in service['build']['args']
assert service['build']['args']['foo'] == 'None'
assert service['build']['args']['foo'] == ''
def test_load_with_multiple_files_mismatched_networks_format(self):
base_file = config.ConfigFile(