Skip to content

Commit

Permalink
Merge pull request #993 from pkliczewski/master
Browse files Browse the repository at this point in the history
Storage removal
(cherry picked from commit befd4da)

https://bugzilla.redhat.com/show_bug.cgi?id=1444889
  • Loading branch information
martinpovolny authored and simaishi committed Apr 24, 2017
1 parent 537fe10 commit 11807c9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/controllers/application_controller/ci_processing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2744,9 +2744,15 @@ def configuration_job_delete
# Delete all selected or single displayed datastore(s)
def deletestorages
assert_privileges("storage_delete")
storages = find_checked_ids_with_rbac(Storage)
unless Storage.batch_operation_supported?('delete', storages)
add_flash(_("Only storage without VMs and Hosts can be removed"), :error)
return
end

datastores = []
if %w(show_list storage_list storage_pod_list).include?(@lastaction) || (@lastaction == "show" && @layout != "storage") # showing a list, scan all selected hosts
datastores = find_checked_ids_with_rbac(Storage)
datastores = storages
if datastores.empty?
add_flash(_("No %{model} were selected for %{task}") % {:model => ui_lookup(:tables => "storage"), :task => display_name}, :error)
end
Expand Down

0 comments on commit 11807c9

Please sign in to comment.