Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions libcloud/compute/drivers/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,10 @@ 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')

Expand Down Expand Up @@ -663,7 +667,8 @@ def create_node(self, name, size, image, ex_cloud_service_name,
name,
ex_admin_user_id,
password,
False
False,
custom_data
)

network_config.input_endpoints.items.append(endpoint)
Expand Down Expand Up @@ -2300,6 +2305,12 @@ def linux_configuration_to_xml(configuration, xml):
)
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
Expand Down Expand Up @@ -2781,14 +2792,16 @@ def __init__(self,
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
self.user_password = user_password
self.disable_ssh_password_authentication = \
disable_ssh_password_authentication
self.ssh = SSH()
self.custom_data = custom_data


class WindowsConfigurationSet(WindowsAzureData):
Expand Down