diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2009-02-05 19:08:33 -0700 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2009-02-17 16:03:08 -0500 |
commit | a8c3f054d42947cc2143eead845a06558bfd1317 (patch) | |
tree | d2684307b6bda40909313304d84ea55b4b0d9eee /ipalib/plugable.py | |
parent | ad901da2596d7a6420d6ce3c69b6445d920502dc (diff) | |
download | freeipa-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.py | 8 |
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) |