incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject svn commit: r1129074 - /incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
Date Mon, 30 May 2011 08:59:23 GMT
Author: mfojtik
Date: Mon May 30 08:59:23 2011
New Revision: 1129074

URL: http://svn.apache.org/viewvc?rev=1129074&view=rev
Log:
Display relevant error message when character limit is exceed for instance name in RHEV-M
(DTACLOUD-41)

Modified:
    incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb

Modified: incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb?rev=1129074&r1=1129073&r2=1129074&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb Mon May
30 08:59:23 2011
@@ -168,6 +168,9 @@ class RHEVMDriver < Deltacloud::BaseDriv
   def create_instance(credentials, image_id, opts={})
     client = new_client(credentials)
     params = {}
+    if opts[:name] && opts[:name].length > 50
+      raise "Parameter name must be shorter than 50 characters"
+    end
     safely do
       params[:name] = opts[:name] if opts[:name]
       params[:realm_id] = opts[:realm_id] if opts[:realm_id]
@@ -295,6 +298,10 @@ class RHEVMDriver < Deltacloud::BaseDriv
       status 500
     end
 
+    on /Parameter name/ do
+      status 400
+    end
+
   end
 
 end



Mime
View raw message