From: Tony Mack Date: Wed, 11 Nov 2009 20:20:27 +0000 (+0000) Subject: create the data directory if it doesnt already exist X-Git-Tag: sfa-0.9-6~18 X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=commitdiff_plain;h=7943d1a999e3dbcf5e504b5c1f9a5aa59217ef00 create the data directory if it doesnt already exist --- diff --git a/sfa/util/config.py b/sfa/util/config.py index 37f30386..8a37997a 100644 --- a/sfa/util/config.py +++ b/sfa/util/config.py @@ -48,6 +48,10 @@ class Config: if not hasattr(self, 'SFA_CONFIG_DIR'): # default to /var/lib/sfa not specified in config self.SFA_CONFIG_DIR="/etc/sfa" + + # create the data directory if it doesnt exist + if not os.path.isdir(self.SFA_DATA_DIR): + os.mkdir(self.SFA_DATA_DIR) except IOError, e: raise IOError, "Could not find the configuration file: %s" % config_file