
// Configure Slaves
def create_slave_node = { instance, name, remoteFS, numExecutors, labelString, sshHost, sshPort, sshCredentials, userId ->
    def myLauncher = new hudson.plugins.sshslaves.SSHLauncher(sshHost, sshPort.toInteger(), sshCredentials, null, null, null, null, 0, 0, 0);
    def slave = new hudson.slaves.DumbSlave(name,
                              '',
                              remoteFS,
                              numExecutors,
                              hudson.model.Node.Mode.EXCLUSIVE,
                              labelString,
                              myLauncher,
                              new hudson.slaves.RetentionStrategy.Always())
    //def slave = new DumbSlave(name, remoteFS, myLauncher)
    //slave.setLabelString(labelString)
    //slave.setMode(Node.Mode.EXCLUSIVE)
    //slave.setNumExecutors(numExecutors.toInteger())
    //slave.setNodeProperties(new LinkedList())
    slave.setUserId(userId)
    instance.addNode(slave)
}

