Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 4e7067f

Browse files
committed
Use the SSHExecutor available via core_lib
Remove repeated modules and use the most updated one. The version available in `core_lib` allows the application to authenticate SSH sessions using `gssapi-with-mic`. Signed-off-by: Geovanny González-Rodríguez <geovanny.gonzalez@cern.ch>
1 parent 10b0582 commit 4e7067f

2 files changed

Lines changed: 11 additions & 156 deletions

File tree

local/controller.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@
1111
import json
1212
from multiprocessing import Manager
1313
from mongodb_database import Database
14-
from local.ssh_executor import SSHExecutor
14+
from core_lib.utils.ssh_executor import SSHExecutor
1515
from local.relmon import RelMon
1616
from local.file_creator import FileCreator
1717
from local.email_sender import EmailSender
1818
from environment import (
19+
SUBMISSION_HOST,
20+
SERVICE_ACCOUNT_USERNAME,
21+
SERVICE_ACCOUNT_PASSWORD,
1922
SERVICE_URL,
2023
REPORTS_URL,
2124
REMOTE_DIRECTORY,
@@ -55,7 +58,11 @@ def set_config(self):
5558
if self.remote_directory[-1] == "/":
5659
self.remote_directory = self.remote_directory[:-1]
5760

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+
)
5966
self.file_creator = FileCreator()
6067
self.email_sender = EmailSender()
6168
self.service_url = SERVICE_URL
@@ -328,7 +335,7 @@ def __submit_to_condor(self, relmon, database):
328335
# Run condor_submit
329336
# Submission happens through lxplus as condor is not available on website machine
330337
# 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(
332339
[
333340
"cd %s" % (remote_relmon_directory),
334341
"voms-proxy-init -voms cms --valid 24:00 --out $(pwd)/proxy.txt",
@@ -370,7 +377,7 @@ def __check_if_running(self, relmon, database):
370377
self.logger.info(
371378
"Will check if %s is running in HTCondor, id: %s", relmon, relmon_condor_id
372379
)
373-
stdout, stderr = self.ssh_executor.execute_command(
380+
stdout, stderr, _ = self.ssh_executor.execute_command(
374381
"module load %s && condor_q -af:h ClusterId JobStatus | "
375382
"grep %s" % (HTCONDOR_MODULE, relmon_condor_id)
376383
)

local/ssh_executor.py

Lines changed: 0 additions & 152 deletions
This file was deleted.

0 commit comments

Comments
 (0)