mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Make failure to apply XML domain update non fatal (#1581)
As this is the first time people may be alerted to an issue applying changes, given that previously they would be silently discarded, better to switch to warning the end user rather than blocking the domain start. This is no worse than the previous position, and allows previous configurations that were understood to be working, to continue to work as they are, with hopefully issues logged by users that will allow more correct XML to be sent before making failure to match the changes applied fatal.
This commit is contained in:
@@ -438,16 +438,17 @@ module VagrantPlugins
|
||||
|
||||
error_msg = "Libvirt failed to fully update the domain with the specified XML. Result differs from requested:\n" +
|
||||
"--- requested\n+++ result\n#{diff}\n" +
|
||||
"Typically this means there is a bug in the XML being sent, please log an issue"
|
||||
"Typically this means there is a bug in the XML being sent, please log an issue as this will halt machine start in the future."
|
||||
|
||||
env[:ui].error("Updated domain settings did not fully apply, attempting restore to previous definition: #{error_msg}")
|
||||
begin
|
||||
env[:machine].provider.driver.connection.define_domain(descr)
|
||||
rescue Fog::Errors::Error => e
|
||||
env[:ui].error("Failed to restore previous domain definition: #{e.message}")
|
||||
end
|
||||
env[:ui].warn(error_msg)
|
||||
#env[:ui].error("Updated domain settings did not fully apply, attempting restore to previous definition: #{error_msg}")
|
||||
#begin
|
||||
# env[:machine].provider.driver.connection.define_domain(descr)
|
||||
#rescue Fog::Errors::Error => e
|
||||
# env[:ui].error("Failed to restore previous domain definition: #{e.message}")
|
||||
#end
|
||||
|
||||
raise Errors::UpdateServerError, error_message: error_msg
|
||||
#raise Errors::UpdateServerError, error_message: error_msg
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user