Skip to content

Commit c0bbb46

Browse files
committed
Migrate to htcondor2 and classad2 (SOFTWARE-6239)
Note: the name of the PyPI package does not change. Also drop error message from info services if we don't have Python bindings since it's no longer possible to install osg-configure-infoservices without them.
1 parent d6cf7f4 commit c0bbb46

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

osg_configure/configure_modules/infoservices.py

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525

2626

2727
try:
28-
import classad
28+
import classad2 as classad
2929
except ImportError:
30-
classad = None
30+
import classad
3131

3232

3333
class InfoServicesConfiguration(BaseConfiguration):
@@ -144,19 +144,12 @@ def configure(self, attributes):
144144
return True
145145

146146
if self.ce_collector_required_rpms_installed and self.htcondor_gateway_enabled:
147-
if classad is None:
148-
self.log("Cannot configure HTCondor CE info services: unable to import HTCondor Python bindings."
149-
"\nEnsure the 'classad' Python module is installed and accessible to Python scripts."
150-
"\nIf using HTCondor from RPMs, install the 'python3-condor' RPM."
151-
"\nIf not, you may need to add the directory containing the Python bindings to PYTHONPATH."
152-
"\nHTCondor version must be at least 8.2.0.", level=logging.WARNING)
153-
else:
154-
try:
155-
self.ce_attributes_str = ce_attributes.get_ce_attributes_str(self.configuration)
156-
except exceptions.SettingError as err:
157-
self.log("Error in info services configuration: %s" % err, level=logging.ERROR)
158-
return False
159-
self._configure_ce_collector()
147+
try:
148+
self.ce_attributes_str = ce_attributes.get_ce_attributes_str(self.configuration)
149+
except exceptions.SettingError as err:
150+
self.log("Error in info services configuration: %s" % err, level=logging.ERROR)
151+
return False
152+
self._configure_ce_collector()
160153

161154
self.log("InfoServicesConfiguration.configure completed")
162155
return True

osg_configure/modules/resourcecatalog.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import classad
1+
try:
2+
import classad2 as classad
3+
except ImportError:
4+
import classad
25
import logging
36
from collections import namedtuple
47
from . import utilities

osg_configure/modules/utilities.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,10 @@ def config_safe_getboolean(configuration: ConfigParser, section: str, option: st
563563

564564
# Import classad here because it might not be available for e.g. SEs
565565
def classad_quote(input_value):
566-
import classad
566+
try:
567+
import classad2 as classad
568+
except ImportError:
569+
import classad
567570
return classad.quote(str(input_value))
568571

569572

0 commit comments

Comments
 (0)