summaryrefslogtreecommitdiffstats
path: root/iutil.py
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2007-04-23 15:42:28 +0000
committerChris Lumens <clumens@redhat.com>2007-04-23 15:42:28 +0000
commit7bfeab2b363b6171db215b8fee1a746b761a2771 (patch)
treec109add3386e2c733338eb17e58c26dc5c16e502 /iutil.py
parentb52625141547473469e7c5e391670833f7ffa3f8 (diff)
downloadanaconda-7bfeab2b363b6171db215b8fee1a746b761a2771.tar.gz
anaconda-7bfeab2b363b6171db215b8fee1a746b761a2771.tar.xz
anaconda-7bfeab2b363b6171db215b8fee1a746b761a2771.zip
Make sure kickstart scripts execute with the correct cwd (#237317).
Diffstat (limited to 'iutil.py')
-rw-r--r--iutil.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/iutil.py b/iutil.py
index 0a64cf2a5..b501618df 100644
--- a/iutil.py
+++ b/iutil.py
@@ -24,7 +24,7 @@ from flags import flags
import logging
log = logging.getLogger("anaconda")
-def execWithRedirect(command, argv, stdin = 0, stdout = 1, stderr = 2,
+def execWithRedirect(command, argv, stdin = 0, stdout = 1, stderr = 2,
searchPath = 0, root = '/'):
def chroot ():
os.chroot(root)
@@ -45,7 +45,7 @@ def execWithRedirect(command, argv, stdin = 0, stdout = 1, stderr = 2,
try:
proc = subprocess.Popen([command] + argv, stdin=stdin, stdout=stdout,
- stderr=stderr, preexec_fn=chroot)
+ stderr=stderr, preexec_fn=chroot, cwd=root)
ret = proc.wait()
except OSError, (errno, msg):
raise RuntimeError, "Error running " + command + ": " + msg
@@ -69,7 +69,7 @@ def execWithCapture(command, argv, stdin = 0, stderr = 2, root='/'):
pipe = subprocess.Popen([command] + argv, stdin=stdin,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
- preexec_fn=chroot)
+ preexec_fn=chroot, cwd=root)
except OSError, (errno, msg):
raise RuntimeError, "Error running " + command + ": " + msg