libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject [1/4] libcloud git commit: Added support for custom data in create_node function for Azure driver
Date Sun, 02 Aug 2015 19:00:59 GMT
Repository: libcloud
Updated Branches:
  refs/heads/trunk b3ca86bf8 -> 6e749d64b


Added support for custom data in create_node function for Azure driver

Closes #554

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


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

Branch: refs/heads/trunk
Commit: 20ebeff6118f3f95afe6c15660dc00d5497f1d95
Parents: b3ca86b
Author: dwilson2038 <david.wilson2038@gmail.com>
Authored: Tue Jul 28 18:21:23 2015 +0000
Committer: Tomaz Muraus <tomaz@tomaz.me>
Committed: Sun Aug 2 20:59:21 2015 +0200

----------------------------------------------------------------------
 libcloud/compute/drivers/azure.py | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/20ebeff6/libcloud/compute/drivers/azure.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/azure.py b/libcloud/compute/drivers/azure.py
index a9b249e..bda0ad3 100644
--- a/libcloud/compute/drivers/azure.py
+++ b/libcloud/compute/drivers/azure.py
@@ -579,6 +579,10 @@ class AzureNodeDriver(NodeDriver):
         auth = self._get_and_check_auth(auth)
         password = auth.password
 
+        # Check for custom data
+        custom_data = None
+        if 'custom_data' in kwargs:
+            custom_data = kwargs['custom_data']
         if not isinstance(size, NodeSize):
             raise ValueError('Size must be an instance of NodeSize')
 
@@ -663,7 +667,8 @@ class AzureNodeDriver(NodeDriver):
                 name,
                 ex_admin_user_id,
                 password,
-                False
+                False,
+                custom_data
             )
 
         network_config.input_endpoints.items.append(endpoint)
@@ -2300,6 +2305,12 @@ class AzureXmlSerializer(object):
                 )
                 AzureXmlSerializer.data_to_xml([('Path', key.path)], kpair)
 
+        if configuration.custom_data is not None:
+            AzureXmlSerializer.data_to_xml(
+                [('CustomData', configuration.custom_data)],
+                xml
+            )
+
         return xml
 
     @staticmethod
@@ -2781,7 +2792,8 @@ class LinuxConfigurationSet(WindowsAzureData):
                  host_name=None,
                  user_name=None,
                  user_password=None,
-                 disable_ssh_password_authentication=None):
+                 disable_ssh_password_authentication=None,
+                 custom_data=None):
         self.configuration_set_type = 'LinuxProvisioningConfiguration'
         self.host_name = host_name
         self.user_name = user_name
@@ -2789,6 +2801,7 @@ class LinuxConfigurationSet(WindowsAzureData):
         self.disable_ssh_password_authentication = \
             disable_ssh_password_authentication
         self.ssh = SSH()
+        self.custom_data = custom_data
 
 
 class WindowsConfigurationSet(WindowsAzureData):


Mime
View raw message