incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Lalancette <clala...@redhat.com>
Subject [PATCH] Add max_length constraints to the user_name for various drivers.
Date Fri, 03 Jun 2011 13:38:19 GMT
Signed-off-by: Chris Lalancette <clalance@redhat.com>
---
 .../lib/deltacloud/drivers/gogrid/gogrid_driver.rb |    3 +++
 .../lib/deltacloud/drivers/rhevm/rhevm_driver.rb   |    4 +++-
 .../drivers/terremark/terremark_driver.rb          |    4 +++-
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/server/lib/deltacloud/drivers/gogrid/gogrid_driver.rb b/server/lib/deltacloud/drivers/gogrid/gogrid_driver.rb
index 7bae587..edca242 100644
--- a/server/lib/deltacloud/drivers/gogrid/gogrid_driver.rb
+++ b/server/lib/deltacloud/drivers/gogrid/gogrid_driver.rb
@@ -35,6 +35,9 @@ class GogridDriver < Deltacloud::BaseDriver
 
   feature :instances, :authentication_password
   feature :instances, :sandboxing
+  feature :instances, :user_name do
+    constraint :max_length, "20"
+  end
 
   def hardware_profiles(credentials, opts={})
     client = new_client(credentials)
diff --git a/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb b/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
index 40d814a..4930f3e 100644
--- a/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
+++ b/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
@@ -33,7 +33,9 @@ module Deltacloud
 
 class RHEVMDriver < Deltacloud::BaseDriver
 
-  feature :instances, :user_name
+  feature :instances, :user_name do
+    constraint :max_length, "50"
+  end
 
   # FIXME: These values are just for ilustration
   # Also I choosed 'SERVER' and 'DESKTOP' names
diff --git a/server/lib/deltacloud/drivers/terremark/terremark_driver.rb b/server/lib/deltacloud/drivers/terremark/terremark_driver.rb
index 88d3f47..32fceee 100644
--- a/server/lib/deltacloud/drivers/terremark/terremark_driver.rb
+++ b/server/lib/deltacloud/drivers/terremark/terremark_driver.rb
@@ -31,7 +31,9 @@ module Deltacloud
 
 class TerremarkDriver < Deltacloud::BaseDriver
 
-  feature :instances, :user_name
+  feature :instances, :user_name do
+    constraint :max_length, "15"
+  end
 
 #--
 # Vapp State Map... for use with convert_instance (get an integer back from terremark)
-- 
1.7.4.4


Mime
View raw message