From bd7fcd112339c40c2add6d394f584305275b749a Mon Sep 17 00:00:00 2001 From: Mazz Mosley Date: Fri, 3 Jul 2015 12:21:12 +0100 Subject: [PATCH] Use absolute paths A circular reference bug occurs when there is a difference in the paths of the file specified in the extends. So one time it is relative, second time is absolute thus allowing a further circular reference to occur. By using absolute paths we can be sure that the service filename check is correct. Signed-off-by: Mazz Mosley --- compose/config.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/compose/config.py b/compose/config.py index c054213e..d32fe37e 100644 --- a/compose/config.py +++ b/compose/config.py @@ -140,8 +140,11 @@ def make_service_dict(name, service_dict, working_dir=None): class ServiceLoader(object): def __init__(self, working_dir, filename=None, already_seen=None): - self.working_dir = working_dir - self.filename = filename + self.working_dir = os.path.abspath(working_dir) + if filename: + self.filename = os.path.abspath(filename) + else: + self.filename = filename self.already_seen = already_seen or [] def make_service_dict(self, name, service_dict):