You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by lu...@redhat.com on 2011/05/05 00:42:03 UTC
[PATCH 1/5] * server/server.rb: do not use 'return' in respond_to blocks
From: David Lutterkort <lu...@redhat.com>
Because these blocks are stroed as procs, return in them doesn't do what
one would think; instead, they cause a return of the method calling the
Proc. There is actually no need to use return here.
Fixes https://issues.apache.org/jira/browse/DTACLOUD-37
Signed-off-by: David Lutterkort <lu...@redhat.com>
---
server/server.rb | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/server/server.rb b/server/server.rb
index c62e0d3..c48315b 100644
--- a/server/server.rb
+++ b/server/server.rb
@@ -343,9 +343,9 @@ collection :load_balancers do
control do
driver.destroy_load_balancer(credentials, params[:id])
respond_to do |format|
- format.xml { return 204 }
- format.json { return 204 }
- format.html { return redirect(load_balancers_url) }
+ format.xml { 204 }
+ format.json { 204 }
+ format.html { redirect(load_balancers_url) }
end
end
end
@@ -529,9 +529,9 @@ collection :storage_snapshots do
control do
driver.destroy_storage_snapshot(credentials, params)
respond_to do |format|
- format.xml { return 204 }
- format.json { return 204 }
- format.html { return redirect(storage_snapshots_url) }
+ format.xml { 204 }
+ format.json { 204 }
+ format.html { redirect(storage_snapshots_url) }
end
end
end
@@ -616,9 +616,9 @@ collection :storage_volumes do
control do
driver.destroy_storage_volume(credentials, params)
respond_to do |format|
- format.xml { return 204 }
- format.json { return 204 }
- format.html { return redirect(storage_volumes_url) }
+ format.xml { 204 }
+ format.json { 204 }
+ format.html { redirect(storage_volumes_url) }
end
end
end
--
1.7.4.4