-
Notifications
You must be signed in to change notification settings - Fork 1k
Fixes #37834 - Set Firmware selection correct #10529
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -148,8 +148,11 @@ def new_vm(attr = { }) | |
| opts[:boot_order] = %w[hd] | ||
| opts[:boot_order].unshift 'network' unless attr[:image_id] | ||
|
|
||
| firmware_type = opts.delete(:firmware_type).to_s | ||
| opts.merge!(process_firmware_attributes(opts[:firmware], firmware_type)) | ||
| source = opts.delete(:source).to_s | ||
| unless source == 'compute_profile' | ||
|
Comment on lines
+151
to
+152
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You only set the source in the form, but how will that play with the API? It feels to me we're breaking some layers here: the controller should ensure the model is passed correct data.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, the main problem is, that the same form is used for Compute Profiles and Create Host and, that the this magic In my opinion, the I have not tested it right now, but when used with the API, the source should be nil and therefore the Update. tested with hammer:
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
You're right: it should only be made concrete when the compute resource is touched.
Is that tested with the patch? Could you also test creation of the compute profile with firmware set to automatic? My expectation is that it'll store
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it is with the patch. Here some more tests with the patch: with automatic: with bios: the same thing happens without this PR, too BUT: |
||
| firmware_type = opts.delete(:firmware_type).to_s | ||
| opts.merge!(process_firmware_attributes(opts[:firmware], firmware_type)) | ||
| end | ||
|
|
||
| vm = client.servers.new opts | ||
| vm.memory = opts[:memory] if opts[:memory] | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.