From c6fc4b44a0be93a962bcac9d66c7e5dc0c7584a5 Mon Sep 17 00:00:00 2001 From: Joshua Hoblitt Date: Tue, 29 Mar 2016 13:23:35 -0700 Subject: [PATCH 1/2] remove [oddly] duplicated import statements --- files/puppet_helper.groovy | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/files/puppet_helper.groovy b/files/puppet_helper.groovy index a75bc7c87..30f60e679 100644 --- a/files/puppet_helper.groovy +++ b/files/puppet_helper.groovy @@ -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 From 9ae2a6f218ff29bee3eb2dffe338f3cd7118f5ca Mon Sep 17 00:00:00 2001 From: Joshua Hoblitt Date: Tue, 29 Mar 2016 13:25:57 -0700 Subject: [PATCH 2/2] fix inconsistent indentation --- files/puppet_helper.groovy | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/files/puppet_helper.groovy b/files/puppet_helper.groovy index 30f60e679..b9dbc586b 100644 --- a/files/puppet_helper.groovy +++ b/files/puppet_helper.groovy @@ -855,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) } //////////////////////// @@ -867,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() } //////////////////////// @@ -879,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) } //////////////////////// @@ -891,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() } ///////////////////////// @@ -910,8 +910,8 @@ class Actions { catch (MissingMethodException me) { out.println("Found resource is not a job, skipping.") } - } - } // class Actions + } +} // class Actions /////////////////////////////////////////////////////////////////////////////// // CLI Argument Processing