From 222998a008c7c2f68cc23fefd3a9f046494d3b61 Mon Sep 17 00:00:00 2001 From: Albert Dixon Date: Mon, 11 Dec 2017 11:20:28 -0800 Subject: [PATCH] AWS API bug fix and debug logging (#103) * debug logging * don't validate * better debug logging * wrong constant name * remove core * add formatter * simplify * moar debug * attempt fix for aws debug * typo in param change * learn 2 spell * allow param validation to be turned off * remove typo * shutup hound * remove aws param validation (to be released in later PR) * actually remove param validation --- .rubocop.yml | 11 ----------- CHANGELOG.md | 5 +++++ lib/broadside/ecs/ecs_deploy.rb | 2 ++ lib/broadside/ecs/ecs_manager.rb | 8 ++++++-- lib/broadside/version.rb | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index db82220..f6333f4 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -875,17 +875,6 @@ Style/EmptyMethod: - compact - expanded -# Checks whether the source file has a utf-8 encoding comment or not -# AutoCorrectEncodingComment must match the regex -# /#.*coding\s?[:=]\s?(?:UTF|utf)-8/ -Style/Encoding: - EnforcedStyle: never - SupportedStyles: - - when_needed - - always - - never - AutoCorrectEncodingComment: '# encoding: utf-8' - # Checks use of for or each in multiline loops. Style/For: EnforcedStyle: each diff --git a/CHANGELOG.md b/CHANGELOG.md index f9e552d..ddb69d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# 3.3.2 +- Add debug logging for aws-sdk components +- Add some other debug logging +- Fix for aws api changes: ecs task_definition response includes `compatibilities`, but requests want `requires_compatibilities` + # 3.3.1 - Use new modularized aws-sdk gems: aws-sdk-ec2 & aws-sdk-ecs diff --git a/lib/broadside/ecs/ecs_deploy.rb b/lib/broadside/ecs/ecs_deploy.rb index 88bdcc5..1017fba 100644 --- a/lib/broadside/ecs/ecs_deploy.rb +++ b/lib/broadside/ecs/ecs_deploy.rb @@ -135,7 +135,9 @@ def update_task_revision # Deep merge doesn't work well with arrays (e.g. container_definitions), so build the container first. updatable_container_definitions.first.merge!(configured_container_definition) revision.deep_merge!((@target.task_definition_config || {}).except(:container_definitions)) + revision[:requires_compatibilities] = revision.delete(:compatibilities) if revision.key? :compatibilities + debug "Registering updated task definition for #{revision[:family]}" task_definition = EcsManager.ecs.register_task_definition(revision).task_definition debug "Successfully created #{task_definition.task_definition_arn}" end diff --git a/lib/broadside/ecs/ecs_manager.rb b/lib/broadside/ecs/ecs_manager.rb index 9882091..c046696 100644 --- a/lib/broadside/ecs/ecs_manager.rb +++ b/lib/broadside/ecs/ecs_manager.rb @@ -8,7 +8,9 @@ class << self def ecs @ecs_client ||= Aws::ECS::Client.new( region: Broadside.config.aws.region, - credentials: Broadside.config.aws.credentials + credentials: Broadside.config.aws.credentials, + logger: Broadside.config.logger, + log_formatter: Aws::Log::Formatter.colored ) end @@ -166,7 +168,9 @@ def all_results(method, key, args = {}) def ec2_client @ec2_client ||= Aws::EC2::Client.new( region: Broadside.config.aws.region, - credentials: Broadside.config.aws.credentials + credentials: Broadside.config.aws.credentials, + logger: Broadside.config.logger, + log_formatter: Aws::Log::Formatter.colored ) end end diff --git a/lib/broadside/version.rb b/lib/broadside/version.rb index 1faa82d..e7136c5 100644 --- a/lib/broadside/version.rb +++ b/lib/broadside/version.rb @@ -1,3 +1,3 @@ module Broadside - VERSION = '3.3.1'.freeze + VERSION = '3.3.2'.freeze end