Skip to content

Commit

Permalink
AWS API bug fix and debug logging (#103)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
albertrdixon authored Dec 11, 2017
1 parent 60b3800 commit 222998a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
11 changes: 0 additions & 11 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 2 additions & 0 deletions lib/broadside/ecs/ecs_deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions lib/broadside/ecs/ecs_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/broadside/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Broadside
VERSION = '3.3.1'.freeze
VERSION = '3.3.2'.freeze
end

0 comments on commit 222998a

Please sign in to comment.