From 591833a11ef54e72480ab0cb64ff353480716760 Mon Sep 17 00:00:00 2001 From: Aaron Collins Date: Mon, 24 Oct 2016 14:36:37 -1000 Subject: [PATCH] Update elastic_lb.rb --- providers/elastic_lb.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/providers/elastic_lb.rb b/providers/elastic_lb.rb index 9a1d68e1..413e5fbb 100644 --- a/providers/elastic_lb.rb +++ b/providers/elastic_lb.rb @@ -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 @@ -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