Skip to content

Commit a0d4629

Browse files
committed
Bit of renaming/refactoring
1 parent 7891078 commit a0d4629

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

osg_configure/configure_modules/gratia.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,8 @@ def parse_configuration(self, configuration):
107107
self._itb_defaults['probes']
108108

109109
# grab configuration information for various jobmanagers
110-
probes_iter = self.get_installed_probe_config_files().keys()
111-
for probe in probes_iter:
112-
if probe == 'htcondor-ce':
113-
self._probe_config['htcondor-ce'] = {}
110+
if "htcondor-ce" in self.get_installed_probe_config_files_by_probe():
111+
self._probe_config['htcondor-ce'] = {}
114112

115113
self.get_options(configuration,
116114
ignore_options=['itb-jobmanager-gratia',
@@ -165,9 +163,8 @@ def configure(self, attributes):
165163
return False
166164

167165
hostname = attributes['OSG_HOSTNAME']
168-
probe_config_files = self.get_installed_probe_config_files()
169-
probes_iter = probe_config_files.keys()
170-
for probe in probes_iter:
166+
probe_config_files_by_probe = self.get_installed_probe_config_files_by_probe()
167+
for probe in probe_config_files_by_probe:
171168
if probe in self._job_managers:
172169
if probe not in self._probe_config:
173170
# Probe is installed but we don't have configuration for it
@@ -189,20 +186,20 @@ def configure(self, attributes):
189186

190187
self._subscribe_probe_to_remote_host(
191188
probe,
192-
probe_config_files[probe],
189+
probe_config_files_by_probe[probe],
193190
remote_host=probe_host,
194191
local_resource=self.options['resource'].value,
195192
local_host=hostname
196193
)
197-
if probe == 'htcondor-ce':
198-
self._configure_htcondor_ce_probe()
194+
if "htcondor-ce" in probe_config_files_by_probe:
195+
self._configure_htcondor_ce_probe()
199196

200197
self.log("GratiaConfiguration.configure completed")
201198
return True
202199

203200
# pylint: disable-msg=R0201
204201
@staticmethod
205-
def get_installed_probe_config_files():
202+
def get_installed_probe_config_files_by_probe():
206203
"""Return a mapping of probe name -> ProbeConfig file.
207204
Note that "pbs" and "lsf" have the same probe.
208205
"""

0 commit comments

Comments
 (0)