From 19996a4fc465079cbaf83e2f20cb5fd51437c5df Mon Sep 17 00:00:00 2001 From: Matt Richardson Date: Mon, 18 Jan 2021 17:57:32 +1100 Subject: [PATCH] Try and workaround mitchellh/vagrant-aws#566 --- vagrantfile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/vagrantfile b/vagrantfile index a9575d8b6..a7abb22a6 100644 --- a/vagrantfile +++ b/vagrantfile @@ -2,6 +2,19 @@ VAGRANT_FILE_API_VERSION = "2" +# start workaround for https://github.com/mitchellh/vagrant-aws/issues/566 +class Hash + def slice(*keep_keys) + h = {} + keep_keys.each { |key| h[key] = fetch(key) if has_key?(key) } + h + end unless Hash.method_defined?(:slice) + def except(*less_keys) + slice(*keys - less_keys) + end unless Hash.method_defined?(:except) +end +# end workaround for https://github.com/mitchellh/vagrant-aws/issues/566 + aws_access_key_id = ENV['AWS_ACCESS_KEY_ID'] || 'not-set' aws_secret_access_key = ENV['AWS_SECRET_ACCESS_KEY'] || 'not-set' aws_subnet_id = ENV['AWS_SUBNET_ID'] || 'not-set'