Skip to content

Commit

Permalink
Update EC2Cloud.java
Browse files Browse the repository at this point in the history
More consistent name
  • Loading branch information
thoulen committed Apr 8, 2019
1 parent 0400ded commit 1ec5220
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/hudson/plugins/ec2/EC2Cloud.java
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,11 @@ public HttpResponse doProvision(@QueryParameter String template) throws ServletE
throw HttpResponses.error(SC_BAD_REQUEST, "No such template: " + template);
}

final Jenkins instance = Jenkins.getInstance();
if (instance.isQuietingDown()) {
final Jenkins jenkinsInstance = Jenkins.getInstance();
if (jenkinsInstance.isQuietingDown()) {
throw HttpResponses.error(SC_BAD_REQUEST, "Jenkins instance is quieting down");
}
if (instance.isTerminating()) {
if (jenkinsInstance.isTerminating()) {
throw HttpResponses.error(SC_BAD_REQUEST, "Jenkins instance is terminating");
}
try {
Expand All @@ -356,7 +356,7 @@ public HttpResponse doProvision(@QueryParameter String template) throws ServletE
if (nodes.get(0).getStopOnTerminate() && c != null) {
c.connect(false);
}
instance.addNode(nodes.get(0));
jenkinsInstance.addNode(nodes.get(0));

return HttpResponses.redirectViaContextPath("/computer/" + nodes.get(0).getNodeName());
} catch (AmazonClientException e) {
Expand Down

0 comments on commit 1ec5220

Please sign in to comment.