Dear Deltacloud mailing-list,
This is my first mail and patch, please don't bite.
I've been using deltacloud for a few months now to interact with Opennebula
implementations (version 3.4, but that should not matter for this patch)
and EC2 implementations. It seems that deltacloud fails to give any results
if one of the VMs running on the Opennebula cloud provider does not have
any instance_type (this can/will happen if you start VMs using the 'onevm
create' command).
This patch is trivial so I guess/hope it will not break any tests, but I am
not able to run these yet (don't know how -- sorry).
Also, not quite sure how to properly create a patch as this is my first
patch ever, I hope this is correct.
With kind regards,
Johannes Bertens
--- opennebula_driver.rb.old 2012-07-19 13:24:28.000000000 +0200
+++ opennebula_driver.rb.new 2012-07-24 10:55:57.000000000 +0200
@@ -240,12 +240,17 @@ class OpennebulaDriver < Deltacloud::Bas
if computehash['DISK/STORAGE']
image_id =
computehash['DISK/STORAGE'].attributes['href'].split("/").last
end
+
+ instance_profile = nil
+ if computehash['INSTANCE_TYPE']
+ instance_profile = computehash['INSTANCE_TYPE'].text||'small'
+ end
Instance.new( {
:id=>computehash['ID'].text,
:owner_id=>credentials.user,
:name=>computehash['NAME'].text,
:image_id=>image_id,
-
:instance_profile=>InstanceProfile.new(computehash['INSTANCE_TYPE'].text||'small'),
+ :instance_profile=>InstanceProfile.new(instance_profile),
:realm_id=>'ONE',
:state=>VM_STATES[computehash['STATE'].text],
:public_addresses=>network,