fog / fog-libvirt

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

dhcp_leases.rb:8:in `dhcp_leases': undefined method `dhcp_leases' for #<Libvirt::Network:0x00000003ea12f0> (NoMethodError) #27

Closed infernix closed 6 years ago

infernix commented 7 years ago

virNetworkGetDHCPLeases isn't supported in libvirt < 1.2.6 so on distros carrying older libvirt, everything compiles but then using this call fails with above error.

This was introduced in PR #11

I think a few things could be done:

  1. Start depending on a specific libvirt version (depending on just ruby-libvirt doesn't seem to be enough)
  2. Test if the method exists before calling it and then fail with a descriptive error if it doesn't
  3. Support old and new behaviour (ugh)

Thoughts?

plribeiro3000 commented 7 years ago

Hey @infernix . Thanks for the feedback.

I believe option 2 would be the best option as we don't have an active maintainer on this repo.

Would you be able to do a patch and submit a PR for this change?

infernix commented 7 years ago

@plribeiro3000 the little time I have for coding I'm spending on vagrant-libvirt, so can't make any promises but will take a look.

plribeiro3000 commented 7 years ago

Awesome. Thank you! :+1:

Em seg, 17 de out de 2016 08:12, Gerben Meijer notifications@github.com escreveu:

@plribeiro3000 https://github.com/plribeiro3000 the little time I have for coding I'm spending on vagrant-libvirt, so can't make any promises but will take a look.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/fog/fog-libvirt/issues/27#issuecomment-254167646, or mute the thread https://github.com/notifications/unsubscribe-auth/AApEuDd9KhICtmHfeVdFhGWjrzswtstQks5q00n4gaJpZM4KUxSd .