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
Fixes #30552 - Fix vmware vm cloning when volumes are not present #7942
Conversation
Issues: #30552 |
"datastore" => args[:volumes].empty? ? nil : args[:volumes].first[:datastore], | ||
"storage_pod" => args[:volumes].empty? ? nil : args[:volumes].first[:storage_pod], |
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 doesn't look like it's specific to hammer, would a clearer commit message be something like "fix vmware vm cloning when volumes are not present"?
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.
Yes, I agree I will change the commit message.
[test katello] |
[test katello] |
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.
@yifatmakias looks good!
can you add tests?
}, | ||
}, | ||
"provision_method" => "image" | ||
) |
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.
Layout/ClosingParenthesisIndentation: Indent ) to column 6 (not 4)
"_delete" => "", | ||
}, | ||
"0" => { | ||
"type" => "VirtualVmxnet3", |
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.
Layout/FirstHashElementIndentation: Use 2 spaces for indentation in a hash, relative to the start of the line where the left curly brace is.
"cpus" => "1", | ||
"interfaces_attributes" => { | ||
"new_interfaces" => { | ||
"type" => "VirtualE1000", |
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.
Layout/FirstHashElementIndentation: Use 2 spaces for indentation in a hash, relative to the start of the line where the left curly brace is.
"image_id" => "2", | ||
"cpus" => "1", | ||
"interfaces_attributes" => { | ||
"new_interfaces" => { |
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.
Layout/FirstHashElementIndentation: Use 2 spaces for indentation in a hash, relative to the start of the line where the left curly brace is.
}, | ||
) | ||
attrs_parsed = HashWithIndifferentAccess.new( | ||
"image_id" => "2", |
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.
Layout/FirstArgumentIndentation: Indent the first argument one step more than the start of the previous line.
"network" => "network-17", | ||
"_delete" => "", | ||
}, | ||
}, |
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.
Style/TrailingCommaInArguments: Avoid comma after the last parameter of a method call.
"_delete" => "", | ||
}, | ||
"0" => { | ||
"type" => "VirtualVmxnet3", |
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.
Layout/FirstHashElementIndentation: Use 2 spaces for indentation in a hash, relative to the start of the line where the left curly brace is.
"cpus" => "1", | ||
"interfaces_attributes" => { | ||
"new_interfaces" => { | ||
"type" => "VirtualE1000", |
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.
Layout/FirstHashElementIndentation: Use 2 spaces for indentation in a hash, relative to the start of the line where the left curly brace is.
"image_id" => "2", | ||
"cpus" => "1", | ||
"interfaces_attributes" => { | ||
"new_interfaces" => { |
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.
Layout/FirstHashElementIndentation: Use 2 spaces for indentation in a hash, relative to the start of the line where the left curly brace is.
@@ -218,6 +218,49 @@ class Foreman::Model::VmwareTest < ActiveSupport::TestCase | |||
assert_equal mock_vm, cr.create_vm(attrs_in) | |||
end | |||
|
|||
test "#clone_vm works with no volume attributes" do | |||
attrs_in = HashWithIndifferentAccess.new( | |||
"image_id" => "2", |
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.
Layout/FirstArgumentIndentation: Indent the first argument one step more than the start of the previous line.
@shiramax Added tests let me know if it is ok :) |
@yifatmakias code looks good, |
@yifatmakias we talked about this PR offline. good look good, merging this one. |
2.3 - fbbc297 |
No description provided.