deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core] RHEV-M: Properly capture the RHEV-M error for user_data (DTACLOUD-153)
Date Mon, 05 Mar 2012 15:14:20 GMT
From: Michal Fojtik <mfojtik@redhat.com>

Previosly when client launched an instance and use user_data attribute
against RHEV-M provider that does not have floppyinject hook installed,
client got an 'Unhandled exception' error with 500 (Internal Server Error)
response.
This patch will add correct response 501 (Not supported) and properly
capture the underlaying exception.

Signed-off-by: Michal fojtik <mfojtik@redhat.com>
---
 .../lib/deltacloud/drivers/rhevm/rhevm_driver.rb   |    4 ++++
 .../lib/deltacloud/helpers/application_helper.rb   |    1 +
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb b/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
index 10ffef3..8a0764c 100644
--- a/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
+++ b/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
@@ -335,6 +335,10 @@ class RHEVMDriver < Deltacloud::BaseDriver
       status 401
     end
 
+    on /(not supported|custom properties are not configured)/ do
+      status 501
+    end
+
     on /(InternalServerError|nodename nor servname provided)/ do
       status 502
     end
diff --git a/server/lib/deltacloud/helpers/application_helper.rb b/server/lib/deltacloud/helpers/application_helper.rb
index 623fac8..e368103 100644
--- a/server/lib/deltacloud/helpers/application_helper.rb
+++ b/server/lib/deltacloud/helpers/application_helper.rb
@@ -266,6 +266,7 @@ module ApplicationHelper
       when 406; { :message => "Not Acceptable" }
       when 500; { :message => "Internal Server Error" }
       when 502; { :message => "Backend Server Error" }
+      when 501; { :message => "Not Supported" }
     end
   end
 
-- 
1.7.9.1


Mime
View raw message