From 6b16e2f8250ed91c4d5c7642e15b2e2d30b49352 Mon Sep 17 00:00:00 2001 From: Silas Sewell Date: Tue, 25 Nov 2008 10:22:14 -0700 Subject: * Enabled shell for Command module. * Removed unnecessary if statement. --- func/minion/modules/command.py | 12 +++--------- 1 file 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]) -- cgit