emyl / vagrant-triggers

Allow the definition of arbitrary scripts that will run on the host before and/or after Vagrant commands.
MIT License
546 stars 35 forks source link

Whitelist for command return codes #37

Closed mbrodala closed 8 years ago

mbrodala commented 9 years ago

It would be nice if there was an option to whitelist command return codes to mark them as non-fatal errors.

Think of a trigger which mounts a Samba share from the Vagrant machine. On the first run of the first machine, this will work fine. But on subsequent runs (machine stopped & restarted / another machine started) this command will output an error along the lines of share already mounted, which is not an error per se but will confuse users.

If the return code of that error (e.g. 2 instead of 0 for gvfs-mount and 85 for net) was whitelisted, no error message would be outputted and trigger execution would continue as usual.

mbrodala commented 8 years ago

Thanks for adding this. :-)