Skip to content

Commit

Permalink
JENKINS-32584 ec2-plugin counts *every* instance (not just Jenkins sl…
Browse files Browse the repository at this point in the history
…ave instances) when counting slaves; incorrectly hits slave cap
  • Loading branch information
Francis Upton IV committed Jan 25, 2016
1 parent 97a840e commit f95e3d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/hudson/plugins/ec2/EC2Cloud.java
Expand Up @@ -279,8 +279,8 @@ private int countCurrentEC2Slaves(SlaveTemplate template) throws AmazonClientExc

for (Reservation r : connect().describeInstances().getReservations()) {
for (Instance i : r.getInstances()) {
if ((template == null
|| template.getAmi().equals(i.getImageId()) && isEc2ProvisionedAmiSlave(i.getTags(), description))) {
if (isEc2ProvisionedAmiSlave(i.getTags(), description) && (template == null
|| template.getAmi().equals(i.getImageId()))) {
InstanceStateName stateName = InstanceStateName.fromValue(i.getState().getName());
if (stateName != InstanceStateName.Terminated && stateName != InstanceStateName.ShuttingDown) {
LOGGER.log(Level.FINE, "Existing instance found: " + i.getInstanceId() + " AMI: " + i.getImageId()
Expand Down

0 comments on commit f95e3d5

Please sign in to comment.