Skip to content

Commit

Permalink
Chefstyle updates
Browse files Browse the repository at this point in the history
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
  • Loading branch information
clintoncwolfe committed Sep 18, 2020
1 parent 529a1d8 commit 1fe821d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions kitchen-ec2.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
lib = File.expand_path("../lib", __FILE__)
lib = File.expand_path("lib", __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "kitchen/driver/ec2_version.rb"
require "kitchen/driver/ec2_version"

Gem::Specification.new do |gem|
gem.name = "kitchen-ec2"
Expand Down
2 changes: 1 addition & 1 deletion lib/kitchen/driver/aws/instance_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def ec2_instance_data # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
raise "The subnet tagged '#{config[:subnet_filter][:tag]}:#{config[:subnet_filter][:value]}' does not exist!" unless subnets.any?

# => Select the least-populated subnet if we have multiple matches
subnet = subnets.sort_by { |s| s[:available_ip_address_count] }.last
subnet = subnets.max_by { |s| s[:available_ip_address_count] }
vpc_id = subnet.vpc_id
config[:subnet_id] = subnet.subnet_id
end
Expand Down

0 comments on commit 1fe821d

Please # to comment.