summaryrefslogtreecommitdiffstats
path: root/ipalib/plugable.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2009-02-05 19:08:33 -0700
committerRob Crittenden <rcritten@redhat.com>2009-02-17 16:03:08 -0500
commita8c3f054d42947cc2143eead845a06558bfd1317 (patch)
treed2684307b6bda40909313304d84ea55b4b0d9eee /ipalib/plugable.py
parentad901da2596d7a6420d6ce3c69b6445d920502dc (diff)
downloadfreeipa-a8c3f054d42947cc2143eead845a06558bfd1317.tar.gz
freeipa-a8c3f054d42947cc2143eead845a06558bfd1317.tar.xz
freeipa-a8c3f054d42947cc2143eead845a06558bfd1317.zip
Started cleanup work on ra plugin; fixed problem in api.bootstrap() when process does not have permision to open log file
Diffstat (limited to 'ipalib/plugable.py')
-rw-r--r--ipalib/plugable.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/ipalib/plugable.py b/ipalib/plugable.py
index cf2919f1f..2c862a953 100644
--- a/ipalib/plugable.py
+++ b/ipalib/plugable.py
@@ -568,9 +568,13 @@ class API(DictProxy):
try:
os.makedirs(log_dir)
except OSError:
- log.warn('Could not create log_dir %r', log_dir)
+ log.error('Could not create log_dir %r', log_dir)
return
- handler = logging.FileHandler(self.env.log)
+ try:
+ handler = logging.FileHandler(self.env.log)
+ except IOError, e:
+ log.error('Cannot open log file %r: %s', self.env.log, e.strerror)
+ return
handler.setFormatter(util.LogFormatter(FORMAT_FILE))
if self.env.debug:
handler.setLevel(logging.DEBUG)