Skip to content

Commit

Permalink
Add monkeypatch for Hash to work around vagrant-aws
Browse files Browse the repository at this point in the history
See mitchellh/vagrant-aws#566

Since we test the bosh-agent against linux and windows, we started
testing against go1.14 on windows and go1.13 on linux. I decided to
update the bosh-agent linux docker image to install go1.14.

The new docker image brought Ruby 2.5+ was installed and vagrant-aws needed to be updated.
I decided to keep going and update the plugin
(d6d7ba9).

This led to this error with vagrant-aws and Ruby's i18n. I could undo
all of this by pinning Ruby in our docker image so that none of these
dependencies are updated, but I think the risk of keeping this
monkeypatch around for a bit is fine.
  • Loading branch information
Shaan Sapra committed May 13, 2020
1 parent d6d7ba9 commit 140bf33
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions integration/windows/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,18 @@ Pop-Location
Pop-Location
SHELL

# 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

Vagrant.configure(2) do |config|
config.vm.provider :aws do |aws, override|
aws.instance_type = "m4.large"
Expand Down

0 comments on commit 140bf33

Please sign in to comment.