From 7943d1a999e3dbcf5e504b5c1f9a5aa59217ef00 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Wed, 11 Nov 2009 20:20:27 +0000 Subject: [PATCH] create the data directory if it doesnt already exist --- sfa/util/config.py | 4 ++++ 1 file changed, 4 insertions(+) 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 -- 2.43.0