summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2013-06-29 16:22:59 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2013-06-29 16:22:59 +0200
commit3346f2ea0f00e62a30ca38d680abdb47f8440259 (patch)
treea14a54eb663fd9e24f6961331270eaf5ee8ff89e /src
parentb5d2421b907d89122b14341e9f00cf4ca8650622 (diff)
downloadbcfg2-3346f2ea0f00e62a30ca38d680abdb47f8440259.tar.gz
bcfg2-3346f2ea0f00e62a30ca38d680abdb47f8440259.tar.bz2
bcfg2-3346f2ea0f00e62a30ca38d680abdb47f8440259.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/lib/Bcfg2/Utils.py4
1 files changed, 3 insertions, 1 deletions
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)