hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.01k stars 4.42k forks source link

vagrant-vbguest/hosts/virtualbox.rb typo error #13404

Open D4d0s opened 1 month ago

D4d0s commented 1 month ago

Debug output

==> default: Attempting graceful shutdown of VM...
==> default: Destroying VM and associated drives...
/usr/share/vagrant/gems/gems/vagrant-vbguest-0.32.0/lib/vagrant-vbguest/hosts/virtualbox.rb:84:in `block in guess_local_iso': undefined method `exists?' for class File (NoMethodError)

            path && File.exists?(path)
                        ^^^^^^^^

Expected behavior

Vagrant up bring up a vm

Actual behavior

vagrant fails bringing up a vm when is trying to update vbguest

Reproduction information

Vagrant version

Vagrant 2.3.7

Host operating system

opensuse tumbleweed VERSION=20240521

Guest operating system

Centos7 (a box of)

Steps to reproduce

So i fixed it by editing the file /usr/share/vagrant/gems/gems/vagrant-vbguest-0.32.0/lib/vagrant-vbguest/hosts/virtualbox.rb:

def guess_local_iso
          Array(platform_path).find do |path|
-             path && File.exists?(path)
+            path && File.exist?(path)
          end
        end

The NoMethodError give me the clue. And the ^^^^^ :-) Is easy to fix but it is annoying anyway.

1. 2. 3.

Vagrantfile

# Copy-paste your Vagrantfile here. Remove any sensitive information such as passwords, authentication tokens, or email addresses.