From 1870b3293a26f6d946e8451a10e8c9762ae9f31c Mon Sep 17 00:00:00 2001 From: Tony Asleson Date: Mon, 29 Aug 2016 14:52:41 -0500 Subject: [PATCH] lvmdbusd/lvmdb.py: Make stand alone execution work This was broken when the args were moved to cfg --- daemons/lvmdbusd/cmdhandler.py | 10 +++++----- daemons/lvmdbusd/utils.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/daemons/lvmdbusd/cmdhandler.py b/daemons/lvmdbusd/cmdhandler.py index 877f17cdb..9b0c87738 100644 --- a/daemons/lvmdbusd/cmdhandler.py +++ b/daemons/lvmdbusd/cmdhandler.py @@ -38,10 +38,6 @@ total_count = 0 # at the same time. cmd_lock = threading.RLock() -# The actual method which gets called to invoke the lvm command, can vary -# from forking a new process to using lvm shell -_t_call = None - class LvmExecutionMeta(object): @@ -113,12 +109,16 @@ def call_lvm(command, debug=False): _debug_c(command, process.returncode, (stdout_text, stderr_text)) if process.returncode == 0: - if cfg.args.debug and out[1] and len(out[1]) and 'help' not in command: + if cfg.args and cfg.args.debug and out[1] and len(out[1]) and \ + 'help' not in command: log_error('WARNING: lvm is out-putting text to STDERR on success!') _debug_c(command, process.returncode, (stdout_text, stderr_text)) return process.returncode, stdout_text, stderr_text +# The actual method which gets called to invoke the lvm command, can vary +# from forking a new process to using lvm shell +_t_call = call_lvm def _shell_cfg(): global _t_call diff --git a/daemons/lvmdbusd/utils.py b/daemons/lvmdbusd/utils.py index 06301cd75..7d217df19 100644 --- a/daemons/lvmdbusd/utils.py +++ b/daemons/lvmdbusd/utils.py @@ -262,7 +262,7 @@ def _common_log(msg, *attributes): # @param msg Message to output to stdout # @return None def log_debug(msg, *attributes): - if cfg.args.debug: + if cfg.args and cfg.args.debug: _common_log(msg, *attributes)