|
11 | 11 | import json |
12 | 12 | from multiprocessing import Manager |
13 | 13 | from mongodb_database import Database |
14 | | -from local.ssh_executor import SSHExecutor |
| 14 | +from core_lib.utils.ssh_executor import SSHExecutor |
15 | 15 | from local.relmon import RelMon |
16 | 16 | from local.file_creator import FileCreator |
17 | 17 | from local.email_sender import EmailSender |
18 | 18 | from environment import ( |
| 19 | + SUBMISSION_HOST, |
| 20 | + SERVICE_ACCOUNT_USERNAME, |
| 21 | + SERVICE_ACCOUNT_PASSWORD, |
19 | 22 | SERVICE_URL, |
20 | 23 | REPORTS_URL, |
21 | 24 | REMOTE_DIRECTORY, |
@@ -55,7 +58,11 @@ def set_config(self): |
55 | 58 | if self.remote_directory[-1] == "/": |
56 | 59 | self.remote_directory = self.remote_directory[:-1] |
57 | 60 |
|
58 | | - self.ssh_executor = SSHExecutor() |
| 61 | + self.ssh_executor = SSHExecutor( |
| 62 | + host=SUBMISSION_HOST, |
| 63 | + username=SERVICE_ACCOUNT_USERNAME, |
| 64 | + password=SERVICE_ACCOUNT_PASSWORD |
| 65 | + ) |
59 | 66 | self.file_creator = FileCreator() |
60 | 67 | self.email_sender = EmailSender() |
61 | 68 | self.service_url = SERVICE_URL |
@@ -328,7 +335,7 @@ def __submit_to_condor(self, relmon, database): |
328 | 335 | # Run condor_submit |
329 | 336 | # Submission happens through lxplus as condor is not available on website machine |
330 | 337 | # It is easier to ssh to lxplus than set up condor locally |
331 | | - stdout, stderr = self.ssh_executor.execute_command( |
| 338 | + stdout, stderr, _ = self.ssh_executor.execute_command( |
332 | 339 | [ |
333 | 340 | "cd %s" % (remote_relmon_directory), |
334 | 341 | "voms-proxy-init -voms cms --valid 24:00 --out $(pwd)/proxy.txt", |
@@ -370,7 +377,7 @@ def __check_if_running(self, relmon, database): |
370 | 377 | self.logger.info( |
371 | 378 | "Will check if %s is running in HTCondor, id: %s", relmon, relmon_condor_id |
372 | 379 | ) |
373 | | - stdout, stderr = self.ssh_executor.execute_command( |
| 380 | + stdout, stderr, _ = self.ssh_executor.execute_command( |
374 | 381 | "module load %s && condor_q -af:h ClusterId JobStatus | " |
375 | 382 | "grep %s" % (HTCONDOR_MODULE, relmon_condor_id) |
376 | 383 | ) |
|
0 commit comments