"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "salt/cloud/clouds/azurearm.py" between
salt-2019.2.0.tar.gz and salt-2019.2.1.tar.gz

About: SaltStack is a systems management software for data center automation, cloud orchestration, server provisioning, configuration management and more. Community version.

azurearm.py  (salt-2019.2.0):azurearm.py  (salt-2019.2.1)
skipping to change at line 835 skipping to change at line 835
) )
ip_configurations = [ ip_configurations = [
NetworkInterfaceIPConfiguration( NetworkInterfaceIPConfiguration(
name='{0}-ip'.format(kwargs['iface_name']), name='{0}-ip'.format(kwargs['iface_name']),
subnet=subnet_obj, subnet=subnet_obj,
**ip_kwargs **ip_kwargs
) )
] ]
break break
except CloudError as exc: except CloudError as exc:
log.error('There was a cloud error: {0}'.format(exc)) log.error('There was a cloud error: %s', exc)
count += 1 count += 1
if count > 120: if count > 120:
raise ValueError('Timed out waiting for public IP Address.') raise ValueError('Timed out waiting for public IP Address.')
time.sleep(5) time.sleep(5)
else: else:
priv_ip_name = '{0}-ip'.format(kwargs['iface_name']) priv_ip_name = '{0}-ip'.format(kwargs['iface_name'])
ip_configurations = [ ip_configurations = [
NetworkInterfaceIPConfiguration( NetworkInterfaceIPConfiguration(
name=priv_ip_name, name=priv_ip_name,
subnet=subnet_obj, subnet=subnet_obj,
skipping to change at line 1017 skipping to change at line 1017
) )
disable_password_authentication = config.get_cloud_config_value( disable_password_authentication = config.get_cloud_config_value(
'disable_password_authentication', 'disable_password_authentication',
vm_, vm_,
__opts__, __opts__,
search_global=False, search_global=False,
default=False default=False
) )
vm_password = salt.utils.stringutils.to_str(
config.get_cloud_config_value(
'ssh_password', vm_, __opts__, search_global=True,
default=config.get_cloud_config_value(
'win_password', vm_, __opts__, search_global=True
)
)
)
os_kwargs = {} os_kwargs = {}
win_installer = config.get_cloud_config_value( win_installer = config.get_cloud_config_value(
'win_installer', vm_, __opts__, search_global=True 'win_installer', vm_, __opts__, search_global=True
) )
if not win_installer and ssh_publickeyfile_contents is not None: if not win_installer and ssh_publickeyfile_contents is not None:
sshpublickey = SshPublicKey( sshpublickey = SshPublicKey(
key_data=ssh_publickeyfile_contents, key_data=ssh_publickeyfile_contents,
path='/home/{0}/.ssh/authorized_keys'.format(vm_username), path='/home/{0}/.ssh/authorized_keys'.format(vm_username),
) )
sshconfiguration = SshConfiguration( sshconfiguration = SshConfiguration(
public_keys=[sshpublickey], public_keys=[sshpublickey],
) )
linuxconfiguration = LinuxConfiguration( linuxconfiguration = LinuxConfiguration(
disable_password_authentication=disable_password_authentication, disable_password_authentication=disable_password_authentication,
ssh=sshconfiguration, ssh=sshconfiguration,
) )
os_kwargs['linux_configuration'] = linuxconfiguration os_kwargs['linux_configuration'] = linuxconfiguration
vm_password = None
else:
vm_password = salt.utils.stringutils.to_str(
config.get_cloud_config_value(
'ssh_password', vm_, __opts__, search_global=True,
default=config.get_cloud_config_value(
'win_password', vm_, __opts__, search_global=True
)
)
)
if win_installer or (vm_password is not None and not disable_password_authen tication): if win_installer or (vm_password is not None and not disable_password_authen tication):
if not isinstance(vm_password, str): if not isinstance(vm_password, str):
raise SaltCloudSystemExit( raise SaltCloudSystemExit(
'The admin password must be a string.' 'The admin password must be a string.'
) )
if len(vm_password) < 8 or len(vm_password) > 123: if len(vm_password) < 8 or len(vm_password) > 123:
raise SaltCloudSystemExit( raise SaltCloudSystemExit(
'The admin password must be between 8-123 characters long.' 'The admin password must be between 8-123 characters long.'
) )
skipping to change at line 1309 skipping to change at line 1310
data_disks=data_disks, data_disks=data_disks,
image_reference=img_ref, image_reference=img_ref,
), ),
os_profile=OSProfile( os_profile=OSProfile(
admin_username=vm_username, admin_username=vm_username,
computer_name=vm_['name'], computer_name=vm_['name'],
**os_kwargs **os_kwargs
), ),
network_profile=NetworkProfile( network_profile=NetworkProfile(
network_interfaces=[ network_interfaces=[
NetworkInterfaceReference(vm_['iface_id']), NetworkInterfaceReference(id=vm_['iface_id']),
], ],
), ),
availability_set=availability_set, availability_set=availability_set,
) )
__utils__['cloud.fire_event']( __utils__['cloud.fire_event'](
'event', 'event',
'requesting instance', 'requesting instance',
'salt/cloud/{0}/requesting'.format(vm_['name']), 'salt/cloud/{0}/requesting'.format(vm_['name']),
args=__utils__['cloud.filter_event']( args=__utils__['cloud.filter_event'](
skipping to change at line 1393 skipping to change at line 1394
if not vm_request or 'error' in vm_request: if not vm_request or 'error' in vm_request:
err_message = 'Error creating VM {0}! ({1})'.format(vm_['name'], six.tex t_type(vm_request)) err_message = 'Error creating VM {0}! ({1})'.format(vm_['name'], six.tex t_type(vm_request))
log.error(err_message) log.error(err_message)
raise SaltCloudSystemExit(err_message) raise SaltCloudSystemExit(err_message)
def _query_node_data(name, bootstrap_interface): def _query_node_data(name, bootstrap_interface):
''' '''
Query node data. Query node data.
''' '''
data = show_instance(name, call='action') data = show_instance(name, call='action')
ip_address = None if not data:
if len(data.keys()) == 0:
return False return False
ip_address = None
if bootstrap_interface == 'public': if bootstrap_interface == 'public':
ip_address = data['public_ips'][0] ip_address = data['public_ips'][0]
if bootstrap_interface == 'private': if bootstrap_interface == 'private':
ip_address = data['private_ips'][0] ip_address = data['private_ips'][0]
if ip_address is None: if ip_address is None:
return False return False
return ip_address return ip_address
try: try:
data = salt.utils.cloud.wait_for_ip( data = salt.utils.cloud.wait_for_ip(
 End of changes. 6 change blocks. 
13 lines changed or deleted 14 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)