ggiamarchi / vagrant-openstack-provider

Use Vagrant to manage OpenStack Cloud instances.
MIT License
247 stars 101 forks source link

delete_keypair_if_vagrant throws exception if key_name is missing #238

Closed mshean closed 9 years ago

mshean commented 9 years ago

Key pairs are not associated with hosts on our openstack cluster for some odd reason. The absence of this is causing delete_keypair_if_vagrant to crap out on a nil exception. This occurs when running 'vagrant destroy'.

vagrant version: 1.74 vagrant-openstack-provider version: 0.6.1

/Users/mshean/.vagrant.d/gems/gems/vagrant-openstack-provider-0.6.1/lib/vagrant-openstack-provider/client/nova.rb:140:in `block in delete_keypair_if_vagrant': Catched Error: Catched Error: undefined method `start_with?' for nil:NilClass (NoMethodError)
    from /Users/mshean/.vagrant.d/gems/gems/vagrant-openstack-provider-0.6.1/lib/vagrant-openstack-provider/client/nova.rb:178:in `instance_exists'
    from /Users/mshean/.vagrant.d/gems/gems/vagrant-openstack-provider-0.6.1/lib/vagrant-openstack-provider/client/nova.rb:138:in `delete_keypair_if_vagrant'
    from /Users/mshean/.vagrant.d/gems/gems/vagrant-openstack-provider-0.6.1/lib/vagrant-openstack-provider/action/delete_server.rb:20:in `execute'
    from /Users/mshean/.vagrant.d/gems/gems/vagrant-openstack-provider-0.6.1/lib/vagrant-openstack-provider/action/abstract_action.rb:8:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Users/mshean/.vagrant.d/gems/gems/vagrant-openstack-provider-0.6.1/lib/vagrant-openstack-provider/action/connect_openstack.rb:32:in `execute'
    from /Users/mshean/.vagrant.d/gems/gems/vagrant-openstack-provider-0.6.1/lib/vagrant-openstack-provider/action/abstract_action.rb:8:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/machine.rb:214:in `action_raw'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/machine.rb:191:in `block in action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/environment.rb:516:in `lock'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/machine.rb:178:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/machine.rb:178:in `action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/plugins/commands/destroy/command.rb:31:in `block in execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/plugin/v2/command.rb:226:in `block in with_target_vms'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/plugin/v2/command.rb:220:in `each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/lib/vagrant/plugin/v2/command.rb:220:in `with_target_vms'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.4/plugins/commands/destroy/command.rb:30: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>'