From d79cffd595a00c899bc57ae8eea75d4853521f52 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Sun, 2 Aug 2015 20:51:29 +0200 Subject: [PATCH] Don't abuse kwargs, explicitly declare ex_custom_data argument. Also add a docstring for that argument. --- libcloud/compute/drivers/azure.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/libcloud/compute/drivers/azure.py b/libcloud/compute/drivers/azure.py index bda0ad3edf..37c806aba4 100644 --- a/libcloud/compute/drivers/azure.py +++ b/libcloud/compute/drivers/azure.py @@ -516,7 +516,8 @@ def list_volumes(self, node=None): 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 @@ def create_node(self, name, size, image, ex_cloud_service_name, 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 @@ def create_node(self, name, size, image, ex_cloud_service_name, 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 @@ def create_node(self, name, size, image, ex_cloud_service_name, ex_admin_user_id, password, False, - custom_data + ex_custom_data ) network_config.input_endpoints.items.append(endpoint)