Module: check_mk
Branch: master
Commit: 80bc14e9f8e91146bfa120205e619f2ebb96c89d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=80bc14e9f8e911…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Wed Aug 1 07:27:43 2018 +0200
check_sql: Fix use of cmk_password_store
Change-Id: I94a7195d330dbc09d6d1fe2c9f6c8d7897c7762a
---
active_checks/check_sql | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/active_checks/check_sql b/active_checks/check_sql
index 3691fc5..e692604 100755
--- a/active_checks/check_sql
+++ b/active_checks/check_sql
@@ -34,8 +34,12 @@ import getopt
import os
import logging
import argparse
-# import cmk.password_store will be done later,
-# unless --no-cmk-password-store is specified!
+
+try:
+ import cmk.password_store
+ cmk.password_store.replace_passwords()
+except ImportError:
+ pass
log = logging.getLogger(__name__)
@@ -91,9 +95,6 @@ def parse_args(argv):
type=lambda s: s.split(','),
help='''comma separated list if values of input
variables
if required by the procedure''')
- parser.add_argument("--no-cmk-password-store",
action="store_true",
- help='''do not use the cmk password
store''')
-
# optional arguments
parser.add_argument("-d", "--dbms", default='postgres',
choices=['postgres', 'mysql', 'mssql',
'oracle', 'db2'],
@@ -137,11 +138,6 @@ def parse_args(argv):
output of the SQL-Statement''')
args = parser.parse_args(argv[1:])
- # PASSWORD STORE
- if not args.no_cmk_password_store:
- import cmk.password_store
- cmk.password_store.replace_passwords()
-
# LOGGING
fmt = "%(message)s"
if args.verbose > 1: