Skip to content

Commit

Permalink
quick fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MelsHyrule committed Mar 31, 2022
1 parent 209e14b commit 5c3968e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/api/cloud_volumes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def create_backup_resource(type, id, data)
end

def attach_resource(type, id, data = {})
api_resource(type, id, "Attaching Resource to", :supports => :attach) do |cloud_volume|
api_resource(type, id, "Attaching Resource to", :supports => :attach_volume) do |cloud_volume|
raise BadRequestError, "Must specify a vm_id" if data["vm_id"].blank?
vm = resource_search(data["vm_id"], :vms)
{:task_id => cloud_volume.attach_volume_queue(User.current_userid, vm.ems_ref)}
Expand All @@ -59,7 +59,7 @@ def attach_resource(type, id, data = {})
end

def detach_resource(type, id, data = {})
api_resource(type, id, "Detaching Resource from", :supports => :detach) do |cloud_volume|
api_resource(type, id, "Detaching Resource from", :supports => :detach_volume) do |cloud_volume|
raise BadRequestError, "Must specify a vm_id" if data["vm_id"].blank?
vm = resource_search(data["vm_id"], :vms)
{:task_id => cloud_volume.detach_volume_queue(User.current_userid, vm.ems_ref)}
Expand Down

0 comments on commit 5c3968e

Please sign in to comment.