diff --git a/CHANGELOG.md b/CHANGELOG.md index 3aa2426d..6cf229d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ Fixed GCE billing. ### New features / functionalities - Improved compatibility and separation with GlideinWMS Frontend +- Added HTCondor v2 Python binding support (PR #526) ### Changed defaults / behaviours diff --git a/pyproject.toml b/pyproject.toml index 79f51022..fd513c96 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ dependencies = [ "gcs-oauth2-boto-plugin >= 2.7", "google-api-python-client >= 1.12.8", "google_auth >= 1.16.0", - "htcondor >= 9.0.0, < 25.0.0", + "htcondor >= 9.0.0", "numpy >= 1.19.5, < 2.0.0; python_version >= '3.7'", "pandas >= 1.5.3, < 2.0.0; python_version >= '3.7'", "pem", diff --git a/src/decisionengine_modules/htcondor/htcondor_query.py b/src/decisionengine_modules/htcondor/htcondor_query.py index ae8f07c3..25656be5 100644 --- a/src/decisionengine_modules/htcondor/htcondor_query.py +++ b/src/decisionengine_modules/htcondor/htcondor_query.py @@ -8,7 +8,10 @@ import os import sys -import htcondor +try: + import htcondor # pylint: disable=import-error +except ImportError: + import htcondor2 as htcondor # pylint: disable=import-error class QueryError(RuntimeError): diff --git a/src/decisionengine_modules/htcondor/publishers/publisher.py b/src/decisionengine_modules/htcondor/publishers/publisher.py index 8ca09a85..45fe3936 100644 --- a/src/decisionengine_modules/htcondor/publishers/publisher.py +++ b/src/decisionengine_modules/htcondor/publishers/publisher.py @@ -6,14 +6,20 @@ from functools import partial -import classad -import htcondor import pandas from decisionengine.framework.modules import Publisher from decisionengine.framework.modules.Publisher import Parameter from decisionengine_modules.util.retry_function import retry_wrapper +try: + import classad # pylint: disable=import-error + import htcondor # pylint: disable=import-error +except ImportError: + import classad2 as classad # pylint: disable=import-error + import htcondor2 as htcondor # pylint: disable=import-error + + DEFAULT_UPDATE_AD_COMMAND = "UPDATE_AD_GENERIC" DEFAULT_INVALIDATE_AD_COMMAND = "INVALIDATE_ADS_GENERIC" diff --git a/src/decisionengine_modules/util/testutils.py b/src/decisionengine_modules/util/testutils.py index 12a51303..2f85ddd9 100644 --- a/src/decisionengine_modules/util/testutils.py +++ b/src/decisionengine_modules/util/testutils.py @@ -7,7 +7,10 @@ import datetime # noqa: F401 # These imports needed for the `eval` blocks -from classad import classad # noqa: F401 +try: + from classad import classad # noqa: F401 # pylint: disable=import-error +except ImportError: + from classad2 import classad # noqa: F401 # pylint: disable=import-error def input_from_file(fname):