Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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