Skip to content

Commit

Permalink
Merge pull request #207 from matobet/tomas-ccm
Browse files Browse the repository at this point in the history
rhv: removed the option to migrate the VMs outside of the cluster.
  • Loading branch information
himdel authored Jan 24, 2017
2 parents 17b4fb7 + 926812b commit 9e3eb7a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
11 changes: 11 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1790,6 +1790,17 @@ def task_supported?(typ)
end

vms = VmOrTemplate.where(:id => vm_ids)
if typ == "migrate"
# if one of the providers in question cannot support simultaneous migration of his subset of
# the selected VMs, we abort
if vms.group_by(&:ext_management_system).except(nil).any? do |ems, ems_vms|
ems.respond_to?(:supports_migrate_for_all?) && !ems.supports_migrate_for_all?(ems_vms)
end
add_flash(_("These VMs can not be migrated together."), :error)
return
end
end

vms.each do |vm|
if vm.respond_to?("supports_#{typ}?")
render_flash_not_applicable_to_model(typ) unless vm.send("supports_#{typ}?")
Expand Down
13 changes: 7 additions & 6 deletions app/views/miq_request/_prov_vm_migrate_dialog.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@
:label => _("Datacenter"),
:keys => keys})

- keys = [:cluster_filter, :placement_cluster_name]
= render(:partial => "/miq_request/prov_dialog_fieldset",
:locals => {:workflow => wf,
:dialog => dialog,
:label => title_for_cluster,
:keys => keys})
- if wf.field_supported(:cluster)
- keys = [:cluster_filter, :placement_cluster_name]
= render(:partial => "/miq_request/prov_dialog_fieldset",
:locals => {:workflow => wf,
:dialog => dialog,
:label => title_for_cluster,
:keys => keys})

- if wf.field_supported(:respool)
- keys = [:rp_filter, :placement_rp_name]
Expand Down

0 comments on commit 9e3eb7a

Please sign in to comment.