From f1af42a7fc70c7f298b36f57b63b26dcdfb70322 Mon Sep 17 00:00:00 2001 From: sophia Date: Fri, 1 Jul 2022 11:31:21 -0500 Subject: [PATCH] Don't use hash with indifferent access when converting hash The HashWithIndifferentAccess will change all keys to strings when merged with another regular hash. This causes errors in cases where hashes are merged, for example in the action builder. Symbol/String type data is kept over the wire, so there is no need to make the mapped hash a HashWithIndifferentAccess. --- plugins/commands/serve/mappers/known_types.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/commands/serve/mappers/known_types.rb b/plugins/commands/serve/mappers/known_types.rb index ae94635f0..16ac9e619 100644 --- a/plugins/commands/serve/mappers/known_types.rb +++ b/plugins/commands/serve/mappers/known_types.rb @@ -171,7 +171,7 @@ module VagrantPlugins def converter(proto, mapper) begin - h = Hash.new.tap do |result| + Hash.new.tap do |result| proto.entries.each do |entry| # Convert our key and value to native types k = mapper.map(entry.key) @@ -183,7 +183,6 @@ module VagrantPlugins result[k] = v end end - Vagrant::Util::HashWithIndifferentAccess.new(h) rescue => err logger.error { "proto mapping to hash failed: #{err}" } raise