fog / fog-libvirt

libvirt provider for fog
MIT License
16 stars 42 forks source link

Fix error getting IP addresses when using provided authentication #17

Closed dcbw closed 8 years ago

dcbw commented 8 years ago

Closes: https://github.com/fog/fog-libvirt/issues/16

dcbw commented 8 years ago

Failed travis results seem to be a flake:

NoMethodError: undefined method `last_comment' for #<Rake::Application:0x00000000d23e80>
/home/travis/.rvm/gems/ruby-2.1.0/gems/yard-0.8.7.6/lib/yard/rake/yardoc_task.rb:69:in `define'
/home/travis/.rvm/gems/ruby-2.1.0/gems/yard-0.8.7.6/lib/yard/rake/yardoc_task.rb:61:in `initialize'
/home/travis/build/fog/fog-libvirt/Rakefile:124:in `new'
/home/travis/build/fog/fog-libvirt/Rakefile:124:in `<top (required)>'
/home/travis/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `eval'
/home/travis/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `<main>'
coolbrg commented 8 years ago

@dcbw : I am getting following error for this fix:

/home/budhram/.vagrant.d/gems/gems/fog-libvirt-0.0.4/lib/fog/libvirt/requests/compute/dhcp_leases.rb:8:in `dhcp_leases': NULL pointer given (ArgumentError)
    from /home/budhram/.vagrant.d/gems/gems/fog-libvirt-0.0.4/lib/fog/libvirt/requests/compute/dhcp_leases.rb:8:in `dhcp_leases'
    from /home/budhram/.vagrant.d/gems/gems/fog-libvirt-0.0.4/lib/fog/libvirt/models/compute/network.rb:20:in `dhcp_leases'
    from /home/budhram/.vagrant.d/gems/gems/fog-libvirt-0.0.4/lib/fog/libvirt/models/compute/server.rb:271:in `block in addresses'
    from /home/budhram/.vagrant.d/gems/gems/fog-core-1.36.0/lib/fog/core/collection.rb:19:in `each'
    from /home/budhram/.vagrant.d/gems/gems/fog-core-1.36.0/lib/fog/core/collection.rb:19:in `each'
    from /home/budhram/.vagrant.d/gems/gems/fog-libvirt-0.0.4/lib/fog/libvirt/models/compute/server.rb:269:in `addresses'
    from /home/budhram/.vagrant.d/gems/gems/vagrant-libvirt-0.0.32/lib/vagrant-libvirt/action/wait_till_up.rb:39:in `block (3 levels) in call'
    from /home/budhram/.vagrant.d/gems/gems/fog-core-1.36.0/lib/fog/core/model.rb:72:in `instance_eval'
    from /home/budhram/.vagrant.d/gems/gems/fog-core-1.36.0/lib/fog/core/model.rb:72:in `block in wait_for'
    from /home/budhram/.vagrant.d/gems/gems/fog-core-1.36.0/lib/fog/core/wait_for.rb:7:in `block in wait_for'
    from /home/budhram/.vagrant.d/gems/gems/fog-core-1.36.0/lib/fog/core/wait_for.rb:6:in `loop'
    from /home/budhram/.vagrant.d/gems/gems/fog-core-1.36.0/lib/fog/core/wait_for.rb:6:in `wait_for'
    from /home/budhram/.vagrant.d/gems/gems/fog-core-1.36.0/lib/fog/core/model.rb:69:in `wait_for'
    from /home/budhram/.vagrant.d/gems/gems/vagrant-libvirt-0.0.32/lib/vagrant-libvirt/action/wait_till_up.rb:38:in `block (2 levels) in call'
    from /usr/share/vagrant/lib/vagrant/util/retryable.rb:17:in `retryable'
    from /home/budhram/.vagrant.d/gems/gems/vagrant-libvirt-0.0.32/lib/vagrant-libvirt/action/wait_till_up.rb:33:in `block in call'
    from /home/budhram/.vagrant.d/gems/gems/vagrant-libvirt-0.0.32/lib/vagrant-libvirt/util/timer.rb:9:in `time'
    from /home/budhram/.vagrant.d/gems/gems/vagrant-libvirt-0.0.32/lib/vagrant-libvirt/action/wait_till_up.rb:31:in `call'
    from /usr/share/vagrant/lib/vagrant/action/warden.rb:34:in `call'
    from /home/budhram/.vagrant.d/gems/gems/vagrant-libvirt-0.0.32/lib/vagrant-libvirt/action/start_domain.rb:188:in `call'
    from /usr/share/vagrant/lib/vagrant/action/warden.rb:34:in `call'
    from /home/budhram/.vagrant.d/gems/gems/vagrant-libvirt-0.0.32/lib/vagrant-libvirt/action/set_boot_order.rb:60:in `call'
    from /usr/share/vagrant/lib/vagrant/action/warden.rb:34:in `call'
    from /home/budhram/.vagrant.d/gems/gems/vagrant-libvirt-0.0.32/lib/vagrant-libvirt/action/create_network_interfaces.rb:138:in `call'
    from /usr/share/vagrant/lib/vagrant/action/warden.rb:34:in `call'
    from /home/budhram/.vagrant.d/gems/gems/vagrant-libvirt-0.0.32/lib/vagrant-libvirt/action/create_networks.rb:79:in `call'
    from /usr/share/vagrant/lib/vagrant/action/warden.rb:34:in `call'
    from /home/budhram/.vagrant.d/gems/gems/vagrant-libvirt-0.0.32/lib/vagrant-libvirt/action/share_folders.rb:20:in `call'
    from /usr/share/vagrant/lib/vagrant/action/warden.rb:34:in `call'
    from /home/budhram/.vagrant.d/gems/gems/vagrant-libvirt-0.0.32/lib/vagrant-libvirt/action/prepare_nfs_settings.rb:18:in `call'
    from /usr/share/vagrant/lib/vagrant/action/warden.rb:34:in `call'
    from /home/budhram/.vagrant.d/gems/gems/vagrant-registration-1.2.1/lib/vagrant-registration/action/register.rb:17:in `call'
    from /usr/share/vagrant/lib/vagrant/action/warden.rb:34:in `call'
    from /usr/share/vagrant/lib/vagrant/action/builtin/synced_folders.rb:87:in `call'
    from /usr/share/vagrant/lib/vagrant/action/warden.rb:34:in `call'
    from /usr/share/vagrant/lib/vagrant/action/builtin/synced_folder_cleanup.rb:28:in `call'
    from /usr/share/vagrant/lib/vagrant/action/warden.rb:34:in `call'
    from /usr/share/vagrant/plugins/synced_folders/nfs/action_cleanup.rb:25:in `call'
    from /usr/share/vagrant/lib/vagrant/action/warden.rb:34:in `call'
    from /home/budhram/.vagrant.d/gems/gems/vagrant-libvirt-0.0.32/lib/vagrant-libvirt/action/prepare_nfs_valid_ids.rb:12:in `call'
    from /usr/share/vagrant/lib/vagrant/action/warden.rb:34:in `call'
    from /usr/share/vagrant/lib/vagrant/action/builtin/provision.rb:80:in `call'
    from /usr/share/vagrant/lib/vagrant/action/warden.rb:34:in `call'
    from /home/budhram/.vagrant.d/gems/gems/vagrant-libvirt-0.0.32/lib/vagrant-libvirt/action/create_domain.rb:201:in `call'
    from /usr/share/vagrant/lib/vagrant/action/warden.rb:34:in `call'
    from /home/budhram/.vagrant.d/gems/gems/vagrant-libvirt-0.0.32/lib/vagrant-libvirt/action/create_domain_volume.rb:51:in `call'
    from /usr/share/vagrant/lib/vagrant/action/warden.rb:34:in `call'
    from /home/budhram/.vagrant.d/gems/gems/vagrant-libvirt-0.0.32/lib/vagrant-libvirt/action/handle_box_image.rb:109:in `call'
    from /usr/share/vagrant/lib/vagrant/action/warden.rb:34:in `call'
    from /usr/share/vagrant/lib/vagrant/action/builtin/handle_box.rb:56:in `call'
    from /usr/share/vagrant/lib/vagrant/action/warden.rb:34:in `call'
    from /home/budhram/.vagrant.d/gems/gems/vagrant-libvirt-0.0.32/lib/vagrant-libvirt/action/handle_storage_pool.rb:50:in `call'
    from /usr/share/vagrant/lib/vagrant/action/warden.rb:34:in `call'
    from /home/budhram/.vagrant.d/gems/gems/vagrant-libvirt-0.0.32/lib/vagrant-libvirt/action/set_name_of_domain.rb:35:in `call'
    from /usr/share/vagrant/lib/vagrant/action/warden.rb:34:in `call'
    from /usr/share/vagrant/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /usr/share/vagrant/lib/vagrant/action/warden.rb:34:in `call'
    from /usr/share/vagrant/lib/vagrant/action/warden.rb:34:in `call'
    from /usr/share/vagrant/lib/vagrant/action/builder.rb:116:in `call'
    from /usr/share/vagrant/lib/vagrant/action/runner.rb:66:in `block in run'
    from /usr/share/vagrant/lib/vagrant/util/busy.rb:19:in `busy'
    from /usr/share/vagrant/lib/vagrant/action/runner.rb:66:in `run'
    from /usr/share/vagrant/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /usr/share/vagrant/lib/vagrant/action/warden.rb:34:in `call'
    from /usr/share/vagrant/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
    from /usr/share/vagrant/lib/vagrant/action/warden.rb:34:in `call'
    from /usr/share/vagrant/lib/vagrant/action/builder.rb:116:in `call'
    from /usr/share/vagrant/lib/vagrant/action/runner.rb:66:in `block in run'
    from /usr/share/vagrant/lib/vagrant/util/busy.rb:19:in `busy'
    from /usr/share/vagrant/lib/vagrant/action/runner.rb:66:in `run'
    from /usr/share/vagrant/lib/vagrant/machine.rb:224:in `action_raw'
    from /usr/share/vagrant/lib/vagrant/machine.rb:199:in `block in action'
    from /usr/share/vagrant/lib/vagrant/environment.rb:561:in `lock'
    from /usr/share/vagrant/lib/vagrant/machine.rb:185:in `call'
    from /usr/share/vagrant/lib/vagrant/machine.rb:185:in `action'
    from /usr/share/vagrant/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'

