summaryrefslogtreecommitdiffstats
path: root/func
diff options
context:
space:
mode:
authorSilas Sewell <silas@sewell.ch>2008-11-25 10:22:14 -0700
committerAdrian Likins <alikins@redhat.com>2008-11-25 12:57:41 -0500
commit6b16e2f8250ed91c4d5c7642e15b2e2d30b49352 (patch)
tree0d0292f552d5ce69734ad5d8e5da6fbc751fe059 /func
parentd99728f73352566d6a7298021fb76cfbfcb32a1c (diff)
downloadfunc-6b16e2f8250ed91c4d5c7642e15b2e2d30b49352.tar.gz
func-6b16e2f8250ed91c4d5c7642e15b2e2d30b49352.tar.xz
func-6b16e2f8250ed91c4d5c7642e15b2e2d30b49352.zip
* Enabled shell for Command module.
* Removed unnecessary if statement.
Diffstat (limited to 'func')
-rw-r--r--func/minion/modules/command.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/func/minion/modules/command.py b/func/minion/modules/command.py
index 4706f30..b822121 100644
--- a/func/minion/modules/command.py
+++ b/func/minion/modules/command.py
@@ -27,15 +27,9 @@ class Command(func_module.FuncModule):
Runs a command, returning the return code, stdout, and stderr as a tuple.
NOT FOR USE WITH INTERACTIVE COMMANDS.
"""
-
-
- if env:
- cmdref = sub_process.Popen(command.split(), stdout=sub_process.PIPE,
- stderr=sub_process.PIPE, shell=False,
- close_fds=True, env=env)
- else:
- cmdref = sub_process.Popen(command.split(), stdout=sub_process.PIPE,
- stderr=sub_process.PIPE, shell=False, close_fds=True)
+ cmdref = sub_process.Popen(command, stdout=sub_process.PIPE,
+ stderr=sub_process.PIPE, shell=True,
+ close_fds=True, env=env)
data = cmdref.communicate()
return (cmdref.returncode, data[0], data[1])