Reduce path manipulation

If we're using self.filename, then it's already a full path and we
don't need to splice off the filename.yml just so we can .join it
back together again.

Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
This commit is contained in:
Mazz Mosley 2015-07-02 16:50:33 +01:00
parent 6e4a954dbd
commit 5e2d43843c
1 changed files with 4 additions and 4 deletions

View File

@ -163,12 +163,12 @@ class ServiceLoader(object):
if self.working_dir is None:
raise Exception("No working_dir passed to ServiceLoader()")
try:
if 'file' in extends_options:
extends_from_filename = extends_options['file']
except KeyError:
extends_from_filename = os.path.split(self.filename)[1]
other_config_path = expand_path(self.working_dir, extends_from_filename)
else:
other_config_path = self.filename
other_config_path = expand_path(self.working_dir, extends_from_filename)
other_working_dir = os.path.dirname(other_config_path)
other_already_seen = self.already_seen + [self.signature(service_dict['name'])]
other_loader = ServiceLoader(