Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

minor puppet_helper.groovy cleanup #543

Merged
merged 2 commits into from
Mar 30, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 20 additions & 24 deletions files/puppet_helper.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,18 @@
// limitations under the License.

import com.cloudbees.jenkins.plugins.sshcredentials.impl.*
import com.cloudbees.jenkins.plugins.sshcredentials.impl.*;
import com.cloudbees.plugins.credentials.*
import com.cloudbees.plugins.credentials.*;
import com.cloudbees.plugins.credentials.common.*
import com.cloudbees.plugins.credentials.domains.*
import com.cloudbees.plugins.credentials.domains.*;
import com.cloudbees.plugins.credentials.impl.*
import com.cloudbees.plugins.credentials.impl.*;
import hudson.plugins.sshslaves.*;
import jenkins.model.*;
import org.jenkinsci.plugins.*;
import jenkins.security.*;
import hudson.util.*;
import hudson.model.*;
import groovy.transform.InheritConstructors
import hudson.model.*
import hudson.plugins.sshslaves.*
import hudson.util.*
import jenkins.model.*
import jenkins.security.*
import org.apache.commons.io.IOUtils
import org.jenkinsci.plugins.*

class InvalidAuthenticationStrategy extends Exception{}
@InheritConstructors
Expand Down Expand Up @@ -859,9 +855,9 @@ class Actions {
* Print the number of executors for the master
*/
void get_num_executors() {
def j = Jenkins.getInstance()
def n = j.getNumExecutors()
out.println(n)
def j = Jenkins.getInstance()
def n = j.getNumExecutors()
out.println(n)
}

////////////////////////
Expand All @@ -871,9 +867,9 @@ class Actions {
* Set the number of executors for the master
*/
void set_num_executors(String n) {
def j = Jenkins.getInstance()
j.setNumExecutors(n.toInteger())
j.save()
def j = Jenkins.getInstance()
j.setNumExecutors(n.toInteger())
j.save()
}

////////////////////////
Expand All @@ -883,9 +879,9 @@ class Actions {
* Print the portnumber of the slave agent
*/
void get_slaveagent_port() {
def j = Jenkins.getInstance()
def n = j.getSlaveAgentPort()
out.println(n)
def j = Jenkins.getInstance()
def n = j.getSlaveAgentPort()
out.println(n)
}

////////////////////////
Expand All @@ -895,9 +891,9 @@ class Actions {
* Set the portnumber of the slave agent
*/
void set_slaveagent_port(String n) {
def j = Jenkins.getInstance()
j.setSlaveAgentPort(n.toInteger())
j.save()
def j = Jenkins.getInstance()
j.setSlaveAgentPort(n.toInteger())
j.save()
}

/////////////////////////
Expand All @@ -914,8 +910,8 @@ class Actions {
catch (MissingMethodException me) {
out.println("Found resource is not a job, skipping.")
}
}
} // class Actions
}
} // class Actions

///////////////////////////////////////////////////////////////////////////////
// CLI Argument Processing
Expand Down