|
|
|
[
Permlink
| « Hide
]
Phong Trinh [20/Jul/16 04:44 PM]
It works. Thank you very much.
My fault, please use below script:
groovy: def attributes = step.parent.node.userAttributes; attributes["active"] = "yes"; step.parent.node.setUserAttributes(attributes); Thank you for promptly response.
I got: 14:09:03,272 ERROR - Step 'master>seq>set Attr' is failed: java.lang.NullPointerException: Cannot get property 'node' on null object Looks like the issue is with def attributes = parent.node.userAttributes; QB does not expect the node to be restarted during use. A workaround is to wrap your ordinary steps under a sequential step, together with two additional steps. Taking step1 for instance, add a sequential step seq1 with node selection setting specified as requiring resource "Pool1", and add below children:
1. the original step1, but set its node selection setting as "run on parent node" 2. add a step "remove from pool" running on server node executing below script: groovy: def attributes = parent.node.userAttributes; attributes["active"] = "yes"; parent.node.setUserAttributes(attributes); 3. add a step "revert node" and set its node selection setting as "run on parent node", and have it execute the node reverting logic Also make sure to modify Pool1 to add another constraint of only selecting node with attribute "active" defined as "yes". This way you can exclude the node from Pool1 before it is reverted. |