Skip to content

Fix: cmd_status: call crm_mon without shell (#1429) #1430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions crmsh/cmd_status.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright (C) 2013 Kristoffer Gronlund <kgronlund@suse.com>
# Copyright (C) 2008-2011 Dejan Muhamedagic <dmuhamedagic@suse.de>
# See COPYING for license information.

import re
import shlex

from . import clidisplay
from . import utils
from .sh import ShellUtils
Expand Down Expand Up @@ -81,14 +82,12 @@
prog = utils.is_program("crm_mon")
if not prog:
raise IOError("crm_mon not available, check your installation")
_, out = shell.get_stdout("%s --help" % (prog))
_crm_mon = [prog, '-1']
_, out = shell.get_stdout([prog, '--help'], shell=False)
if "--pending" in out:
_crm_mon = "%s -1 -j" % (prog)
else:
_crm_mon = "%s -1" % (prog)
_crm_mon.append('-j')

Check warning on line 88 in crmsh/cmd_status.py

View check run for this annotation

Codecov / codecov/patch

crmsh/cmd_status.py#L88

Added line #L88 was not covered by tests

status_cmd = "%s %s" % (_crm_mon, opts)
return shell.get_stdout_stderr(utils.add_sudo(status_cmd))
return shell.get_stdout_stderr(_crm_mon + shlex.split(opts), shell=False)


def cmd_status(args):
Expand Down
Loading