From 5e12a0a27c0c7518641e03cfa1ba2a32143a44aa Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Fri, 27 Aug 2010 12:40:38 -0400 Subject: [PATCH] handle shell redirects --- source/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/utils.py b/source/utils.py index f57a0a3..89c63d3 100644 --- a/source/utils.py +++ b/source/utils.py @@ -134,7 +134,10 @@ def sysexec( cmd, log= None, fsck = False ): print ("sysexec >>> %s" % cmd) try: - prog = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE, stderr=subprocess.PIPE) + if cmd.__contains__(">"): + prog = subprocess.Popen(shlex.split(cmd), shell=True) + else: + prog = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE, stderr=subprocess.PIPE) except OSError: raise BootManagerException, \ "Unable to create instance of subprocess.Popen " \ -- 2.43.0