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
@@ -234,7 +234,8 @@ def Custom_Command(HTML, node, command):
def Custom_Script(HTML, node, script):
logging.info(f"Executing custom script on {node}")
ret = cls_cmd.runScript(node, script, 90)
with cls_cmd.getConnection(node) as c:
ret = c.exec_script(script, 90)
logging.debug(f"Custom_Script: {script} on node: {node} - return code {ret.returncode}, output:\n{ret.stdout}")
status = 'OK'
message = [ret.stdout]