diff options
author | Chris Lumens <clumens@redhat.com> | 2007-04-23 15:42:28 +0000 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2007-04-23 15:42:28 +0000 |
commit | 7bfeab2b363b6171db215b8fee1a746b761a2771 (patch) | |
tree | c109add3386e2c733338eb17e58c26dc5c16e502 /iutil.py | |
parent | b52625141547473469e7c5e391670833f7ffa3f8 (diff) | |
download | anaconda-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.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 |