mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Avoid crash caused by power management suspension where fog fails to translate domain state pmsuspended. Changed the driver.state() function so that it does not crash on undefined domain state. Just return nil :unknown instead. Added unittests and made existing more general. Closes #1472
This commit is contained in:
@@ -135,7 +135,9 @@ module VagrantPlugins
|
||||
end
|
||||
|
||||
# TODO: terminated no longer appears to be a valid fog state, remove?
|
||||
return :not_created if domain.nil? || domain.state.to_sym == :terminated
|
||||
return :not_created if domain.nil?
|
||||
return :unknown if domain.state.nil?
|
||||
return :not_created if domain.state.to_sym == :terminated
|
||||
|
||||
state = domain.state.tr('-', '_').to_sym
|
||||
if state == :running
|
||||
|
||||
Reference in New Issue
Block a user