aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-02-11 10:05:36 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-02-11 10:05:36 -0500
commit45b76c9939cdc6685d924bdbac56b1590850f0f5 (patch)
tree2a63cc495f2d0c0e6c5bdda13529940c16b78f56
parent7a8fc076803a344db4890616d2ec4a8307d819c7 (diff)
downloadhtc_utils-45b76c9939cdc6685d924bdbac56b1590850f0f5.tar.gz
* Improve Condor validation
-rw-r--r--htc_utils/bindings/__init__.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/htc_utils/bindings/__init__.py b/htc_utils/bindings/__init__.py
index 9b50384..7f403e1 100644
--- a/htc_utils/bindings/__init__.py
+++ b/htc_utils/bindings/__init__.py
@@ -3,17 +3,23 @@ import subprocess
from collections import OrderedDict
from distutils.spawn import find_executable
-__all__ = ['htcondor_path', 'recast', 'Job', 'Submit']
+__all__ = ['htcondor_path', 'recast', 'Job', 'Submit', 'Wait']
def htcondor_path(path=None):
- needles = ['condor_master', 'condor_submit']
+ needles = ['condor_master', 'condor_submit', 'condor_wait']
paths = []
+
if path is not None:
os.environ['PATH'] = ':'.join([os.path.join(path, 'bin'), os.environ['PATH']])
os.environ['PATH'] = ':'.join([os.path.join(path, 'sbin'), os.environ['PATH']])
for needle in needles:
- paths.append(os.path.dirname(find_executable(needle)))
+ try:
+ executable = find_executable(needle, os.environ['PATH'])
+ path = os.path.dirname(executable)
+ paths.append(path)
+ except AttributeError:
+ pass
if not paths:
raise OSError('Unable to find a valid HTCondor installation.')
@@ -56,4 +62,5 @@ def recast(value):
from .job import *
-from .submit import * \ No newline at end of file
+from .submit import *
+from .wait import *