incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject svn commit: r983022 - /incubator/deltacloud/trunk/server/lib/deltacloud/drivers/gogrid/gogrid_driver.rb
Date Fri, 06 Aug 2010 15:28:25 GMT
Author: mfojtik
Date: Fri Aug  6 15:28:24 2010
New Revision: 983022

URL: http://svn.apache.org/viewvc?rev=983022&view=rev
Log:
Throw a useful error from GoGrid when the name is too long.

Signed-off-by: Chris Lalancette <clalance@redhat.com>

Modified:
    incubator/deltacloud/trunk/server/lib/deltacloud/drivers/gogrid/gogrid_driver.rb

Modified: incubator/deltacloud/trunk/server/lib/deltacloud/drivers/gogrid/gogrid_driver.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/drivers/gogrid/gogrid_driver.rb?rev=983022&r1=983021&r2=983022&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/drivers/gogrid/gogrid_driver.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/drivers/gogrid/gogrid_driver.rb Fri Aug
 6 15:28:24 2010
@@ -83,6 +83,9 @@ class GogridDriver < Deltacloud::BaseDri
 
     client = new_client(credentials)
     name = (opts[:name] && opts[:name]!='') ? opts[:name] : get_random_instance_name
+    if name.length > 20
+      raise Deltacloud::BackendError.new(400, "name-too-long", "Name '#{name}' is too long;
the maximum for GoGrid is 20 characters", nil)
+    end
     safely do
       instance = client.request('grid/server/add', {
         'name' => name,



Mime
View raw message