sciurus / vagrant-mutate

Convert vagrant boxes to work with different providers
MIT License
281 stars 41 forks source link

vagrant mutate throws TypeError #72

Closed Momus closed 9 years ago

Momus commented 9 years ago

--deleted previous versions of gems --updated Vagrant: Vagrant 1.7.4 --installed vagrant-libvirt

 $ vagrant plugin list
vagrant-libvirt (0.0.30)
vagrant-mutate (1.0.0)
vagrant-share (1.1.4, system)

ran vagrant mutate freebsd-10.1-zfs-pure libvirt got:

~/.vagrant.d/gems/gems/vagrant-mutate-1.0.0/lib/vagrant-mutate/box_loader.rb:243:in `join': no implicit conversion of nil into String (TypeError)
    from ~/.vagrant.d/gems/gems/vagrant-mutate-1.0.0/lib/vagrant-mutate/box_loader.rb:243:in `find_input_dir'
    from ~/.vagrant.d/gems/gems/vagrant-mutate-1.0.0/lib/vagrant-mutate/box_loader.rb:119:in `load_from_boxes_path'
    from ~/.vagrant.d/gems/gems/vagrant-mutate-1.0.0/lib/vagrant-mutate/box_loader.rb:36:in `load'
    from ~/.vagrant.d/gems/gems/vagrant-mutate-1.0.0/lib/vagrant-mutate/mutate.rb:39:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/cli.rb:42:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/environment.rb:301:in `cli'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/bin/vagrant:174:in `<main>'
Momus commented 9 years ago

So I tracked this problem down to my stupidity: the freebsd boxes were actually installed as infinitycode/freebsd-10.1-zfs-pure as plain 'freebsd-etc'. It seems that this is the error that is generated whenever an incorrect box name is used. :

 $ vagrant mutate foo  libvirt
~/.vagrant.d/gems/gems/vagrant-mutate-1.0.0/lib/vagrant-mutate/box_loader.rb:243:in `join': no implicit conversion of nil into String (TypeError)

So maybe there should be a better error for boneheads? Yeah, I'm still blaming mutate :)

ar4s commented 9 years ago

I had similar problem with hasicorp/precise64. I run vagrant mutate hasicorp/precise64 libvirt and it's worked. maybe try execute vagrant mutate infinitycode/freebsd-10.1-zfs-pure libvirt?

Momus commented 9 years ago

Yes, that's what I would up doing after looking at how Vagrant arranged my boxes with box list It's just that vagrant mutate doesn't' fail with a proper error if you type the name of the box wrong: `join': no implicit conversion of nil into String (TypeError) is not very descriptive or helpful, so this is more of a feature request.

sciurus commented 9 years ago

Thanks for the report! This should be fixed in 1.0.1.

$ vagrant mutate foo libvirt
The box foo was not found