@@ -63,6 +63,7 @@ def __init__(self, *args, **kwargs):
63
63
64
64
65
65
self .config_section = "BOSCO"
66
+ self .bosco_cluster = None
66
67
self .log ("BoscoConfiguration.__init__ completed" )
67
68
68
69
@@ -181,7 +182,13 @@ def configure(self, attributes):
181
182
return True
182
183
183
184
# Do all the things here!
184
-
185
+ self .bosco_cluster = shutil .which ("condor_remote_cluster" ) or shutil .which ("bosco_cluster" )
186
+
187
+ if not self .bosco_cluster and self .opt_val ("install_cluster" ) != "never" :
188
+ self .log ("Cannot install remote cluster: neither condor_remote_cluster nor bosco_cluster were found" ,
189
+ level = logging .ERROR )
190
+ return False
191
+
185
192
# For each user, install bosco.
186
193
for username in self .options ['users' ].value .split ("," ):
187
194
username = username .strip ()
@@ -273,7 +280,7 @@ def result():
273
280
274
281
if self .opt_val ("install_cluster" ) == "if_needed" :
275
282
# Only install if it's not in the clusterlist
276
- cmd = [" bosco_cluster" , "-l" ]
283
+ cmd = [self . bosco_cluster , "-l" ]
277
284
process = subprocess .Popen (cmd , stdout = subprocess .PIPE , stderr = subprocess .PIPE ,
278
285
preexec_fn = demote (user_uid , user_gid ), env = env ,
279
286
encoding = "latin-1" )
@@ -290,13 +297,13 @@ def result():
290
297
self .log ("Entry found in clusterlist" , level = logging .DEBUG )
291
298
return True
292
299
else :
293
- self .log ("bosco_cluster -l failed with unexpected exit code %d" % returncode , level = logging .ERROR )
300
+ self .log ("%s failed with unexpected exit code %d" , " " . join ( cmd ), returncode , level = logging .ERROR )
294
301
self .log ("stdout:\n %s" % stdout , level = logging .ERROR )
295
302
self .log ("stderr:\n %s" % stderr , level = logging .ERROR )
296
303
return False
297
304
298
305
# Run bosco cluster to install the remote cluster
299
- install_cmd = [" bosco_cluster" ]
306
+ install_cmd = [self . bosco_cluster ]
300
307
override_dir = self .opt_val ('override_dir' )
301
308
if override_dir :
302
309
install_cmd += ['-o' , override_dir ]
0 commit comments