From e7e956ca1244410558f74ab6c5e52838cf2106d8 Mon Sep 17 00:00:00 2001 From: sophia Date: Mon, 10 Aug 2020 16:32:54 -0500 Subject: [PATCH] Fix a few deprecation warnings for ruby 2.7 --- plugins/hosts/darwin/cap/fs_iso.rb | 2 +- plugins/hosts/linux/cap/fs_iso.rb | 2 +- plugins/hosts/windows/cap/fs_iso.rb | 2 +- plugins/kernel_v2/config/vm.rb | 2 +- plugins/providers/virtualbox/action/forward_ports.rb | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/hosts/darwin/cap/fs_iso.rb b/plugins/hosts/darwin/cap/fs_iso.rb index 255352a0f..477f9c702 100644 --- a/plugins/hosts/darwin/cap/fs_iso.rb +++ b/plugins/hosts/darwin/cap/fs_iso.rb @@ -29,7 +29,7 @@ module VagrantPlugins # @return [Pathname] ISO location # @note If file_destination exists, source_directory will be checked # for recent modifications and a new ISO will be generated if requried. - def self.create_iso(env, source_directory, **extra_opts) + def self.create_iso(env, source_directory, extra_opts={}) source_directory = Pathname.new(source_directory) file_destination = self.ensure_output_iso(extra_opts[:file_destination]) diff --git a/plugins/hosts/linux/cap/fs_iso.rb b/plugins/hosts/linux/cap/fs_iso.rb index fc01c0c9b..4aebc90d0 100644 --- a/plugins/hosts/linux/cap/fs_iso.rb +++ b/plugins/hosts/linux/cap/fs_iso.rb @@ -29,7 +29,7 @@ module VagrantPlugins # @return [Pathname] ISO location # @note If file_destination exists, source_directory will be checked # for recent modifications and a new ISO will be generated if requried. - def self.create_iso(env, source_directory, **extra_opts) + def self.create_iso(env, source_directory, extra_opts={}) source_directory = Pathname.new(source_directory) file_destination = self.ensure_output_iso(extra_opts[:file_destination]) diff --git a/plugins/hosts/windows/cap/fs_iso.rb b/plugins/hosts/windows/cap/fs_iso.rb index 17a9bb5ae..f076f6539 100644 --- a/plugins/hosts/windows/cap/fs_iso.rb +++ b/plugins/hosts/windows/cap/fs_iso.rb @@ -29,7 +29,7 @@ module VagrantPlugins # @return [Pathname] ISO location # @note If file_destination exists, source_directory will be checked # for recent modifications and a new ISO will be generated if requried. - def self.create_iso(env, source_directory, **extra_opts) + def self.create_iso(env, source_directory, extra_opts={}) source_directory = Pathname.new(source_directory) file_destination = self.ensure_output_iso(extra_opts[:file_destination]) diff --git a/plugins/kernel_v2/config/vm.rb b/plugins/kernel_v2/config/vm.rb index f6fb07c00..14dc2de80 100644 --- a/plugins/kernel_v2/config/vm.rb +++ b/plugins/kernel_v2/config/vm.rb @@ -400,7 +400,7 @@ module VagrantPlugins if Vagrant::Util::Experimental.feature_enabled?("dependency_provisioners") opts = {before: before, after: after} - prov = VagrantConfigProvisioner.new(name, type.to_sym, opts) + prov = VagrantConfigProvisioner.new(name, type.to_sym, **opts) else prov = VagrantConfigProvisioner.new(name, type.to_sym) end diff --git a/plugins/providers/virtualbox/action/forward_ports.rb b/plugins/providers/virtualbox/action/forward_ports.rb index aac663918..a468ae61b 100644 --- a/plugins/providers/virtualbox/action/forward_ports.rb +++ b/plugins/providers/virtualbox/action/forward_ports.rb @@ -48,7 +48,7 @@ module VagrantPlugins # bridged networking don't require port-forwarding and establishing # forwarded ports on these attachment types has uncertain behaviour. @env[:ui].detail(I18n.t("vagrant.actions.vm.forward_ports.forwarding_entry", - message_attributes)) + **message_attributes)) # Verify we have the network interface to attach to if !interfaces[fp.adapter] @@ -62,7 +62,7 @@ module VagrantPlugins # so verify that that is the case. if interfaces[fp.adapter][:type] != :nat @env[:ui].detail(I18n.t("vagrant.actions.vm.forward_ports.non_nat", - message_attributes)) + **message_attributes)) next end