def create_disk_from_distro(vm_, linode_id, swap_size=None):
 kwargs = {}
 if (swap_size is None):
  swap_size = get_swap_size(vm_)
 pub_key = get_pub_key(vm_)
 root_password = get_password(vm_)
 if pub_key:
  kwargs.update({'rootSSHKey': pub_key})
 if root_password:
  kwargs.update({'rootPass': root_password})
 else:
  raise SaltCloudConfigError('The Linode driver requires a password.')
 kwargs.update({'LinodeID': linode_id, 'DistributionID': get_distribution_id(vm_), 'Label': vm_['name'], 'Size': get_disk_size(vm_, swap_size, linode_id)})
 result = _query('linode', 'disk.createfromdistribution', args=kwargs)
 return _clean_data(result)

def create_disk_from_distro ( vm_ , linode_id , swap_size = None ) : kwargs = { } if ( swap_size is None ) : swap_size = get_swap_size ( vm_ ) pub_key = get_pub_key ( vm_ ) root_password = get_password ( vm_ ) if pub_key : kwargs . update ( { 'rootSSHKey' : pub_key } ) if root_password : kwargs . update ( { 'rootPass' : root_password } ) else : raise SaltCloudConfigError ( 'The Linode driver requires a password.' ) kwargs . update ( { 'LinodeID' : linode_id , 'DistributionID' : get_distribution_id ( vm_ ) , 'Label' : vm_ [ 'name' ] , 'Size' : get_disk_size ( vm_ , swap_size , linode_id ) } ) result = _query ( 'linode' , 'disk.createfromdistribution' , args = kwargs ) return _clean_data ( result )
creates the disk for the linode from the distribution .