Also getting some warning while building gem from gemspec:

➜  fog-libvirt git:(fix-auth) gem build fog-libvirt.gemspec 
WARNING:  open-ended dependency on fog-json (>= 0) is not recommended
  if fog-json is semantically versioned, use:
    add_runtime_dependency 'fog-json', '~> 0'
WARNING:  open-ended dependency on json (>= 0) is not recommended
  if json is semantically versioned, use:
    add_runtime_dependency 'json', '~> 0'
WARNING:  open-ended dependency on minitest (>= 0, development) is not recommended
  if minitest is semantically versioned, use:
    add_development_dependency 'minitest', '~> 0'
WARNING:  open-ended dependency on minitest-stub-const (>= 0, development) is not recommended
  if minitest-stub-const is semantically versioned, use:
    add_development_dependency 'minitest-stub-const', '~> 0'
WARNING:  open-ended dependency on pry (>= 0, development) is not recommended
  if pry is semantically versioned, use:
    add_development_dependency 'pry', '~> 0'
WARNING:  open-ended dependency on rake (>= 0, development) is not recommended
  if rake is semantically versioned, use:
    add_development_dependency 'rake', '~> 0'
WARNING:  open-ended dependency on rubocop (>= 0, development) is not recommended
  if rubocop is semantically versioned, use:
    add_development_dependency 'rubocop', '~> 0'
