I'm trying to change the (manually assigned) labels for a node in Groovy. I found I could get the labels with getLabelString(). So it seemed logical that I could use hudson.model.Node.setLabelString(String string) to assign a new set of labels, just as if I had gone into the configure page for the node and altered the labels. But it doesn't seem that easy. When I try to execute setLabelString(myNewLabelString) I get an error:

groovy.lang.MissingMethodException: No signature of method: 
hudson.slaves.DumbSlave.setLabelString() is applicable for argument types: 
(java.lang.String) values: [installanywhere]
Possible solutions: getLabelString(), getLabelString()


The error message doesn't make sense to me because the method hudson.slaves.DumbSlave.setLabelString() does take an argument of type java.lang.String. But I'm also getting the feeling that I'm going down the wrong path, at least according to this posting <http://stackoverflow.com/questions/8823443/jenkins-hudson-cli-api-to-modify-the-node-labels-using-groovy> on stackoverflow. If we had a more recent version of Jenkins (we're still on 1.466.2) I guess I could edit the config.xml and post the modified xml (see https://issues.jenkins-ci.org/browse/JENKINS-3265) <https://issues.jenkins-ci.org/browse/JENKINS-3265>. Any other ideas out there?

Thanks,
Eric
<https://issues.jenkins-ci.org/browse/JENKINS-3265>

--
You received this message because you are subscribed to the Google Groups "Jenkins 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to