CI: Harmonize exec_script() API

Instead of making the function a class member, make it an instance
member because (1) it is more aligned with other functions, notably,
run(), and (2) especially for RemoteCmd() it can be faster, as
successive exec_script() calls do not require a new SSH connection.
This commit is contained in:
Robert Schmidt
2025-09-10 16:43:16 +02:00
parent 582aeac496
commit dd3ecbcf38
6 changed files with 25 additions and 25 deletions
+2 -1
View File
@@ -426,7 +426,8 @@ class Cluster:
logging.debug(f'Running physims from server: {node}')
script = "scripts/oc-deploy-physims.sh"
options = f"oaicicd-core-for-ci-ran {oc_release} {image_tag} {self.eNBSourceCodePath}"
ret = cls_cmd.runScript(node, script, 600, options)
with cls_cmd.getConnection(node) as c:
ret = c.exec_script(script, 600, options)
logging.debug(f'"{script}" finished with code {ret.returncode}, output:\n{ret.stdout}')
with cls_cmd.getConnection(node) as ssh:
details_json = archiveArtifact(ssh, ctx, f'{self.eNBSourceCodePath}/ci-scripts/{oc_release}-tests.json')