[PATCH] * Enabled shell in Command module and cleaned up syntax.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 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..b67535a 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])

--
1.5.6.5

_______________________________________________
Func-list mailing list
Func-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/func-list

[Index of Archives]     [Fedora Users]     [Linux Networking]     [Fedora Legacy List]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux