Skip to content
Permalink
Browse files

[FIXED JENKINS-12226] Triggering a build with 'Current build paramete…

…rs' fails when the current build parameters includes a node name
  • Loading branch information...
imod committed Feb 25, 2012
1 parent 5f181a3 commit af9c2220c3b089cdd3f5631446b2c7e136419f21
Showing with 13 additions and 11 deletions.
  1. +13 −11 src/main/java/org/jvnet/jenkins/plugins/nodelabelparameter/NodeParameterValue.java
@@ -79,17 +79,19 @@ public BuildWrapper createBuildWrapper(AbstractBuild<?, ?> build) {
build.addAction(new LabelBadgeAction(getLabel(), Messages.LabelBadgeAction_node_tooltip(getLabel())));

final ParametersDefinitionProperty property = build.getProject().getProperty(hudson.model.ParametersDefinitionProperty.class);
final List<ParameterDefinition> parameterDefinitions = property.getParameterDefinitions();
for (ParameterDefinition paramDef : parameterDefinitions) {
if (paramDef instanceof NodeParameterDefinition) {
final NodeParameterDefinition nodeParameterDefinition = (NodeParameterDefinition) paramDef;
if (nodeParameterDefinition.getAllowMultiNodeSelection()) {
// we expect only one node parameter definition per job
return new TriggerNextBuildWrapper(nodeParameterDefinition);
} else {
return null;
}
}
if (property != null) {
final List<ParameterDefinition> parameterDefinitions = property.getParameterDefinitions();
for (ParameterDefinition paramDef : parameterDefinitions) {
if (paramDef instanceof NodeParameterDefinition) {
final NodeParameterDefinition nodeParameterDefinition = (NodeParameterDefinition) paramDef;
if (nodeParameterDefinition.getAllowMultiNodeSelection()) {
// we expect only one node parameter definition per job
return new TriggerNextBuildWrapper(nodeParameterDefinition);
} else {
return null;
}
}
}
}
return null;
}

0 comments on commit af9c222

Please sign in to comment.
You can’t perform that action at this time.