deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject [2/3] git commit: SBC: Make sure the hwp_id is not Nil when creating new instance (DTACLOUD-388)
Date Thu, 06 Dec 2012 10:51:56 GMT
SBC: Make sure the hwp_id is not Nil when creating new instance (DTACLOUD-388)


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

Branch: refs/heads/master
Commit: 13f5477034ef8335721c589b4539b23deb28e10c
Parents: 882cede
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Wed Dec 5 18:03:41 2012 +0100
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Thu Dec 6 11:51:20 2012 +0100

----------------------------------------------------------------------
 server/lib/deltacloud/drivers/sbc/sbc_driver.rb |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/13f54770/server/lib/deltacloud/drivers/sbc/sbc_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/sbc/sbc_driver.rb b/server/lib/deltacloud/drivers/sbc/sbc_driver.rb
index 2e09a15..c994064 100644
--- a/server/lib/deltacloud/drivers/sbc/sbc_driver.rb
+++ b/server/lib/deltacloud/drivers/sbc/sbc_driver.rb
@@ -87,7 +87,11 @@ class SbcDriver < Deltacloud::BaseDriver
     # Map DeltaCloud keywords to SBC
     body['imageID'] = opts[:image_id]
     body['location'] = opts[:realm_id] || @last_image['location']
-    body['instanceType'] = opts[:hwp_id].gsub('-', '/') || @last_image['supportedInstanceTypes'][0]['id']
+    if opts[:hwp_id]
+      body['instanceType'] = opts[:hwp_id].gsub('-', '/')
+    else
+      body['instanceType'] = @last_image['supportedInstanceTypes'][0]['id']
+    end
 
     if not body['name']
       body['name'] = Time.now.to_i.to_s


Mime
View raw message