Skip to content

Commit

Permalink
don't break get_dc output interface
Browse files Browse the repository at this point in the history
  • Loading branch information
freishutz authored Jun 26, 2024
1 parent 63dd4bc commit b546703
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions crmsh/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -989,14 +989,16 @@ def append_file(dest, src):
return False


def get_dc(peer=None):
def get_dc(peer=None, show_rc=False):
cmd = "crmadmin -D -t 1"
rc, out, _ = sh.cluster_shell().get_rc_stdout_stderr_without_input(peer, cmd)
if not out:
return (None, rc)
if not out.startswith("Designated"):
return (None, rc)
return (out.split()[-1], rc)
if not out or not out.startswith("Designated"):
out = None
else:
out = out.split()[-1]
if show_rc:
return (out, rc)
return out


def wait4dc(what="", show_progress=True):
Expand Down

0 comments on commit b546703

Please sign in to comment.