incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@apache.org
Subject svn commit: r962328 - in /incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rimuhosting: rimuhosting_client.rb rimuhosting_driver.rb
Date Thu, 08 Jul 2010 23:46:38 GMT
Author: lutter
Date: Thu Jul  8 23:46:38 2010
New Revision: 962328

URL: http://svn.apache.org/viewvc?rev=962328&view=rev
Log:
Fixes to rimuhosting driver - mainly typos - added grabbing IP address from rimu response

This patch contains minor edits to rimuhosting driver. Note that this relies on the rimuhosting
driver already having been renamed (a previous patch did rimu/rimu_hosting_client/driver.rb
---> rimuhosting/rimuhosting_client/driver.rb... edits:

Driver:
* fix typo in hardware_profiles
* add grabbing of IP address in convert_srv_to_instance

Client:
* edit initialize (credentials.provided? removed) to stop thin from exploding
* typo in request (DeltaCloud ==> Deltacloud)

Modified:
    incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rimuhosting/rimuhosting_client.rb
    incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rimuhosting/rimuhosting_driver.rb

Modified: incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rimuhosting/rimuhosting_client.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rimuhosting/rimuhosting_client.rb?rev=962328&r1=962327&r2=962328&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rimuhosting/rimuhosting_client.rb
(original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rimuhosting/rimuhosting_client.rb
Thu Jul  8 23:46:38 2010
@@ -31,10 +31,7 @@ class RimuHostingClient
     @uri = URI.parse(baseuri)
     @service = Net::HTTP.new(@uri.host, @uri.port)
     @service.use_ssl = true
-    if credentials.provided?
-      @auth = "rimuhosting apikey=#{credentials.password}"
-    end
-
+    @auth = "rimuhosting apikey=#{credentials.password}"
   end
 
   def request(resource, data='', method='GET')
@@ -47,8 +44,9 @@ class RimuHostingClient
     res = JSON.parse(r.body)
     res = res[res.keys[0]]
 
-    if(res['response_type'] == "ERROR" and res['error_info']['error_class'] == "PermissionException")
-      raise DeltaCloud::AuthException.new
+    if(res['response_type'] == "ERROR" and ( (res['error_info']['error_class'] == "PermissionException")
or
+					     (res['error_info']['error_class'] == "LoginRequired") )) 
+      raise Deltacloud::AuthException.new
     end
     res
   end
@@ -58,7 +56,6 @@ class RimuHostingClient
   end
 
   def list_plans
-    puts "testsdasfdsf"
     request('/pricing-plans;server-type=VPS')["pricing_plan_infos"]
   end
 

Modified: incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rimuhosting/rimuhosting_driver.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rimuhosting/rimuhosting_driver.rb?rev=962328&r1=962327&r2=962328&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rimuhosting/rimuhosting_driver.rb
(original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rimuhosting/rimuhosting_driver.rb
Thu Jul  8 23:46:38 2010
@@ -51,8 +51,8 @@ class RimuHostingDriver < Deltacloud::Ba
       #        not contained in hte pricing_plan_infos
       HardwareProfile.new(plan["pricing_plan_code"]) do
         memory plan["minimum_memory_mb"].to_f
-        storage => plan["minimum_disk_gb"].to_i
-        architecture => "x86"
+        storage plan["minimum_disk_gb"].to_i
+        architecture "x86"
       end
     end
     filter_hardware_profiles(results, opts)
@@ -118,7 +118,8 @@ class RimuHostingDriver < Deltacloud::Ba
             :realm_id => "RH",
             :owner_id => "root",
             :instance_profile => InstanceProfile.new("none"),
-            :actions => instance_actions_for("RUNNING")
+            :actions => instance_actions_for("RUNNING"),
+            :public_addresses => inst["allocated_ips"]["primary_ip"]
     })
   end
 



Mime
View raw message