summaryrefslogtreecommitdiffstats
path: root/ipa-python/ipautil.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2010-11-08 14:09:04 -0500
committerRob Crittenden <rcritten@redhat.com>2010-11-17 15:14:21 -0500
commitbf304533ce4dd003c451580323a6588e4d80b440 (patch)
tree2baddfc26391bfe17a36378893fba8cc2267c68f /ipa-python/ipautil.py
parentb3fbb7cbea69b768b11dbbf530ed77d65010d428 (diff)
downloadfreeipa-ipa-1-2.tar.gz
freeipa-ipa-1-2.tar.xz
freeipa-ipa-1-2.zip
Use PATH in env when running commands to find binaries.ipa-1-2
Fedora 14 moved the kerberos binaries from /usr/kerberos/[s]bin to /usr/[s]bin. Pass PATH to the environment in ipautil.run() so we can work universally across distributions. Bug 650725
Diffstat (limited to 'ipa-python/ipautil.py')
-rw-r--r--ipa-python/ipautil.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/ipa-python/ipautil.py b/ipa-python/ipautil.py
index d604225c5..7682d9933 100644
--- a/ipa-python/ipautil.py
+++ b/ipa-python/ipautil.py
@@ -82,12 +82,15 @@ def write_tmp_file(txt):
return fd
-def run(args, stdin=None):
+def run(args, stdin=None, env=None):
+ if env is None:
+ env={"PATH": "/bin:/sbin:/usr/kerberos/bin:/usr/kerberos/sbin:/usr/bin:/usr/sbin"}
+
if stdin:
- p = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True)
+ p = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True, env=env)
stdout,stderr = p.communicate(stdin)
else:
- p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True)
+ p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True, env=env)
stdout,stderr = p.communicate()
logging.info(stdout)