From aac802019afec86fc48818c688bb6ecfad9aacee Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 6 Jun 2013 20:48:34 +0200 Subject: simplyfied error handling for version error --- hostinfo-checks | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/hostinfo-checks b/hostinfo-checks index d37b7d5..0319727 100755 --- a/hostinfo-checks +++ b/hostinfo-checks @@ -75,12 +75,9 @@ class MaintainersContext(nagiosplugin.Context): min="0") def print_version(): - try: - import version - self = os.path.basename(sys.argv[0]) - print("%s %s" % (self, version.get_git_version())) - except: - sys.stderr.write('Unable to identify the version information.\n') + import version + self = os.path.basename(sys.argv[0]) + print("%s %s" % (self, version.get_git_version())) sys.exit(nagiosplugin.Unknown.code) @nagiosplugin.guarded -- cgit v1.2.3-1-g7c22