Created
November 6, 2015 17:41
-
-
Save makewhatis/41dd2d086b9cfcb83f92 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hudson = Hudson.instance | |
for (slave in hudson.slaves) { | |
def computer = slave.computer | |
if (slave.getComputer().isTemporarilyOffline()) { | |
if (!slave.getComputer().getOfflineCause().toString().contains("toggled by")) { | |
computer.setTemporarilyOffline(false, slave.getComputer().getOfflineCause()) | |
} | |
} else { | |
slave.computer.connect(true) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment