diff --git a/platypush/config/__init__.py b/platypush/config/__init__.py index cc2cede9..921e322f 100644 --- a/platypush/config/__init__.py +++ b/platypush/config/__init__.py @@ -116,9 +116,9 @@ class Config(object): def _read_config_file(self, cfgfile): + cfgfile_dir = os.path.expanduser(os.path.dirname(self._cfgfile)) if not os.path.isabs(cfgfile): - cfgfile = os.path.join(os.path.expanduser( - os.path.dirname(self._cfgfile)), cfgfile) + cfgfile = os.path.join(cfgfile_dir, os.path.basename(cfgfile)) config = {} @@ -132,6 +132,9 @@ class Config(object): else [file_config[section]] for include_file in include_files: + if not os.path.isabs(include_file): + include_file = os.path.join(cfgfile_dir, include_file) + included_config = self._read_config_file(include_file) for incl_section in included_config.keys(): config[incl_section] = included_config[incl_section]