From d592896814b5ad5dd57f62510d6c32a63df63e31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Dunand?= <aurelien.dunand@smartjog.com> Date: Fri, 1 Jul 2011 10:44:48 +0200 Subject: [PATCH] Config filename must be a file --- installsystems/config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/installsystems/config.py b/installsystems/config.py index ff93799..81431e5 100644 --- a/installsystems/config.py +++ b/installsystems/config.py @@ -22,8 +22,8 @@ class ConfigFile(object): ''' filename can be full path to config file or a name in config directory ''' - #try to get filename in default config dir - if os.path.exists(filename): + #try to get filename in default config dir + if os.path.isfile(filename): self.path = os.path.abspath(filename) else: self.path = self._config_path(filename) @@ -41,7 +41,7 @@ class ConfigFile(object): ''' for cf in [ os.path.join(os.path.expanduser("~/.config/installsystems/%s.conf" % name)), "/etc/installsystems/%s.conf" % name ]: - if (os.path.exists(cf) and os.path.isfile(cf) and os.access(cf, os.R_OK)): + if (os.path.isfile(cf) and os.access(cf, os.R_OK)): return cf return None -- GitLab