You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by ma...@apache.org on 2013/03/05 18:21:53 UTC

git commit: Opennebula: Fix when computehash['INSTANCE_TYPE'] is nil

Updated Branches:
  refs/heads/master 955789adf -> 3d52adde4


Opennebula: Fix when computehash['INSTANCE_TYPE'] is nil


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

Branch: refs/heads/master
Commit: 3d52adde4b1c4383512b8e2e255c41d784186818
Parents: 955789a
Author: Christian Karnath <ch...@2kit.de>
Authored: Wed Feb 6 17:06:55 2013 +0100
Committer: marios <ma...@redhat.com>
Committed: Tue Mar 5 19:20:51 2013 +0200

----------------------------------------------------------------------
 .../drivers/opennebula/opennebula_driver.rb        |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/3d52adde/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 85b263a..92d55db 100644
--- a/server/lib/deltacloud/drivers/opennebula/opennebula_driver.rb
+++ b/server/lib/deltacloud/drivers/opennebula/opennebula_driver.rb
@@ -240,12 +240,17 @@ class OpennebulaDriver < Deltacloud::BaseDriver
     if computehash['DISK/STORAGE']
       image_id = computehash['DISK/STORAGE'].attributes['href'].split("/").last
     end
+    if computehash['INSTANCE_TYPE']
+      instance_profile = computehash['INSTANCE_TYPE'].text
+    else
+      instance_profile = '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,