HI Robin,
I tried your suggestion and this is my script
groovy:
for (agent in system.agentManager.buildAgents) {
logger.info("******************************************************")
def evalContext = ["pdu_ip":"${vars.getValue("pdu_ip")}",
"pdu_port":"${vars.getValue("pdu_port")}" ,
"number_of_pf":"2" ,
"gpio_ip":"${vars.getValue("gpio_ip")}",
"gpio_port":"${vars.getValue("gpio_port")}"]
logger.info(agent.ip)
logger.info(agent.hostName)
logger.info("gpio_ip = {} ", agent.userAttributes.get("gpio_board_ip"));
logger.info("gpio_port = {} ", agent.userAttributes.get("gpio_port"));
logger.info("pdu_ip = {} ", agent.userAttributes.get("pdu_ip"));
logger.info("pdu_port = {} ", agent.userAttributes.get("pdu_port"));
//def scriptRunOnAgent = "python /home/svjer/my_tests/Scripts/automation/ssh.py ${vars.getValue("pdu_ip")} ${vars.getValue("pdu_port")} 2 ${vars.getValue("gpio_ip")} ${vars.getValue("gpio_port")}"
def scriptRunOnAgent = '''
return "python /home/svjer/my_tests/Scripts/automation/ssh.py ".execute().text
'''
def output = node.nodeService.evalGroovyScript(scriptRunOnAgent, evalContext);
logger.info(output)
}
and i get this output
18:42:17,150 INFO - Executing pre-execute action...
18:42:17,150 INFO - Running step...
18:42:17,158 INFO - Checking step execute condition...
18:42:17,158 INFO - Step execute condition not satisfied, step will be skipped.
18:42:17,177 INFO - Checking step execute condition...
18:42:17,177 INFO - Step execute condition not satisfied, step will be skipped.
18:42:17,192 INFO - Checking step execute condition...
18:42:17,193 INFO - Step execute condition satisfied, executing...
18:42:17,307 INFO - Executing pre-execute action...
18:42:17,307 INFO - Running step...
18:42:17,326 INFO - ******************************************************
18:42:17,326 INFO - 10.12.234.244
18:42:17,326 INFO - Platform2
18:42:17,326 INFO - gpio_ip = 10.12.249.49
18:42:17,326 INFO - gpio_port = 4
18:42:17,326 INFO - pdu_ip = 10.12.235.3
18:42:17,326 INFO - pdu_port = 2
18:42:17,445 INFO -
18:42:17,445 INFO - ******************************************************
18:42:17,445 INFO - 10.12.234.70
18:42:17,445 INFO - Platform3
18:42:17,445 INFO - gpio_ip = 10.12.249.49
18:42:17,445 INFO - gpio_port = 1
18:42:17,445 INFO - pdu_ip = 10.12.235.3
18:42:17,445 INFO - pdu_port = 3
18:42:17,556 INFO -
18:42:17,556 INFO - Executing post-execute action...
18:42:17,698 INFO - Executing post-execute action...
the python script is not running
what is wrong with the command