From 3346f2ea0f00e62a30ca38d680abdb47f8440259 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Sat, 29 Jun 2013 16:22:59 +0200 Subject: Executor: do not split the command line if shell is true If the command should be excuted within a shell, it should not be splited into a list. If subcommand.Popen gets a list, the first element is the command and all other are the arguements. This breaks the shell evaluation of the commamnd. --- src/lib/Bcfg2/Utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/lib/Bcfg2/Utils.py') diff --git a/src/lib/Bcfg2/Utils.py b/src/lib/Bcfg2/Utils.py index 9f46582c4..4293f3f69 100644 --- a/src/lib/Bcfg2/Utils.py +++ b/src/lib/Bcfg2/Utils.py @@ -216,7 +216,9 @@ class Executor(object): """ if isinstance(command, str): cmdstr = command - command = shlex.split(cmdstr) + + if not shell: + command = shlex.split(cmdstr) else: cmdstr = " ".join(command) self.logger.debug("Running: %s" % cmdstr) -- cgit v1.2.3-1-g7c22