deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject git commit: DTACLOUD-457 RHEVm, Passing an invalid instance ID to start instance results in traceback with 500.
Date Mon, 11 Feb 2013 17:12:19 GMT
Updated Branches:
  refs/heads/master 2016f651f -> 9f8b70330


DTACLOUD-457 RHEVm, Passing an invalid instance ID to start instance results in traceback
with 500.

TrackedAt: http://tracker.deltacloud.org/patch/0f9ec84ff0ad613e28d1b49c3038a75010d56393


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/9f8b7033
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/9f8b7033
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/9f8b7033

Branch: refs/heads/master
Commit: 9f8b70330c25f6e747f3bfc85bca763a5d8e86f1
Parents: 2016f65
Author: Joe VLcek <jvlcek@redhat.com>
Authored: Fri Feb 8 09:39:39 2013 -0500
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Mon Feb 11 18:11:45 2013 +0100

----------------------------------------------------------------------
 server/lib/deltacloud/helpers/deltacloud_helper.rb |    4 +++-
 server/views/errors/403.xml.haml                   |    3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/9f8b7033/server/lib/deltacloud/helpers/deltacloud_helper.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/helpers/deltacloud_helper.rb b/server/lib/deltacloud/helpers/deltacloud_helper.rb
index 4575ae2..bb023af 100644
--- a/server/lib/deltacloud/helpers/deltacloud_helper.rb
+++ b/server/lib/deltacloud/helpers/deltacloud_helper.rb
@@ -140,7 +140,9 @@ module Deltacloud::Helpers
     end
 
     def instance_action(name)
-      original_instance = driver.instance(credentials, :id => params[:id])
+      unless original_instance = driver.instance(credentials, :id => params[:id])
+        return report_error(403)
+      end
 
       # If original instance doesn't include called action
       # return with 405 error (Method is not Allowed)

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/9f8b7033/server/views/errors/403.xml.haml
----------------------------------------------------------------------
diff --git a/server/views/errors/403.xml.haml b/server/views/errors/403.xml.haml
index 4b4cf23..274ce82 100644
--- a/server/views/errors/403.xml.haml
+++ b/server/views/errors/403.xml.haml
@@ -1,6 +1,7 @@
 %error{:url => "#{request.env['REQUEST_URI']}", :status => "#{response.status}"}
   %backend{ :driver => driver_symbol, :provider => "#{Thread::current[:provider] ||
ENV['API_PROVIDER'] || 'default'}" }
-  %backtrace=cdata(@error.backtrace.join("\n"))
+  - if @error.respond_to?(:backtrace) and !@error.backtrace.nil?
+    %backtrace=cdata(@error.backtrace.join("\n"))
   - if params
     %request
       - params.each do |k, v|


Mime
View raw message