Add node description to event data

There may be interesting information in the node description.  With
Ia4fc671ecb60581be258346afc23125749ba8f15 we are adding nodepool
metadata to the description field.

Change-Id: I95f87d60959e428d888e77de48e9acca0e34b233
This commit is contained in:
James E. Blair 2016-04-04 09:52:50 -07:00
parent dd56aff16a
commit 3ef6c4a112
2 changed files with 15 additions and 0 deletions

View File

@ -24,6 +24,7 @@ import hudson.model.ParametersAction;
import hudson.model.Run; import hudson.model.Run;
import hudson.model.Executor; import hudson.model.Executor;
import hudson.model.Computer; import hudson.model.Computer;
import hudson.model.Node;
import hudson.model.TaskListener; import hudson.model.TaskListener;
import jenkins.model.Jenkins; import jenkins.model.Jenkins;
@ -79,6 +80,10 @@ public enum Phase {
Computer computer = executor.getOwner(); Computer computer = executor.getOwner();
if (computer != null) { if (computer != null) {
buildState.setNodeName(computer.getName()); buildState.setNodeName(computer.getName());
Node node = computer.getNode();
if (node != null) {
buildState.setNodeDescription(node.getNodeDescription());
}
} }
} }

View File

@ -36,6 +36,8 @@ public class BuildState {
private String nodeName; private String nodeName;
private String nodeDescription;
private String hostName; private String hostName;
public int getNumber() { public int getNumber() {
@ -94,6 +96,14 @@ public class BuildState {
this.nodeName = nodeName; this.nodeName = nodeName;
} }
public String getNodeDescription() {
return nodeDescription;
}
public void setNodeDescription(String nodeDescription) {
this.nodeDescription = nodeDescription;
}
public String getHostName() { public String getHostName() {
return hostName; return hostName;
} }