-
Notifications
You must be signed in to change notification settings - Fork 120
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
Deny request if no conversion host is configured #455
Conversation
@miq-bot add-label transformation, enhancement, hammer/yes |
Checked commit fabiendupont@f9ac30a with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 content/automate/ManageIQ/Transformation/StateMachines/TransformationPlanRequestApproval.class/methods/deny_request.rb
|
@miq-bot add_label blocker |
exit MIQ_ABORT | ||
end | ||
|
||
request.source_vms.each { |vm| request.approve_vm(vm) if request.validate_vm(vm) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should eventually move to the backend, but not in this PR.
unless request.validate_conversion_hosts | ||
$evm.object['reason'] = 'No conversion host configured' | ||
request.message = 'No conversion host configured' | ||
exit MIQ_ABORT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tinaafitz @mkanoor Should this remain exit
or is it better to use raise
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gmcculloug It doesn't hurt to have the exit there, we solved the spec problem with the approach listed here
Line 81 in 166a3df
end.to raise_error(SystemExit) do |error| |
Which allows us to test different exit codes. So if there are specs for this change it should follow a similar pattern if the method is being tested directly outside of the DRb and Automate Engine framework.
Deny request if no conversion host is configured (cherry picked from commit 4d84575) https://bugzilla.redhat.com/show_bug.cgi?id=1640816
Hammer backport details:
|
This PR is the manageiq-content counterpart of ManageIQ/manageiq#18135. It checks the request and deny it if no conversion host is available. It also sets the message of the request, so that UI can display the information.
Associated RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1640816