ggiamarchi / vagrant-openstack-provider

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

nil Object Class in utils.rb::get_ip_address::line 22 #289

Closed daibhidh closed 6 years ago

daibhidh commented 8 years ago

Scenario: Multiple Networks assigned with NO floating ip assigned the following is consistently recieved:

/users/davros/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/utils.rb:22:in get_ip_address': Catched Error: Catched Error: Catched Error: Catched Error: Catched Error: Catched Error: Catched Error: Catched Error: undefined methodsize' for nil:NilClass (NoMethodError) from /users/davros/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/action/read_ssh_info.rb:39:in read_ssh_info' from /users/davros/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/action/read_ssh_info.rb:26:inblock (2 levels) in execute' from /users/davros/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/action/read_ssh_info.rb:25:in synchronize' from /users/davros/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/action/read_ssh_info.rb:25:inblock in execute' from /users/davros/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/action/read_ssh_info.rb:24:in tap' from /users/davros/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/action/read_ssh_info.rb:24:inexecute' from /users/davros/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/action/abstract_action.rb:8:in call' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:incall' from /users/davros/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/action/connect_openstack.rb:32:in execute' from /users/davros/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/action/abstract_action.rb:8:incall' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in call' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builtin/config_validate.rb:25:incall' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in call' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builder.rb:116:incall' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:66:in block in run' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/util/busy.rb:19:inbusy' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:66:in run' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/machine.rb:224:inaction_raw' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/machine.rb:199:in block in action' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:530:inlock' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/machine.rb:185:in call' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/machine.rb:185:inaction' from /users/davros/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/provider.rb:25:in ssh_info' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/machine.rb:425:inssh_info' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builtin/ssh_run.rb:25:in call' from /users/davros/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/action/wait_accessible.rb:47:inserver_is_reachable?' from /users/davros/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/action/wait_accessible.rb:26:in waiting_for_server_to_be_reachable' from /users/davros/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/action/wait_accessible.rb:15:inexecute' from /users/davros/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/action/abstract_action.rb:8:in call' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:incall' from /users/davros/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/action/create_server.rb:55:in execute' from /users/davros/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/action/abstract_action.rb:8:incall' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in call' from /users/davros/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/action/create_stack.rb:54:inexecute' from /users/davros/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/action/abstract_action.rb:8:in call' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:incall' from /users/davros/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/action/sync_folders.rb:48:in call' from /users/davros/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/action/sync_folders.rb:20:inexecute' from /users/davros/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/action/abstract_action.rb:8:in call' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:incall' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builtin/provision.rb:80:in call' from /users/davros/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/action/provision.rb:22:inexecute' from /users/davros/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/action/abstract_action.rb:8:in call' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:incall' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:95:in block in finalize_action' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:incall' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in call' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builder.rb:116:incall' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:66:in block in run' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/util/busy.rb:19:inbusy' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:66:in run' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builtin/call.rb:53:incall' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in call' from /users/davros/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/action/connect_openstack.rb:32:inexecute' from /users/davros/.vagrant.d/gems/gems/vagrant-openstack-provider-0.7.1/lib/vagrant-openstack-provider/action/abstract_action.rb:8:in call' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:incall' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builtin/config_validate.rb:25:in call' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:incall' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builder.rb:116:in call' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:66:inblock in run' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/util/busy.rb:19:in busy' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:66:inrun' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/machine.rb:224:in action_raw' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/machine.rb:199:inblock in action' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:561:in lock' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/machine.rb:185:incall' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/machine.rb:185:in action' from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/batch_action.rb:82:inblock (2 levels) in run'

Looking at the code it seems to be a bad call/typo on line 20: net_addresses = addresses[env[:machine].provider_config.networks[0]]

the addresses object does not have the :machine environment in order to access the configuration.

I changed the code in accordance with the below patch and it seems to work fine for me. I tested all 3 variants of returns succesfully against a Juno install. utils.patch.txt