Navigation Menu

Skip to content

Commit

Permalink
Favor the new style of form submission over the legacy form to fix: J…
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmoor committed Dec 2, 2014
1 parent cee1501 commit 15a24dd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions core/src/main/java/hudson/model/AbstractProject.java
Expand Up @@ -1836,13 +1836,14 @@ protected void submit(StaplerRequest req, StaplerResponse rsp) throws IOExceptio
else
scmCheckoutStrategy = null;

if(req.hasParameter("_.assignedLabelString")) {
if(json.optBoolean("hasSlaveAffinity", json.has("label"))) {
assignedNode = Util.fixEmptyAndTrim(json.optString("label"));
} else if(req.hasParameter("_.assignedLabelString")) {
// Workaround for JENKINS-25372 while plugin is being updated.
// Keep this condition second for JENKINS-25533
LOGGER.log(Level.WARNING, "label assignment is using legacy '_.assignedLabelString'");
assignedNode = Util.fixEmptyAndTrim(req.getParameter("_.assignedLabelString"));
} else if(json.optBoolean("hasSlaveAffinity", json.has("label"))) {
assignedNode = Util.fixEmptyAndTrim(json.optString("label"));
} else {
} else {
assignedNode = null;
}
canRoam = assignedNode==null;
Expand Down

0 comments on commit 15a24dd

Please sign in to comment.