Ensure XML diff output if not fully applied (#1576)

Make sure to perform a diff of the actual XML strings and not the object
representations if encountering the bug where the XML failed to be
updated correctly.
This commit is contained in:
Darragh Bailey
2022-09-03 15:01:03 +01:00
committed by GitHub
parent c28aca9d21
commit cede7fff8b
2 changed files with 2 additions and 2 deletions

View File

@@ -435,7 +435,7 @@ module VagrantPlugins
if proposed != applied
require 'diffy'
diff = Diffy::Diff.new(proposed, applied, :context => 3).to_s(:text)
diff = Diffy::Diff.new(proposed.to_str, applied.to_str, :context => 3).to_s(:text)
error_msg = "Libvirt failed to fully update the domain with the specified XML. Result differs from requested:\n" +
"--- requested\n+++ result\n#{diff}\n" +

View File

@@ -88,7 +88,7 @@ describe VagrantPlugins::ProviderLibvirt::Action::StartDomain do
end
it 'should error and revert the update' do
expect(ui).to receive(:error)
expect(ui).to receive(:error).with(/\+ <cpu mode="host-passthrough" \/>.*Typically this means there is a bug in the XML being sent, please log an issue/m)
expect(connection).to receive(:define_domain).and_return(libvirt_domain)
expect(connection).to receive(:define_domain).with(domain_xml) # undo
expect(libvirt_domain).to receive(:xml_desc).and_return(domain_xml, updated_domain_xml)