From: S.Çağlar Onur <caglar@cs.princeton.edu>
Date: Fri, 27 Aug 2010 16:40:38 +0000 (-0400)
Subject: handle shell redirects
X-Git-Tag: bootmanager-5.0-13~2^2~5
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=5e12a0a27c0c7518641e03cfa1ba2a32143a44aa;p=bootmanager.git

handle shell redirects
---

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 " \