diff options
author | Joel Andres Granados <jgranado@redhat.com> | 2008-07-11 13:47:23 +0200 |
---|---|---|
committer | Joel Andres Granados <jgranado@redhat.com> | 2008-07-11 15:33:43 +0200 |
commit | c5c3e6cae831bd2d88358bcb1df63f6bab3c66e6 (patch) | |
tree | 8296749e2a916eb92a740bab76c718f6ea735e1e /firstaidkit | |
parent | bbd61c151a520ae155ca06ddc351d7276564b8e1 (diff) | |
download | firstaidkit-c5c3e6cae831bd2d88358bcb1df63f6bab3c66e6.tar.gz firstaidkit-c5c3e6cae831bd2d88358bcb1df63f6bab3c66e6.tar.xz firstaidkit-c5c3e6cae831bd2d88358bcb1df63f6bab3c66e6.zip |
Handle the situation where /var/log/ directory is not present.
Diffstat (limited to 'firstaidkit')
-rwxr-xr-x | firstaidkit | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/firstaidkit b/firstaidkit index f7ac42a..3887979 100755 --- a/firstaidkit +++ b/firstaidkit @@ -234,17 +234,19 @@ if __name__=="__main__": sys.exit(1) # initialize log for plugin system. - try: - initLogger(Config) - except IOError, ioe: - if ioe[0] == 13: - #This is probably because the user is not root. - Config.log.filename = "firstaidkit.log" + fallbacks = Config.log.fallbacks.split(",") + for lfile in fallbacks: + try: initLogger(Config) - else: - print ioe - usage(sys.argv[0]) - sys.exit(1) + break + except Exception, e: + if lfile != fallbacks[len(fallbacks)-1]: + Config.log.filename = lfile + continue + else: + print e + usage(sys.argv[0]) + sys.exit(1) report = reporting.Reports(maxsize = 1, round = True) try: |