libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject git commit: LIBCLOUD-550_DisplayName
Date Tue, 06 May 2014 08:53:01 GMT
Repository: libcloud
Updated Branches:
  refs/heads/trunk 4f5a7e5f9 -> b20c62a97


LIBCLOUD-550_DisplayName

Added support for "displayname" CloudStack deployment parameter and removed automatic setting
of "name" parameter.

This will allow for deployment of instances without a hostname, but with a displayname, so
that you can have multiple tenants using the same displayname with unique hostnames being
generated from the instance UUID.

Closes #289

Signed-off-by: Tomaz Muraus <tomaz@apache.org>


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

Branch: refs/heads/trunk
Commit: b20c62a97167d71fe1fc3f7ba4bc2938476d7042
Parents: 4f5a7e5
Author: Jeff Moody <fifthecho@gmail.com>
Authored: Mon May 5 14:05:30 2014 -0400
Committer: Tomaz Muraus <tomaz@apache.org>
Committed: Tue May 6 10:47:57 2014 +0200

----------------------------------------------------------------------
 CHANGES.rst                            |  8 ++++++++
 libcloud/compute/drivers/cloudstack.py | 11 ++++++++---
 2 files changed, 16 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/b20c62a9/CHANGES.rst
----------------------------------------------------------------------
diff --git a/CHANGES.rst b/CHANGES.rst
index 382c987..3d295d9 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -101,6 +101,14 @@ Compute
   (GITHUB-277)
   [Matt Lehman]
 
+- Allow user to specify "displayname" attribute when creating a CloudStack node
+  by passing "ex_displayname" argument to the method.
+
+  Also allow "name" argument to be empty (None). This way CloudStack
+  automatically uses Node's UUID for the name.
+  (GITHUB-289)
+  [Jeff Moody]
+
 Load Balancer
 ~~~~~~~~~~~~~
 

http://git-wip-us.apache.org/repos/asf/libcloud/blob/b20c62a9/libcloud/compute/drivers/cloudstack.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/cloudstack.py b/libcloud/compute/drivers/cloudstack.py
index cd0cc3e..0cd48e8 100644
--- a/libcloud/compute/drivers/cloudstack.py
+++ b/libcloud/compute/drivers/cloudstack.py
@@ -700,6 +700,9 @@ class CloudStackNodeDriver(CloudStackDriverMixIn, NodeDriver):
                                         the node
         :type       ex_security_groups: ``list`` of ``str``
 
+        :keyword    ex_displayname: String containing instance display name
+        :type       ex_displayname: ``str``
+
         :rtype:     :class:`.CloudStackNode`
         """
 
@@ -712,9 +715,7 @@ class CloudStackNodeDriver(CloudStackDriverMixIn, NodeDriver):
         return node
 
     def _create_args_to_params(self, node, **kwargs):
-        server_params = {
-            'name': kwargs.get('name'),
-        }
+        server_params = {}
 
         # TODO: Refactor and use "kwarg_to_server_params" map
         name = kwargs.get('name', None)
@@ -727,10 +728,14 @@ class CloudStackNodeDriver(CloudStackDriverMixIn, NodeDriver):
         ex_key_name = kwargs.get('ex_keyname', None)
         ex_user_data = kwargs.get('ex_userdata', None)
         ex_security_groups = kwargs.get('ex_security_groups', None)
+        ex_displayname = kwargs.get('ex_displayname', None)
 
         if name:
             server_params['name'] = name
 
+        if ex_displayname:
+            server_params['displayname'] = ex_displayname
+
         if size:
             server_params['serviceofferingid'] = size.id
 


Mime
View raw message