Skip to content

Commit

Permalink
Merge pull request #14887 from syncrou/revert_get_folder_paths
Browse files Browse the repository at this point in the history
Revert removal of get_folder_paths
(cherry picked from commit 385a06c)

https://bugzilla.redhat.com/show_bug.cgi?id=1445804
  • Loading branch information
gmcculloug authored and simaishi committed Apr 26, 2017
1 parent 716c70f commit 59ca8f4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/models/mixins/miq_provision_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,18 @@ def set_folder(folder)
result.tap { set_resource(result) }
end

def get_folder_paths
# If the host is selected we need to limit the folders returned based on the data-center
# the host is in. Otherwise we return all folders in all data-centers.
host = get_option(:placement_host_name)
if host.nil?
vm_template.ext_management_system.get_folder_paths
else
dest_host = Host.find(host)
vm_template.ext_management_system.get_folder_paths(dest_host.owning_datacenter)
end
end

def get_source_vm
vm_id = get_option(:src_vm_id)
raise _("Source VM not provided") if vm_id.nil?
Expand Down

0 comments on commit 59ca8f4

Please sign in to comment.