deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject [6/6] git commit: RHEV-M: Return 400 when API_PROVIDER is not set
Date Tue, 13 Mar 2012 17:28:31 GMT
RHEV-M: Return 400 when API_PROVIDER is not set


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

Branch: refs/heads/master
Commit: 7ab6f2281eef162c48adb761cbae13c2b3b34624
Parents: cd8f414
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Tue Mar 13 12:53:50 2012 +0100
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Tue Mar 13 18:29:13 2012 +0100

----------------------------------------------------------------------
 .../lib/deltacloud/drivers/rhevm/rhevm_driver.rb   |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/7ab6f228/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb b/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
index ac4fe72..05fdbaf 100644
--- a/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
+++ b/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
@@ -206,8 +206,9 @@ class RHEVMDriver < Deltacloud::BaseDriver
   private
 
   def new_client(credentials)
-    url, datacenter = api_provider.split(';')
     safely do
+      raise 'No API provider set for this request.' unless api_provider
+      url, datacenter = api_provider.split(';')
       OVIRT::Client.new(credentials.user, credentials.password, url, datacenter)
     end
   end
@@ -348,7 +349,7 @@ class RHEVMDriver < Deltacloud::BaseDriver
       status 500
     end
 
-    on /(Bad Request|Parameter name)/ do
+    on /(Bad Request|Parameter name|No API provider)/ do
       status 400
     end
 


Mime
View raw message