internap / virtualpdu

A virtual power distribution unit (PDU) for controlling libvirt virtual machines via SNMP commands.
Apache License 2.0
3 stars 6 forks source link

Power off when libvirt is already off should not crash #30

Closed fbouliane closed 7 years ago

fbouliane commented 7 years ago

The power on has a try-except but not the power off. Since snmp is udp the same request can come in multiple times. It makes ironic fail with this error [2]. This code [1] should be changed.

[1] https://github.com/internap/virtualpdu/blob/cc3540d92141efb5aa55b66170fe2c55adac43b2/virtualpdu/drivers/libvirt_driver.py#L34-L46 [2] https://gist.github.com/fbouliane/f78f31b60598d76ba8446fbc167b18ec

mat128 commented 7 years ago

Interesting. Confirmed

idjaw commented 7 years ago

The Integration test currently cannot easily replicate this. As an easy test simply doing two consecutive power off, does not replicate the issue.