You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2015/08/02 21:01:00 UTC

[2/4] libcloud git commit: Don't abuse kwargs, explicitly declare ex_custom_data argument.

Don't abuse kwargs, explicitly declare ex_custom_data argument.

Also add a docstring for that argument.


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

Branch: refs/heads/trunk
Commit: d79cffd595a00c899bc57ae8eea75d4853521f52
Parents: 20ebeff
Author: Tomaz Muraus <to...@tomaz.me>
Authored: Sun Aug 2 20:51:29 2015 +0200
Committer: Tomaz Muraus <to...@tomaz.me>
Committed: Sun Aug 2 20:59:23 2015 +0200

----------------------------------------------------------------------
 libcloud/compute/drivers/azure.py | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/d79cffd5/libcloud/compute/drivers/azure.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/azure.py b/libcloud/compute/drivers/azure.py
index bda0ad3..37c806a 100644
--- a/libcloud/compute/drivers/azure.py
+++ b/libcloud/compute/drivers/azure.py
@@ -516,7 +516,8 @@ class AzureNodeDriver(NodeDriver):
     def create_node(self, name, size, image, ex_cloud_service_name,
                     ex_storage_service_name=None, ex_new_deployment=False,
                     ex_deployment_slot="Production", ex_deployment_name=None,
-                    ex_admin_user_id="azureuser", auth=None, **kwargs):
+                    ex_admin_user_id="azureuser", ex_custom_data=None,
+                    auth=None, **kwargs):
         """
         Create Azure Virtual Machine
 
@@ -570,6 +571,10 @@ class AzureNodeDriver(NodeDriver):
                                          to using the Cloud Service name.
         :type        ex_deployment_name: ``str``
 
+        :type        ex_custom_data: ``str``
+        :keyword     ex_custom_data: Optional script or other data which is
+                                     injected into the VM when it's begining
+                                     provisioned.
 
         :keyword     ex_admin_user_id: Optional. Defaults to 'azureuser'.
         :type        ex_admin_user_id:  ``str``
@@ -579,10 +584,6 @@ 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')
 
@@ -668,7 +669,7 @@ class AzureNodeDriver(NodeDriver):
                 ex_admin_user_id,
                 password,
                 False,
-                custom_data
+                ex_custom_data
             )
 
         network_config.input_endpoints.items.append(endpoint)