python-vagrant icon indicating copy to clipboard operation
python-vagrant copied to clipboard

support --no-destroy-on-error for up()

Open eighthave opened this issue 2 years ago • 4 comments

vagrant up has the option --no-destroy-on-error which is very helpful for debugging. It would be nice if python-vagrant supported it, and it looks simple to add. I would just add destroy_on_error=True as an arg to vagrant.up() then pass the right arg depending on that value, something like:

    if not destroy_on_error:
        destroy_on_error_arg = "--no-destroy-on-error"

Here's a reference:

 ~ $ vagrant up --help
Usage: vagrant up [options] [name|id]

Options:

        --[no-]provision             Enable or disable provisioning
        --provision-with x,y,z       Enable only certain provisioners, by type or by name.
        --[no-]destroy-on-error      Destroy machine if any fatal error happens (default to true)
        --[no-]parallel              Enable or disable parallelism if provider supports it
        --provider PROVIDER          Back the machine with a specific provider
        --[no-]install-provider      If possible, install the provider if it isn't installed
    -h, --help                       Print this help
 ~ $ 

eighthave avatar Apr 01 '22 14:04 eighthave

Hi @eighthave, you basically got a PR all done already, want to submit one as well? :)

konstruktoid avatar Apr 04 '22 10:04 konstruktoid

sure I can do it, if it is something you'd want to merge

eighthave avatar Apr 04 '22 15:04 eighthave

Sure thing, seems like an option that can come in handy.

konstruktoid avatar Apr 04 '22 17:04 konstruktoid

https://github.com/pycontribs/python-vagrant/pull/129

eighthave avatar Jul 12 '22 23:07 eighthave