-
Notifications
You must be signed in to change notification settings - Fork 897
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
Decide default destination folder for cloning #7150
Conversation
@@ -47,10 +47,6 @@ def prepare_for_clone_task | |||
cluster ? cluster.default_resource_pool : dest_host.default_resource_pool | |||
end |
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.
@bzwei In a separate PR, can we create a similar dest_resource_pool
method and move all this logic there?
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.
@chessbyte yes sir 👌
5291de5
to
873a714
Compare
|
||
host_dc = dest_host.parent_datacenter || dest_host.ems_cluster.parent_datacenter | ||
proposed_folder = "Datacenters/#{host_dc.name}/vm/Discovered virtual machine" | ||
EmsFolder.where(:name => 'Discovered virtual machine').detect do |f| |
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.
@bzwei VMware provisioning requires that a folder be passed so my concern is that the "Discovered virtual machine" folder may not exist for some reason. In that case we should drop back to use the root vm
folder.
I think the lookup logic should be move into a new method that we can call with each path and it would return the folder or nil.
Something like:
vm_folder = "Datacenters/#{host_dc.name}/vm"
find_dest_folder("#{vm_folder}/Discovered virtual machine") || find_dest_folder(vm_folder)
@bzwei This PR should also include the removal of the |
@gmcculloug I removed |
@bzwei The failing tests are in a context ( |
Checked commit bzwei@c755248 with ruby 2.2.3, rubocop 0.37.2, and haml-lint 0.16.1 spec/automation/unit/method_validation/vmware_best_fit_least_utilized_spec.rb
|
Decide default destination folder for cloning
https://bugzilla.redhat.com/show_bug.cgi?id=1313067