libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject libcloud git commit: Added User Data support for Digital Ocean v2 driver
Date Wed, 05 Aug 2015 21:13:44 GMT
Repository: libcloud
Updated Branches:
  refs/heads/trunk b079a012e -> 64c70ce6a


Added User Data support for Digital Ocean v2 driver

Closes #559

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/64c70ce6
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/64c70ce6
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/64c70ce6

Branch: refs/heads/trunk
Commit: 64c70ce6ab4abf7c395b177f902e7186e9eb67f4
Parents: b079a01
Author: dwilson2038 <david.wilson2038@gmail.com>
Authored: Tue Aug 4 13:54:34 2015 +0000
Committer: Tomaz Muraus <tomaz@apache.org>
Committed: Wed Aug 5 23:08:47 2015 +0200

----------------------------------------------------------------------
 CHANGES.rst                              |  5 +++++
 libcloud/compute/drivers/digitalocean.py | 21 +++++++++++++++++++--
 2 files changed, 24 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/64c70ce6/CHANGES.rst
----------------------------------------------------------------------
diff --git a/CHANGES.rst b/CHANGES.rst
index 96509b0..1747320 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -258,6 +258,11 @@ Compute
   (LIBCLOUD-724, GITHUB-551)
   [David Wilson]
 
+- Add support for passing user data when creating a DigitalOcean node
+  (``ex_user_data`` argument).
+  (LIBCLOUD-731, GITHUB-559)
+  [David Wilson]
+
 Storage
 ~~~~~~~
 

http://git-wip-us.apache.org/repos/asf/libcloud/blob/64c70ce6/libcloud/compute/drivers/digitalocean.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/digitalocean.py b/libcloud/compute/drivers/digitalocean.py
index 05bb61c..83b23f6 100644
--- a/libcloud/compute/drivers/digitalocean.py
+++ b/libcloud/compute/drivers/digitalocean.py
@@ -336,19 +336,36 @@ class DigitalOcean_v2_NodeDriver(DigitalOcean_v2_BaseDriver,
         data = self.connection.request('/v2/sizes').object['sizes']
         return list(map(self._to_size, data))
 
-    def create_node(self, name, size, image, location, ex_ssh_key_ids=None):
+    def create_node(self, name, size, image, location,
+                    ex_ssh_key_ids=None, ex_user_data=None):
         """
         Create a node.
 
+        :keyword    name: Name of the node to be created.
+        :type       name: ``str``
+
+        :keyword    size: Size of the node.
+        :type       size: ``NodeSize``
+
+        :keyword    image: Image to be used to create node.
+        :type       image: ``NodeImage``
+
+        :keyword    location: Location where the node will be created.
+        :type       location: ``NodeLocation``
+
         :keyword    ex_ssh_key_ids: A list of ssh key ids which will be added
                                    to the server. (optional)
         :type       ex_ssh_key_ids: ``list`` of ``str``
 
+        :keyword    ex_user_data:  User data to be added to the node on create.
+                                     (optional)
+        :type       ex_user_data:  ``str``
+
         :return: The newly created node.
         :rtype: :class:`Node`
         """
         attr = {'name': name, 'size': size.name, 'image': image.id,
-                'region': location.id}
+                'region': location.id, 'user_data': ex_user_data}
 
         if ex_ssh_key_ids:
             attr['ssh_keys'] = ex_ssh_key_ids


Mime
View raw message