Skip to content

Commit

Permalink
Merge pull request #971 from liangxin1300/20220511_wait4dc
Browse files Browse the repository at this point in the history
Fix: utils: wait4dc: Make change since output of 'crmadmin -S' change
  • Loading branch information
liangxin1300 committed Jun 1, 2022
2 parents a3a0036 + f83aa41 commit 50fe231
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions crmsh/utils.py
Expand Up @@ -895,15 +895,10 @@ def wait4dc(what="", show_progress=True):
return False
cmd = "crmadmin -S %s" % dc
rc, s = get_stdout(add_sudo(cmd))
if not s.startswith("Status"):
logger.warning("%s unexpected output: %s (exit code: %d)", cmd, s, rc)
return False
try:
dc_status = s.split()[-2]
except:
logger.warning("%s unexpected output: %s", cmd, s)
if rc != 0:
logger.error("Exit code of command {} is {}".format(cmd, rc))
return False
if dc_status == "S_IDLE":
if re.search("S_IDLE.*ok", s):
if output_started:
sys.stderr.write(" done\n")
return True
Expand Down

0 comments on commit 50fe231

Please sign in to comment.