From 4ab2e7f8ffc7966555fe9cfaa396e69dbe04b0e4 Mon Sep 17 00:00:00 2001 From: Gregor Berginc Date: Mon, 20 Mar 2017 21:35:50 +0100 Subject: [PATCH] Enable attach/detach operations to storage manager Attaching volume is currently not possible from within the list of cloud volumes of a chosen storage manager because the handler in `ems_common` does not have a path for the button (even though attach/detach option is enabled). This patch adds the missing handlers and redirects to the required `cloud_volume` controller. --- app/controllers/ems_common.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/ems_common.rb b/app/controllers/ems_common.rb index 4c2b84964e1..333121bb639 100644 --- a/app/controllers/ems_common.rb +++ b/app/controllers/ems_common.rb @@ -454,6 +454,10 @@ def button javascript_redirect :controller => "cloud_tenant", :action => "edit", :id => find_checked_items[0] elsif params[:pressed] == "cloud_volume_new" javascript_redirect :controller => "cloud_volume", :action => "new", :storage_manager_id => params[:id] + elsif params[:pressed] == "cloud_volume_attach" + javascript_redirect :controller => "cloud_volume", :action => "attach", :id => find_checked_items[0] + elsif params[:pressed] == "cloud_volume_detach" + javascript_redirect :controller => "cloud_volume", :action => "detach", :id => find_checked_items[0] elsif params[:pressed] == "cloud_volume_edit" javascript_redirect :controller => "cloud_volume", :action => "edit", :id => find_checked_items[0] elsif params[:pressed].ends_with?("_edit") || ["#{pfx}_miq_request_new", "#{pfx}_clone",