sciurus/vagrant-mutate

Fix how box is loaded by name

Closed this issue · 0 comments

Right now when loading a box by name (e.g. vagrant mutate foo kvm) we assume the provider is virtualbox (i.e. we look for it in in $VAGRANT_HOME/boxes/foo/virtualbox/) This prevents using other providers as inputs.

If the same box already exists with multiple providers, specifying just the name is not sufficient. We could do a couple things

  1. Just load the first box we find that is for a supported provider
  2. Keep a list of providers ordered by preference, and load the box from the most preferred provider that has the box
  3. Let the user specify which provider to use

I'm leaning towards the latter since that will be more flexible and testable. I'll add support for the syntax box_name/provider_name but the /provider_name will only be required if box_name is ambiguous.