Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symbolize keys of bootstrap_options before access. #521

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion lib/chef/provisioning/aws_driver/driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ def machine_for(machine_spec, machine_options, instance = nil)
end

def bootstrap_options_for(action_handler, machine_spec, machine_options)
bootstrap_options = (machine_options[:bootstrap_options] || {}).to_h.dup
bootstrap_options = symbolize_keys(machine_options[:bootstrap_options] || {})
# These are hardcoded for now - only 1 machine at a time
bootstrap_options[:min_count] = bootstrap_options[:max_count] = 1
bootstrap_options[:instance_type] ||= default_instance_type
Expand Down Expand Up @@ -1567,6 +1567,15 @@ def get_listener(listener)
result
end

def symbolize_keys(hash)
new_hash = {}
hash.each do |k, v|
v = symbolize_keys(v) if v.is_a?(Hash)
new_hash[k.to_sym] = v
end
new_hash
end

def default_instance_type
't2.micro'
end
Expand Down