Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhelpful exception when I misspell vsphere.compute_resource_name #9

Open
offby1 opened this issue Aug 20, 2013 · 1 comment
Open

Comments

@offby1
Copy link

offby1 commented Aug 20, 2013

Here's a Vagrantfile that almost works; as you can see, I've deliberately misspelled vsphere.compute_resource_name:

# -*-ruby-*-

Vagrant.configure("2") do |config|
  config.vm.box = 'vsphere-dummy'
  config.vm.box_url = '/Users/erichanchrow/git-repositories/3rd-party/vagrant-vsphere/example_boxdummy.box'

  config.vm.provider :vsphere do |vsphere|
    vsphere.host = '10.6.100.20'
    vsphere.compute_resource_name = '10.6.100.5-misspelled'
    vsphere.resource_pool_name = 'The Resource Pool'
    vsphere.template_name = 'ubuntu-12.04.2-server-amd64-template'
    vsphere.name = 'test vm'
    vsphere.user = 'root'
    vsphere.password = 'vmware'
    vsphere.insecure = true
  end
end

Here's what I see when I run vagrant up:

:) 10:27:47 [erichanchrow@Eric-Hanchrows-iMac vagrant] (vagrant-vsphere *)$ vagrant up --provider=vsphere
Bringing machine 'default' up with 'vsphere' provider...
VagrantPlugins::VSphere::Errors::VSphereError

That error isn't in the least helpful; when I first encountered it, it took me a very long time to realize my mistake (it was a much-more-subtle misspelling, obviously).

It would be much more useful if the exception displayed a message like could not find any compute resource named '10.6.100.5-misspelled'.

There's a similar problem with vsphere.template_name, and perhaps other of these entries too.

@GregDomjan
Copy link
Contributor

Based on my understanding that ruby/vagrant is searching through a result set for a match and not just getting back a true/false result.

I think it would also be helpful to have an option for additional information when a search fails. Such as being able to list the results that where found but didn't match to give some idea of what is being examined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants