deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject git commit: Fix minor bugs in OpenNebula driver
Date Wed, 14 Mar 2012 11:04:25 GMT
Updated Branches:
  refs/heads/master d4076e1a5 -> 3bfdaf5a4


Fix minor bugs in OpenNebula driver

Signed-off-by: Daniel Molina <dmolina@opennebula.org>


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

Branch: refs/heads/master
Commit: 3bfdaf5a419c713a032680326af6d25d969825a2
Parents: d4076e1
Author: Daniel Molina <dmolina@opennebula.org>
Authored: Tue Feb 28 17:34:49 2012 +0100
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Wed Mar 14 12:05:16 2012 +0100

----------------------------------------------------------------------
 .../deltacloud/drivers/opennebula/occi_client.rb   |    6 ++++--
 .../drivers/opennebula/opennebula_driver.rb        |    9 +++++----
 2 files changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/3bfdaf5a/server/lib/deltacloud/drivers/opennebula/occi_client.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/opennebula/occi_client.rb b/server/lib/deltacloud/drivers/opennebula/occi_client.rb
index 574cb88..8688995 100644
--- a/server/lib/deltacloud/drivers/opennebula/occi_client.rb
+++ b/server/lib/deltacloud/drivers/opennebula/occi_client.rb
@@ -69,7 +69,7 @@ module OCCIClient
     # Retieves the available Instance types
     ######################################################################
     def get_instance_types
-      get('/instance_type')
+      get('/instance_type?verbose=yes')
     end
 
     ######################################################################
@@ -277,7 +277,9 @@ module OCCIClient
 
     def get(path)
       url = URI.parse(@endpoint+path)
-      req = Net::HTTP::Get.new(url.path)
+      path = url.path
+      path << "?#{url.query}" if url.query
+      req = Net::HTTP::Get.new(path)
 
       do_request(url, req)
     end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/3bfdaf5a/server/lib/deltacloud/drivers/opennebula/opennebula_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/opennebula/opennebula_driver.rb b/server/lib/deltacloud/drivers/opennebula/opennebula_driver.rb
index 3b00eca..3ffdd12 100644
--- a/server/lib/deltacloud/drivers/opennebula/opennebula_driver.rb
+++ b/server/lib/deltacloud/drivers/opennebula/opennebula_driver.rb
@@ -234,6 +234,7 @@ class OpennebulaDriver < Deltacloud::BaseDriver
       :owner_id=>credentials.user,
       :state=>"AVAILABLE",
       :architecture=>storage['ARCH'],
+      :hardware_profiles=>hardware_profiles(credentials)
     } )
   end
 
@@ -243,7 +244,7 @@ class OpennebulaDriver < Deltacloud::BaseDriver
     computehash = compute.root.elements
 
     network = []
-    computehash.each('NIC/IP') {|ip| network<<InstanceAddress.new(ip)}
+    computehash.each('NIC/IP') {|ip| network<<InstanceAddress.new(ip.text, :type =>
:ipv4)}
 
     image_id = nil
     if computehash['DISK/STORAGE']
@@ -255,11 +256,11 @@ class OpennebulaDriver < Deltacloud::BaseDriver
       :owner_id=>credentials.user,
       :name=>computehash['NAME'].text,
       :image_id=>image_id,
-      :instance_profile=>InstanceProfile.new(computehash['INSTANCE_TYPE']||'small'),
+      :instance_profile=>InstanceProfile.new(computehash['INSTANCE_TYPE'].text||'small'),
       :realm_id=>'ONE',
       :state=>VM_STATES[computehash['STATE'].text],
-      :public_addreses=>network,
-      :private_addreses=>[],
+      :public_addresses=>network,
+      :private_addresses=>[],
       :actions=> instance_actions_for( VM_STATES[computehash['STATE'].text] )
     } )
   end


Mime
View raw message