WARNING:  open-ended dependency on simplecov (>= 0, development) is not recommended
  if simplecov is semantically versioned, use:
    add_development_dependency 'simplecov', '~> 0'
WARNING:  open-ended dependency on yard (>= 0, development) is not recommended
  if yard is semantically versioned, use:
    add_development_dependency 'yard', '~> 0'
WARNING:  pessimistic dependency on mocha (~> 1.1.0, development) may be overly strict
  if mocha is semantically versioned, use:
    add_development_dependency 'mocha', '~> 1.1', '>= 1.1.0'
WARNING:  See http://guides.rubygems.org/specification-reference/ for help
  Successfully built RubyGem
  Name: fog-libvirt
  Version: 0.0.4
  File: fog-libvirt-0.0.4.gem
dcbw commented 8 years ago

@budhrg Yes, that means that the fix is working, but you don't have the required ruby-libvirt patch.

dcbw commented 8 years ago

http://libvirt.org/git/?p=ruby-libvirt.git;a=commit;h=c2d4192ebf28b8030b753b715a72f0cdf725d313

dcbw commented 8 years ago

@strzibny any comments on this quick fix? Thanks!

dcbw commented 8 years ago

@plribeiro3000 any chance you could review and merge this? Thanks!

plribeiro3000 commented 8 years ago

LGTM! Thanks!

plribeiro3000 commented 8 years ago

@dcbw Released as 0.1.0.