Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixes nested array bug when computing list of AZs for an ELB #221

Merged
merged 1 commit into from

2 participants

@nickmarden

This patch ensures that the list of availability zones to be added or removed from an ELB (computed by uniquifying the list of all AZs in which there are EC2 instances of interest) is an array, rather than an array of arrays.

It's a miracle the code ever worked as it was written.

@temujin9 temujin9 merged commit ec8595a into infochimps-labs:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/ironfan/provider/ec2/elastic_load_balancer.rb
View
4 lib/ironfan/provider/ec2/elastic_load_balancer.rb
@@ -101,8 +101,8 @@ def self.start_or_sync_elb(elb_name, computers, start_elb)
# Did the list of availability zones for this ELB change?
if availability_zones != elb.availability_zones.sort
Ironfan.step(elb.name, " updating availability zones to #{availability_zones.join(', ')}", :blue)
- to_add = [ availability_zones - elb.availability_zones ]
- to_remove = [ elb.availability_zones - availability_zones ]
+ to_add = availability_zones - elb.availability_zones
+ to_remove = elb.availability_zones - availability_zones
elb.enable_availability_zones(to_add) unless to_add.empty?
elb.disable_availability_zones(to_remove) unless to_remove.empty?
end
Something went wrong with that request. Please try again.