Module: check_mk
Branch: master
Commit: 526304b3cae16656b1fb578b0e447c2047a98e16
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=526304b3cae166…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jul 13 10:01:59 2017 +0200
Small cleanup of imports; get version from cmk module
Change-Id: I7e7ed9190b61b34263c59d387d5277d510ebdb1c
---
Makefile | 2 +-
bin/mkeventd | 32 ++++++++++++++++++++------------
2 files changed, 21 insertions(+), 13 deletions(-)
diff --git a/Makefile b/Makefile
index dae19c8..b50d88b 100644
--- a/Makefile
+++ b/Makefile
@@ -400,7 +400,7 @@ version:
setversion:
sed -ri 's/^(VERSION[[:space:]]*:?= *).*/\1'"$(NEW_VERSION)/" Makefile
; \
sed -i 's/^AC_INIT.*/AC_INIT([MK Livestatus],
['"$(NEW_VERSION)"'], [mk(a)mathias-kettner.de])/' configure.ac ; \
- sed -i 's/^VERSION=".*/VERSION="$(NEW_VERSION)"/' bin/mkeventd
bin/mkbackup ; \
+ sed -i 's/^VERSION=".*/VERSION="$(NEW_VERSION)"/' bin/mkbackup ;
\
sed -i 's/^__version__ = ".*"$$/__version__ =
"$(NEW_VERSION)"/' lib/__init__.py bin/mkbench bin/livedump; \
sed -i 's/^VERSION=.*/VERSION='"$(NEW_VERSION)"'/'
scripts/setup.sh ; \
echo 'check-mk_$(NEW_VERSION)-1_all.deb net optional' > debian/files
diff --git a/bin/mkeventd b/bin/mkeventd
index 2d8507e..065ab76 100755
--- a/bin/mkeventd
+++ b/bin/mkeventd
@@ -33,20 +33,28 @@
import ast
import errno
-import socket, os, time, sys, getopt, signal, thread, pprint, re, \
- select, subprocess, stat, string
+import socket
+import os
+import time
+import sys
+import getopt
+import signal
+import thread
+import pprint
+import re
+import select
+import subprocess
+import stat
+import string
import traceback
-from cmk.regex import regex, is_regex
+import json
+
+import cmk
import cmk.defines as defines
import cmk.daemon
-import livestatus
-
-try:
- import simplejson as json
-except ImportError:
- import json
+from cmk.regex import regex, is_regex
-VERSION="1.5.0i1"
+import livestatus
# .--Declarations--------------------------------------------------------.
# | ____ _ _ _ |
@@ -4915,7 +4923,7 @@ try:
usage()
sys.exit(0)
elif o in [ '-V', '--version' ]:
- sys.stdout.write("mkeventd version %s\n" % VERSION)
+ sys.stdout.write("mkeventd version %s\n" % cmk.__version__)
sys.exit(0)
if opt_snmptrap:
@@ -4945,7 +4953,7 @@ try:
if not opt_foreground:
open_logfile()
log("-" * 65)
- log("mkeventd version %s starting" % VERSION)
+ log("mkeventd version %s starting" % cmk.__version__)
load_configuration()