-
Notifications
You must be signed in to change notification settings - Fork 898
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
Default to resource name for conversion hosts #18516
Conversation
@fdupont-redhat @mturley Please take a look. |
Checked commits https://github.com/djberg96/manageiq/compare/cf1aa8c6df1f9de30956e391a52f065fa01d4355~...ec9b8d5ed388d49839e855cf8436e2d7c3b23190 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
let(:ems) { FactoryBot.create(:ems_redhat, :zone => FactoryBot.create(:zone), :api_version => '4.2.4') } | ||
let(:redhat_host) { FactoryBot.create(:host_redhat, :name => 'foo', :ext_management_system => ems) } | ||
|
||
it "defaults to the associated resource name if no name is explicitly provided" do |
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.
Don't you also test with an OpenStack VM as resource ?
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.
For purposes of a validation spec it's not really necessary. We mostly just want to make sure the name is set, regardless of the associated resource type.
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.
Ok. Then LGTM.
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.
Works on my end 👍
@miq-bot add_label hammer/yes |
@miq-bot add_label transformation, enhancement |
@djberg96 this looks like it'd be far simpler to handle on the |
@agrare Sorry, not sure what you mean by "on the ConversionHost.create!()" side. You want me to redefine the |
Definitely not I mean name is just another parameter to |
I feel that approach makes the model less robust, and I would have to set it in the rest api, and both the |
Why in all of these places? enable/enable_queue just take |
Ok, but I still prefer this approach since it works no matter how a conversion host is created instead of tinkering with a single method. |
Default to resource name for conversion hosts (cherry picked from commit 297f4c2) https://bugzilla.redhat.com/show_bug.cgi?id=1696437 Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1693715
Hammer backport details:
|
Based on feedback from the V2V team, a conversion host should default to the associated resource name if no name is explicitly specified. This PR modifies the
ConversionHost
model so that it does just that on creation.https://bugzilla.redhat.com/show_bug.cgi?id=1689894
https://bugzilla.redhat.com/show_bug.cgi?id=1695797