Skip to content

Commit f62a43e

Browse files
authored
[crmsh-4.5] Fix: cmd_status: call crm_mon without shell (#1429) (#1433)
backport: * #1430
2 parents 7179b6e + c84bebd commit f62a43e

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

crmsh/cmd_status.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Copyright (C) 2013 Kristoffer Gronlund <kgronlund@suse.com>
22
# Copyright (C) 2008-2011 Dejan Muhamedagic <dmuhamedagic@suse.de>
33
# See COPYING for license information.
4-
54
import re
5+
import shlex
6+
67
from . import clidisplay
78
from . import utils
89

@@ -79,14 +80,12 @@ def crm_mon(opts=''):
7980
prog = utils.is_program("crm_mon")
8081
if not prog:
8182
raise IOError("crm_mon not available, check your installation")
82-
_, out = utils.get_stdout("%s --help" % (prog))
83+
_crm_mon = [prog, '-1']
84+
_, out = utils.get_stdout([prog, '--help'], shell=False)
8385
if "--pending" in out:
84-
_crm_mon = "%s -1 -j" % (prog)
85-
else:
86-
_crm_mon = "%s -1" % (prog)
86+
_crm_mon.append('-j')
8787

88-
status_cmd = "%s %s" % (_crm_mon, opts)
89-
return utils.get_stdout(utils.add_sudo(status_cmd))
88+
return utils.get_stdout(_crm_mon + shlex.split(opts), shell=False)
9089

9190

9291
def cmd_status(args):

0 commit comments

Comments
 (0)