Skip to content
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

Storage removal #993

Merged
merged 1 commit into from
Apr 24, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion app/controllers/application_controller/ci_processing.rb
Original file line number Diff line number Diff line change
@@ -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