for (slave in hudson.model.Hudson.instance.slaves) {
if (slave.getNodeName() == "slave_need_to_be_lock") {
Computer c = slave.getComputer();
c.lock();
c.unlock();
}
}
for (slave in hudson.model.Hudson.instance.slaves) {
if (slave.getNodeName() == "slave_need_to_be_lock") {
Computer c = slave.getComputer();
c.disconnect(); //Just like lock;
c.connect(false); //Just like unlock;
}
}
1条答案
按热度按时间vlf7wbxs1#
我用下面的代码来实现它。
字符串