Skip to content
Permalink
Browse files

fence_scsi watchdog: dont exit when command fails using retry parameter

  • Loading branch information...
oalbrigt committed Jun 13, 2019
1 parent 5f79f9e commit 418b3a36c8a7de0e984a0cd4707f2b90f279c4ce
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/fencing.py.py
@@ -530,7 +530,7 @@ def fail_usage(message="", stop=True):
logging.error("Please use '-h' for usage\n")
sys.exit(EC_GENERIC_ERROR)

def fail(error_code):
def fail(error_code, stop=True):
message = {
EC_LOGIN_DENIED : "Unable to connect/login to fencing device",
EC_CONNECTION_LOST : "Connection lost",
@@ -546,7 +546,8 @@ def fail(error_code):

}[error_code] + "\n"
logging.error("%s\n", message)
sys.exit(EC_GENERIC_ERROR)
if stop:
sys.exit(EC_GENERIC_ERROR)

def usage(avail_opt):
print("Usage:")
@@ -1009,7 +1010,7 @@ def run_command(options, command, timeout=None, env=None, log_command=None):
thread.join(timeout)
if thread.is_alive():
process.kill()
fail(EC_TIMED_OUT)
fail(EC_TIMED_OUT, stop=(int(options.get("retry", 0)) < 1))

status = process.wait()

0 comments on commit 418b3a3

Please sign in to comment.
You can’t perform that action at this time.