From 74e003d29bc6b9f9de8e2d3577eeb3b5d316eec2 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 21 Aug 2013 18:52:35 +0200 Subject: [PATCH] +print cdist version on startup + exit_code = 2 for irq Signed-off-by: Nico Schottelius --- cdist/log.py | 8 +------- scripts/cdist | 10 +++------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/cdist/log.py b/cdist/log.py index 063059a2..8c3aac79 100644 --- a/cdist/log.py +++ b/cdist/log.py @@ -23,21 +23,15 @@ import logging class Log(logging.Logger): - """Hold information about current context""" def __init__(self, name): - # Context logging self.name = name - - # Init real logger super().__init__(name) - - # Add ourselves as a filter self.addFilter(self) def filter(self, record): - """Add hostname to logs via logging Filter""" + """Prefix messages with logger name""" record.msg = self.name + ": " + str(record.msg) diff --git a/scripts/cdist b/scripts/cdist index bbf45d17..4d10f37d 100755 --- a/scripts/cdist +++ b/scripts/cdist @@ -114,6 +114,7 @@ def commandline(): logging.root.setLevel(logging.DEBUG) log.debug(args) + log.info("version %s" % cdist.VERSION) # Work around python 3.3 bug: # http://bugs.python.org/issue16308 @@ -171,16 +172,11 @@ if __name__ == "__main__": commandline() except KeyboardInterrupt: - pass - - # FIXME: We always get exit code = 130 - # exit_code = 2 - # does not make a difference + exit_code = 2 except cdist.Error as e: log.error(e) exit_code = 1 - #sys.exit(20) - #print("ok2 %s" % exit_code) + # print("ok2 %s" % exit_code) sys.exit(exit_code)