Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #1252 from daniel-beck/JENKINS-17114
[FIX JENKINS-17114] Distinguish 'nodes offline' from 'no nodes'
  • Loading branch information
daniel-beck committed Jun 1, 2014
2 parents b152037 + 5aa32c8 commit a63606d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
6 changes: 5 additions & 1 deletion core/src/main/java/hudson/model/queue/CauseOfBlockage.java
Expand Up @@ -114,7 +114,11 @@ public BecauseLabelIsOffline(Label l) {
}

public String getShortDescription() {
return Messages.Queue_AllNodesOffline(label.getName());
if (label.isEmpty()) {
return Messages.Queue_LabelHasNoNodes(label.getName());
} else {
return Messages.Queue_AllNodesOffline(label.getName());
}
}
}

Expand Down
1 change: 1 addition & 0 deletions core/src/main/resources/hudson/model/Messages.properties
Expand Up @@ -189,6 +189,7 @@ Label.ProvisionedFrom=Provisioned from {0}
ManageJenkinsAction.DisplayName=Manage Jenkins
MultiStageTimeSeries.EMPTY_STRING=
Queue.AllNodesOffline=All nodes of label \u2018{0}\u2019 are offline
Queue.LabelHasNoNodes=There are no nodes with the label \u2018{0}\u2019
Queue.BlockedBy=Blocked by {0}
Queue.HudsonIsAboutToShutDown=Jenkins is about to shut down
Queue.InProgress=A build is already in progress
Expand Down
Expand Up @@ -24,9 +24,20 @@ THE SOFTWARE.

<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt">
<st:structuredMessageFormat key="description">
<st:structuredMessageArgument>
<a href="${rootURL}/label/${it.label.name}" class="model-link">${it.label.name}</a>
</st:structuredMessageArgument>
</st:structuredMessageFormat>
<j:choose>
<j:when test="${it.label.isEmpty()}">
<st:structuredMessageFormat key="description_no_nodes">
<st:structuredMessageArgument>
<a href="${rootURL}/label/${it.label.name}" class="model-link">${it.label.name}</a>
</st:structuredMessageArgument>
</st:structuredMessageFormat>
</j:when>
<j:otherwise>
<st:structuredMessageFormat key="description">
<st:structuredMessageArgument>
<a href="${rootURL}/label/${it.label.name}" class="model-link">${it.label.name}</a>
</st:structuredMessageArgument>
</st:structuredMessageFormat>
</j:otherwise>
</j:choose>
</j:jelly>
Expand Up @@ -21,4 +21,5 @@
# THE SOFTWARE.

# note for translators: this message is referenced from st:structuredMessageFormat
description=All nodes of label \u2018{0}\u2019 are offline
description=All nodes of label \u2018{0}\u2019 are offline
description_no_nodes=There are no nodes with the label \u2018{0}\u2019

0 comments on commit a63606d

Please sign in to comment.