Skip to content
Permalink
Browse files

Fix JENKINS-19222

Make setting the NODE_NAME similar to what core does.
  • Loading branch information...
slide authored and Alex Earl committed Feb 4, 2015
1 parent de93818 commit 63389901c85ba6c1a903e25df5fe3f815e4c1b36
@@ -4,6 +4,7 @@
import hudson.Util;
import hudson.matrix.MatrixRun;
import hudson.model.*;
import hudson.model.Hudson.MasterComputer;
import hudson.util.LogTaskListener;
import org.jenkinsci.lib.envinject.EnvInjectException;
import org.jenkinsci.lib.envinject.EnvInjectLogger;
@@ -40,9 +41,14 @@
//test if there is at least one executor
if (computer != null) {
result = computer.getEnvironment().overrideAll(result);
if(computer instanceof MasterComputer) {
result.put("NODE_NAME", "master");
} else {
result.put("NODE_NAME", computer.getName());
}

Node n = computer.getNode();
if (n != null) {
result.put("NODE_NAME", computer.getName());
result.put("NODE_LABELS", Util.join(n.getAssignedLabels(), " "));
}
}

0 comments on commit 6338990

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