From 8ff4fd674c99f503c491ef91ed99d79775061dfa Mon Sep 17 00:00:00 2001 From: Paul Hinze Date: Fri, 6 May 2022 15:23:54 -0500 Subject: [PATCH] Add back in some respond_to checks Helps Environment::Remote to work when it's handed a Basis client for operations like `box list` and `vagrant init`. --- lib/vagrant/environment/remote.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/vagrant/environment/remote.rb b/lib/vagrant/environment/remote.rb index c53585730..25e625caf 100644 --- a/lib/vagrant/environment/remote.rb +++ b/lib/vagrant/environment/remote.rb @@ -24,8 +24,8 @@ module Vagrant opts[:ui_class] ||= UI::Remote @cwd = Pathname.new(@client.cwd) - @home_path = Pathname.new(@client.home) - @vagrantfile_name = Array(@client.vagrantfile_name) + @home_path = @client.respond_to?(:home) && Pathname.new(@client.home) + @vagrantfile_name = @client.respond_to?(:vagrantfile_name) && Array(@client.vagrantfile_name) @ui = opts.fetch(:ui, opts[:ui_class].new(@client.ui)) @local_data_path = Pathname.new(@client.local_data) @boxes_path = @home_path && @home_path.join("boxes") @@ -102,7 +102,7 @@ module Vagrant end def default_provider(**opts) - client.default_provider.to_sym + client.respond_to?(:default_provider) && client.default_provider.to_sym end # Gets a target (machine) by name