From 7f32c06c359a12d510db2b6493f593c4f4ce0214 Mon Sep 17 00:00:00 2001 From: KevinLoiseau Date: Tue, 26 Nov 2019 16:18:20 +0100 Subject: [PATCH] Take care of SslPolicy and Default actions' Order in listeners parser --- lib/fog/aws/parsers/elbv2/describe_listeners.rb | 4 ++-- tests/parsers/elbv2/describe_listeners_tests.rb | 4 ++++ tests/requests/elbv2/helper.rb | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/fog/aws/parsers/elbv2/describe_listeners.rb b/lib/fog/aws/parsers/elbv2/describe_listeners.rb index 7034cb725..c92d8c7b1 100644 --- a/lib/fog/aws/parsers/elbv2/describe_listeners.rb +++ b/lib/fog/aws/parsers/elbv2/describe_listeners.rb @@ -52,7 +52,7 @@ module Fog end when 'Weight' @target_group[name] = value - when 'Type' + when 'Type', 'Order' @default_action[name] = value when 'Path', 'Protocol', 'Port', 'Query', 'Host', 'StatusCode' @config[name] = value @@ -84,7 +84,7 @@ module Fog @results['Listeners'] << @listener reset_listener end - when 'LoadBalancerArn', 'Protocol', 'Port', 'ListenerArn' + when 'LoadBalancerArn', 'Protocol', 'Port', 'ListenerArn', 'SslPolicy' @listener[name] = value when 'CertificateArn' @certificate[name] = value diff --git a/tests/parsers/elbv2/describe_listeners_tests.rb b/tests/parsers/elbv2/describe_listeners_tests.rb index f6e7e3e6d..f25fe4aac 100644 --- a/tests/parsers/elbv2/describe_listeners_tests.rb +++ b/tests/parsers/elbv2/describe_listeners_tests.rb @@ -10,9 +10,11 @@ DESCRIBE_LISTENERS_RESULT = <<-EOF HTTPS 80 arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2 + polucy forward + 1 arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067 HTTPS @@ -36,9 +38,11 @@ DESCRIBE_LISTENERS_RESULT = <<-EOF HTTPS 80 arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2 + polucy forward + 2 arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067 true diff --git a/tests/requests/elbv2/helper.rb b/tests/requests/elbv2/helper.rb index 8094f8599..0617c852f 100644 --- a/tests/requests/elbv2/helper.rb +++ b/tests/requests/elbv2/helper.rb @@ -32,6 +32,7 @@ class AWS LISTENER_DEFAULT_ACTIONS = [{ "Type" => String, + "Order" => String, "TargetGroupArn" => String, "RedirectConfig" => Fog::Nullable::Hash, "ForwardConfig" => Fog::Nullable::Hash @@ -42,6 +43,7 @@ class AWS "Protocol" => String, "Port" => String, "ListenerArn" => String, + "SslPolicy" => String, "DefaultActions" => LISTENER_DEFAULT_ACTIONS, "Certificates" => [{"CertificateArn" => String}] }