CI: Extend Custom_Script to accept arguments
This commit is contained in:
committed by
Robert Schmidt
parent
1dca20ba85
commit
0d2212ca38
@@ -233,10 +233,10 @@ def Custom_Command(HTML, node, command):
|
|||||||
HTML.CreateHtmlTestRowQueue(command, status, message)
|
HTML.CreateHtmlTestRowQueue(command, status, message)
|
||||||
return status == 'OK' or status == 'Warning'
|
return status == 'OK' or status == 'Warning'
|
||||||
|
|
||||||
def Custom_Script(HTML, node, script):
|
def Custom_Script(HTML, node, script, args):
|
||||||
logging.info(f"Executing custom script on {node}")
|
logging.info(f"Executing custom script on {node}")
|
||||||
with cls_cmd.getConnection(node) as c:
|
with cls_cmd.getConnection(node) as c:
|
||||||
ret = c.exec_script(script, 90)
|
ret = c.exec_script(script, 90, args)
|
||||||
logging.debug(f"Custom_Script: {script} on node: {node} - return code {ret.returncode}, output:\n{ret.stdout}")
|
logging.debug(f"Custom_Script: {script} on node: {node} - return code {ret.returncode}, output:\n{ret.stdout}")
|
||||||
status = 'OK'
|
status = 'OK'
|
||||||
message = [ret.stdout]
|
message = [ret.stdout]
|
||||||
|
|||||||
+2
-1
@@ -328,9 +328,10 @@ def ExecuteActionWithParam(action, ctx):
|
|||||||
elif action == 'Custom_Script':
|
elif action == 'Custom_Script':
|
||||||
node = test.findtext('node')
|
node = test.findtext('node')
|
||||||
script = test.findtext('script')
|
script = test.findtext('script')
|
||||||
|
args = test.findtext('args')
|
||||||
# Allow referencing repository workspace path in XML via %%workspace%%
|
# Allow referencing repository workspace path in XML via %%workspace%%
|
||||||
script = script.replace("%%workspace%%", CONTAINERS.eNBSourceCodePath)
|
script = script.replace("%%workspace%%", CONTAINERS.eNBSourceCodePath)
|
||||||
success = cls_oaicitest.Custom_Script(HTML, node, script)
|
success = cls_oaicitest.Custom_Script(HTML, node, script, args)
|
||||||
|
|
||||||
elif action == 'Pull_Cluster_Image':
|
elif action == 'Pull_Cluster_Image':
|
||||||
tag_prefix = test.findtext('tag_prefix') or ""
|
tag_prefix = test.findtext('tag_prefix') or ""
|
||||||
|
|||||||
Reference in New Issue
Block a user