Skip to content

Commit

Permalink
Update elastic_lb.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Collins authored Oct 25, 2016
1 parent 38db107 commit 591833a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions providers/elastic_lb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
action :register do
converge_by("add the node #{new_resource.name} to ELB") do
target_lb = elb.describe_load_balancers[:load_balancer_descriptions].find { |lb| lb[:load_balancer_name] == new_resource.name }
unless target_lb[:instances].detect { |instances| instances.include?(instance_id) }
unless target_lb[:instances].detect { |instance| instance.instance_id == instance_id }
Chef::Log.info("Adding node to ELB #{new_resource.name}")
elb.register_instances_with_load_balancer(load_balancer_name: new_resource.name, instances: [{ instance_id: instance_id }])
else
Expand All @@ -15,7 +15,7 @@
action :deregister do
converge_by("remove the node #{new_resource.name} from ELB") do
target_lb = elb.describe_load_balancers[:load_balancer_descriptions].find { |lb| lb[:load_balancer_name] == new_resource.name }
if target_lb[:instances].detect { |instances| instances.include?(instance_id) }
if target_lb[:instances].detect { |instance| instance.instance_id == instance_id }
Chef::Log.info("Removing node from ELB #{new_resource.name}")
elb.deregister_instances_from_load_balancer(load_balancer_name: new_resource.name, instances: [{ instance_id: instance_id }])
else
Expand Down

0 comments on commit 591833a

Please sign in to comment.