From c5c3e6cae831bd2d88358bcb1df63f6bab3c66e6 Mon Sep 17 00:00:00 2001 From: Joel Andres Granados Date: Fri, 11 Jul 2008 13:47:23 +0200 Subject: Handle the situation where /var/log/ directory is not present. --- firstaidkit | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'firstaidkit') 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: -- cgit