diff --git a/core/src/main/java/hudson/model/Hudson.java b/core/src/main/java/hudson/model/Hudson.java index ec6b5c743c..c6de37ab4d 100644 --- a/core/src/main/java/hudson/model/Hudson.java +++ b/core/src/main/java/hudson/model/Hudson.java @@ -2169,13 +2169,13 @@ public final class Hudson extends Node implements ItemGroup, Stapl } } - numExecutors = Integer.parseInt(req.getParameter("numExecutors")); + numExecutors = Integer.parseInt(req.getParameter("_.numExecutors")); if(req.hasParameter("master.mode")) mode = Mode.valueOf(req.getParameter("master.mode")); else mode = Mode.NORMAL; - label = Util.fixNull(req.getParameter("label")); + label = Util.fixNull(req.getParameter("_.labelString")); labelSet=null; quietPeriod = Integer.parseInt(req.getParameter("quiet_period")); diff --git a/core/src/main/java/hudson/model/Node.java b/core/src/main/java/hudson/model/Node.java index f83887a575..0325e77107 100644 --- a/core/src/main/java/hudson/model/Node.java +++ b/core/src/main/java/hudson/model/Node.java @@ -137,6 +137,12 @@ public abstract class Node extends AbstractModelObject implements Describable getAssignedLabels(); + /** + * The same as {@link #getAssignedLabels()} but returns labels as a single text. + * Mainly for form binding. + */ + public abstract String getLabelString(); + /* * Returns the possibly empty set of labels that it has been determined as supported by this node. * @see hudson.tasks.LabelFinder diff --git a/core/src/main/java/hudson/model/Slave.java b/core/src/main/java/hudson/model/Slave.java index 29bd59808f..7442ae4d7d 100644 --- a/core/src/main/java/hudson/model/Slave.java +++ b/core/src/main/java/hudson/model/Slave.java @@ -132,24 +132,24 @@ public abstract class Slave extends Node implements Serializable { @DataBoundConstructor public Slave(String name, String nodeDescription, String remoteFS, String numExecutors, - Mode mode, String label, ComputerLauncher launcher, RetentionStrategy retentionStrategy, List> nodeProperties) throws FormException, IOException { - this(name,nodeDescription,remoteFS,Util.tryParseNumber(numExecutors, 1).intValue(),mode,label,launcher,retentionStrategy, nodeProperties); + Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy retentionStrategy, List> nodeProperties) throws FormException, IOException { + this(name,nodeDescription,remoteFS,Util.tryParseNumber(numExecutors, 1).intValue(),mode,labelString,launcher,retentionStrategy, nodeProperties); } @Deprecated public Slave(String name, String nodeDescription, String remoteFS, int numExecutors, - Mode mode, String label, ComputerLauncher launcher, RetentionStrategy retentionStrategy) throws FormException, IOException { - this(name, nodeDescription, remoteFS, numExecutors, mode, label, launcher, retentionStrategy, new ArrayList()); + Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy retentionStrategy) throws FormException, IOException { + this(name, nodeDescription, remoteFS, numExecutors, mode, labelString, launcher, retentionStrategy, new ArrayList()); } public Slave(String name, String nodeDescription, String remoteFS, int numExecutors, - Mode mode, String label, ComputerLauncher launcher, RetentionStrategy retentionStrategy, List> nodeProperties) throws FormException, IOException { + Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy retentionStrategy, List> nodeProperties) throws FormException, IOException { this.name = name; this.description = nodeDescription; this.numExecutors = numExecutors; this.mode = mode; this.remoteFS = remoteFS; - this.label = Util.fixNull(label).trim(); + this.label = Util.fixNull(labelString).trim(); this.launcher = launcher; this.retentionStrategy = retentionStrategy; getAssignedLabels(); // compute labels now diff --git a/core/src/main/java/hudson/slaves/DumbSlave.java b/core/src/main/java/hudson/slaves/DumbSlave.java index 165309b8bb..8b8c24cc06 100644 --- a/core/src/main/java/hudson/slaves/DumbSlave.java +++ b/core/src/main/java/hudson/slaves/DumbSlave.java @@ -44,13 +44,13 @@ public final class DumbSlave extends Slave { * @deprecated as of 1.286. * Use {@link #DumbSlave(String, String, String, String, Mode, String, ComputerLauncher, RetentionStrategy, List)} */ - public DumbSlave(String name, String nodeDescription, String remoteFS, String numExecutors, Mode mode, String label, ComputerLauncher launcher, RetentionStrategy retentionStrategy) throws FormException, IOException { - this(name, nodeDescription, remoteFS, numExecutors, mode, label, launcher, retentionStrategy, new ArrayList()); + public DumbSlave(String name, String nodeDescription, String remoteFS, String numExecutors, Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy retentionStrategy) throws FormException, IOException { + this(name, nodeDescription, remoteFS, numExecutors, mode, labelString, launcher, retentionStrategy, new ArrayList()); } @DataBoundConstructor - public DumbSlave(String name, String nodeDescription, String remoteFS, String numExecutors, Mode mode, String label, ComputerLauncher launcher, RetentionStrategy retentionStrategy, List> nodeProperties) throws IOException, FormException { - super(name, nodeDescription, remoteFS, numExecutors, mode, label, launcher, retentionStrategy, nodeProperties); + public DumbSlave(String name, String nodeDescription, String remoteFS, String numExecutors, Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy retentionStrategy, List> nodeProperties) throws IOException, FormException { + super(name, nodeDescription, remoteFS, numExecutors, mode, labelString, launcher, retentionStrategy, nodeProperties); } @Extension diff --git a/core/src/main/resources/hudson/model/Hudson/configure.jelly b/core/src/main/resources/hudson/model/Hudson/configure.jelly index 50afca351b..6ce4d9badc 100644 --- a/core/src/main/resources/hudson/model/Hudson/configure.jelly +++ b/core/src/main/resources/hudson/model/Hudson/configure.jelly @@ -43,8 +43,8 @@ THE SOFTWARE. - - + + diff --git a/war/resources/help/system-config/master-slave/label.html b/core/src/main/resources/hudson/model/Node/help-labelString.html similarity index 100% rename from war/resources/help/system-config/master-slave/label.html rename to core/src/main/resources/hudson/model/Node/help-labelString.html diff --git a/war/resources/help/system-config/master-slave/label_de.html b/core/src/main/resources/hudson/model/Node/help-labelString_de.html similarity index 100% rename from war/resources/help/system-config/master-slave/label_de.html rename to core/src/main/resources/hudson/model/Node/help-labelString_de.html diff --git a/war/resources/help/system-config/master-slave/label_fr.html b/core/src/main/resources/hudson/model/Node/help-labelString_fr.html similarity index 100% rename from war/resources/help/system-config/master-slave/label_fr.html rename to core/src/main/resources/hudson/model/Node/help-labelString_fr.html diff --git a/war/resources/help/system-config/master-slave/label_ja.html b/core/src/main/resources/hudson/model/Node/help-labelString_ja.html similarity index 100% rename from war/resources/help/system-config/master-slave/label_ja.html rename to core/src/main/resources/hudson/model/Node/help-labelString_ja.html diff --git a/war/resources/help/system-config/master-slave/label_pt_BR.html b/core/src/main/resources/hudson/model/Node/help-labelString_pt_BR.html similarity index 100% rename from war/resources/help/system-config/master-slave/label_pt_BR.html rename to core/src/main/resources/hudson/model/Node/help-labelString_pt_BR.html diff --git a/war/resources/help/system-config/master-slave/label_ru.html b/core/src/main/resources/hudson/model/Node/help-labelString_ru.html similarity index 100% rename from war/resources/help/system-config/master-slave/label_ru.html rename to core/src/main/resources/hudson/model/Node/help-labelString_ru.html diff --git a/war/resources/help/system-config/master-slave/label_tr.html b/core/src/main/resources/hudson/model/Node/help-labelString_tr.html similarity index 100% rename from war/resources/help/system-config/master-slave/label_tr.html rename to core/src/main/resources/hudson/model/Node/help-labelString_tr.html diff --git a/war/resources/help/system-config/master-slave/remoteFS.html b/core/src/main/resources/hudson/model/Slave/help-remoteFS.html similarity index 100% rename from war/resources/help/system-config/master-slave/remoteFS.html rename to core/src/main/resources/hudson/model/Slave/help-remoteFS.html diff --git a/war/resources/help/system-config/master-slave/remoteFS_de.html b/core/src/main/resources/hudson/model/Slave/help-remoteFS_de.html similarity index 100% rename from war/resources/help/system-config/master-slave/remoteFS_de.html rename to core/src/main/resources/hudson/model/Slave/help-remoteFS_de.html diff --git a/war/resources/help/system-config/master-slave/remoteFS_fr.html b/core/src/main/resources/hudson/model/Slave/help-remoteFS_fr.html similarity index 100% rename from war/resources/help/system-config/master-slave/remoteFS_fr.html rename to core/src/main/resources/hudson/model/Slave/help-remoteFS_fr.html diff --git a/war/resources/help/system-config/master-slave/remoteFS_ja.html b/core/src/main/resources/hudson/model/Slave/help-remoteFS_ja.html similarity index 100% rename from war/resources/help/system-config/master-slave/remoteFS_ja.html rename to core/src/main/resources/hudson/model/Slave/help-remoteFS_ja.html diff --git a/war/resources/help/system-config/master-slave/remoteFS_pt_BR.html b/core/src/main/resources/hudson/model/Slave/help-remoteFS_pt_BR.html similarity index 100% rename from war/resources/help/system-config/master-slave/remoteFS_pt_BR.html rename to core/src/main/resources/hudson/model/Slave/help-remoteFS_pt_BR.html diff --git a/war/resources/help/system-config/master-slave/remoteFS_ru.html b/core/src/main/resources/hudson/model/Slave/help-remoteFS_ru.html similarity index 100% rename from war/resources/help/system-config/master-slave/remoteFS_ru.html rename to core/src/main/resources/hudson/model/Slave/help-remoteFS_ru.html diff --git a/war/resources/help/system-config/master-slave/remoteFS_tr.html b/core/src/main/resources/hudson/model/Slave/help-remoteFS_tr.html similarity index 100% rename from war/resources/help/system-config/master-slave/remoteFS_tr.html rename to core/src/main/resources/hudson/model/Slave/help-remoteFS_tr.html diff --git a/core/src/main/resources/hudson/slaves/DumbSlave/configure-entries.jelly b/core/src/main/resources/hudson/slaves/DumbSlave/configure-entries.jelly index 3515e37a22..74aedc7a45 100644 --- a/core/src/main/resources/hudson/slaves/DumbSlave/configure-entries.jelly +++ b/core/src/main/resources/hudson/slaves/DumbSlave/configure-entries.jelly @@ -35,12 +35,12 @@ THE SOFTWARE. - - + + - - + + diff --git a/core/src/test/java/hudson/slaves/NodeListTest.java b/core/src/test/java/hudson/slaves/NodeListTest.java index 3916cdf8a2..f3282aa392 100644 --- a/core/src/test/java/hudson/slaves/NodeListTest.java +++ b/core/src/test/java/hudson/slaves/NodeListTest.java @@ -82,6 +82,10 @@ public class NodeListTest extends TestCase { throw new UnsupportedOperationException(); } + public String getLabelString() { + throw new UnsupportedOperationException(); + } + public Set