Fix Config.find for Compose files in nested folders

Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
Joffrey F 2017-04-07 12:19:37 -07:00
parent 7aa55120db
commit 3b02426236
1 changed files with 3 additions and 3 deletions

View File

@ -234,10 +234,10 @@ class ServiceConfig(namedtuple('_ServiceConfig', 'working_dir filename name conf
config)
def find(base_dir, filenames, environment, override_dir='.'):
def find(base_dir, filenames, environment, override_dir=None):
if filenames == ['-']:
return ConfigDetails(
os.path.abspath(override_dir),
os.path.abspath(override_dir) if override_dir else os.getcwd(),
[ConfigFile(None, yaml.safe_load(sys.stdin))],
environment
)
@ -249,7 +249,7 @@ def find(base_dir, filenames, environment, override_dir='.'):
log.debug("Using configuration files: {}".format(",".join(filenames)))
return ConfigDetails(
override_dir or os.path.dirname(filenames[0]),
override_dir if override_dir else os.path.dirname(filenames[0]),
[ConfigFile.from_filename(f) for f in filenames],
environment
)