Skip to content

Commit

Permalink
Merge pull request #514 from fdupont-redhat/v2v_error_reporting_expos…
Browse files Browse the repository at this point in the history
…e_virtv2v_message

[V2V] Expose virt-v2v-wrapper error message in progress.states

(cherry picked from commit 23c5ae2)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1693747
  • Loading branch information
gmcculloug authored and simaishi committed Apr 4, 2019
1 parent 840b794 commit 3d9d3b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def main
@handle.set_state_var(:ae_state_progress, 'message' => message, 'percent' => percent.round(2))
set_retry
when 'failed'
@handle.set_state_var(:ae_state_progress, 'message' => 'Disks transformation failed.')
raise "Disks transformation failed."
message = @task.get_option(:virtv2v_message)
raise message
when 'succeeded'
@handle.set_state_var(:ae_state_progress, 'message' => 'Disks transformation succeeded.', 'percent' => 100)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@

context "conversion has failed" do
it "raises with a message stating conversion has failed" do
errormsg = 'virtv2v failed somehow'
ae_service.root['ae_state_retries'] = 2
allow(svc_model_task).to receive(:get_option).with(:virtv2v_status).and_return('failed')
errormsg = 'Disks transformation failed.'
allow(svc_model_task).to receive(:get_option).with(:virtv2v_message).and_return(errormsg)
expect { described_class.new(ae_service).main }.to raise_error(errormsg)
expect(ae_service.get_state_var(:ae_state_progress)).to eq('message' => errormsg)
end
Expand Down

0 comments on commit 3d9d3b3

Please sign in to comment.