dotless-de / vagrant-vbguest

A Vagrant plugin to keep your VirtualBox Guest Additions up to date
MIT License
2.88k stars 207 forks source link

Do not check for errors during cleanup #411

Closed tianyuanhao closed 1 year ago

tianyuanhao commented 3 years ago

Ref #393

Vagrantfile:

Vagrant.configure("2") do |config|
  config.vagrant.plugins = ["vagrant-vbguest"]

  config.vm.box = "ubuntu/hirsute64"

  config.vbguest.installer_hooks[:before_install] = [
    "echo An error occurred >&2; exit 1",
    "apt-get update",
    "apt-get -y install virtualbox-guest-utils",
  ]
end

Before:

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

umount /mnt

Stdout from the command:

Stderr from the command:

umount: /mnt: not mounted.

After:

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

echo An error occurred >&2; exit 1

Stdout from the command:

Stderr from the command:

An error occurred
fnordfish commented 3 years ago

Hi and thanks for your contribution. I'm not quite sure if I understand the reasoning of your purposed change. Is it the internal cleanup that fails and leads to a failed Vagrant run? Or is it, like described in your example, a :installer_hooks script provided by you?

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.