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 <mazz@houseofmnowster.com>
This commit is contained in:
Mazz Mosley 2015-07-03 12:21:12 +01:00
parent 254bc4908c
commit bd7fcd1123
1 changed files with 5 additions and 2 deletions

View File

@ -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):