From 1899eac2ba428f2dfc0329823489549cb6159674 Mon Sep 17 00:00:00 2001 From: Henrik Holst Date: Sat, 17 Dec 2016 17:39:58 +0100 Subject: [PATCH 1/2] Fixes https://github.com/docker/compose/issues/4099 Signed-off-by: Henrik Holst --- compose/cli/command.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compose/cli/command.py b/compose/cli/command.py index 020354283..26ff2cae5 100644 --- a/compose/cli/command.py +++ b/compose/cli/command.py @@ -54,7 +54,8 @@ def get_config_path_from_options(base_dir, options, environment): config_files = environment.get('COMPOSE_FILE') if config_files: - return config_files.split(os.pathsep) + pathsep = environment.get('COMPOSE_FILE_SEPARATOR', os.pathsep) + return config_files.split(pathsep) return None From ac12ab95c4c99a60811f4c34e49efcceb9a13c8e Mon Sep 17 00:00:00 2001 From: Joffrey F Date: Wed, 8 Mar 2017 14:30:15 -0800 Subject: [PATCH 2/2] Rename COMPOSE_FILE_SEPARATOR -> COMPOSE_PATH_SEPARATOR Add unit test Signed-off-by: Joffrey F --- compose/cli/command.py | 2 +- tests/unit/cli/command_test.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/compose/cli/command.py b/compose/cli/command.py index 26ff2cae5..c74e585de 100644 --- a/compose/cli/command.py +++ b/compose/cli/command.py @@ -54,7 +54,7 @@ def get_config_path_from_options(base_dir, options, environment): config_files = environment.get('COMPOSE_FILE') if config_files: - pathsep = environment.get('COMPOSE_FILE_SEPARATOR', os.pathsep) + pathsep = environment.get('COMPOSE_PATH_SEPARATOR', os.pathsep) return config_files.split(pathsep) return None diff --git a/tests/unit/cli/command_test.py b/tests/unit/cli/command_test.py index 50fc84e17..3655c432e 100644 --- a/tests/unit/cli/command_test.py +++ b/tests/unit/cli/command_test.py @@ -45,6 +45,15 @@ class TestGetConfigPathFromOptions(object): '.', {}, environment ) == ['one.yml', 'two.yml'] + def test_multiple_path_from_env_custom_separator(self): + with mock.patch.dict(os.environ): + os.environ['COMPOSE_PATH_SEPARATOR'] = '^' + os.environ['COMPOSE_FILE'] = 'c:\\one.yml^.\\semi;colon.yml' + environment = Environment.from_env_file('.') + assert get_config_path_from_options( + '.', {}, environment + ) == ['c:\\one.yml', '.\\semi;colon.yml'] + def test_no_path(self): environment = Environment.from_env_file('.') assert not get_config_path_from_options('.', {}, environment)