diff options
author | Silas Sewell <silas@sewell.ch> | 2008-11-25 10:22:14 -0700 |
---|---|---|
committer | Adrian Likins <alikins@redhat.com> | 2008-11-25 12:57:41 -0500 |
commit | 6b16e2f8250ed91c4d5c7642e15b2e2d30b49352 (patch) | |
tree | 0d0292f552d5ce69734ad5d8e5da6fbc751fe059 | |
parent | d99728f73352566d6a7298021fb76cfbfcb32a1c (diff) | |
download | func-6b16e2f8250ed91c4d5c7642e15b2e2d30b49352.tar.gz func-6b16e2f8250ed91c4d5c7642e15b2e2d30b49352.tar.xz func-6b16e2f8250ed91c4d5c7642e15b2e2d30b49352.zip |
* Enabled shell for Command module.
* Removed unnecessary if statement.
-rw-r--r-- | func/minion/modules/command.py | 12 |
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]) |