You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by mf...@apache.org on 2012/12/03 16:55:21 UTC

git commit: fgcp: generate default instance name using timestamp if not user-specified

Updated Branches:
  refs/heads/master 317dca79e -> 63da4da92


fgcp: generate default instance name using timestamp if not user-specified


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

Branch: refs/heads/master
Commit: 63da4da92804f2e424faf067a416633f692b3692
Parents: 317dca7
Author: Dies Koper <di...@fast.au.fujitsu.com>
Authored: Fri Nov 30 01:23:48 2012 +0900
Committer: Michal fojtik <mf...@redhat.com>
Committed: Mon Dec 3 16:55:08 2012 +0100

----------------------------------------------------------------------
 server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb |    2 +-
 tests/README                                      |    3 ++-
 tests/config.yaml                                 |   11 +++++++++++
 3 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/63da4da9/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb b/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb
index 262ea97..873fdf2 100644
--- a/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb
+++ b/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb
@@ -343,7 +343,7 @@ class FgcpDriver < Deltacloud::BaseDriver
   # Create a new instance, given an image id
   # opts can include an optional name for the instance, hardware profile (hwp_id) and realm_id
   def create_instance(credentials, image_id, opts={})
-    name = opts[:name]
+    name = (opts[:name] && opts[:name].length > 0)? opts[:name] : "server_#{Time.now.to_s}"
     # default to 'economy' or obtain latest hardware profiles and pick the lowest spec profile?
     hwp = opts[:hwp_id] || 'economy'
     network_id = opts[:realm_id]

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/63da4da9/tests/README
----------------------------------------------------------------------
diff --git a/tests/README b/tests/README
index 68c0ffa..9107c13 100644
--- a/tests/README
+++ b/tests/README
@@ -32,8 +32,9 @@ RUNNING the tests:
 CONFIGURATION - the config.yaml file:
 =====================================
 
+* a space between colon and value is mandatory
 * api_url - set this to the URI for the running deltacloud server
-* each driver has it's own section... enter credentials for the driver
+* each driver has its own section... enter credentials for the driver
   you expect to be running at api_url. If there is no section for your driver,
   add it - the section should have the name used by the deltacloud server for that
   driver. For example for the rhevm driver:

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/63da4da9/tests/config.yaml
----------------------------------------------------------------------
diff --git a/tests/config.yaml b/tests/config.yaml
index 9e21c9f..b567923 100644
--- a/tests/config.yaml
+++ b/tests/config.yaml
@@ -29,6 +29,17 @@ ec2:
     image: "ami-2b5fba42"
     hardware_profile: "m1.small"
     realm: "us-east-1b"
+#FGCP DRIVER CONFIG:
+fgcp:
+  user:
+  password:
+  #used for instances tests:
+  preferred:
+    provider: "au"
+    image: "IMG_3c9820_D30U8UNY6I9S"
+    hardware_profile: "economy"
+    realm: "UZXC0GRT-ZG8ZJCJ07"
+
 
 # CIMI testing
 cimi: