def _determine_storage_repo(session, resource_pool, vm_):
    '''
    Called by create() used to determine storage repo for create
    '''
    storage_repo = ''
    if 'storage_repo' in vm_.keys():
        storage_repo = _get_sr(vm_['storage_repo'], session)
    else:
        storage_repo = None
        if resource_pool:
            default_sr = session.xenapi.pool.get_default_SR(resource_pool)
            sr_record = session.xenapi.SR.get_record(default_sr)
            log.debug('storage repository: %s', sr_record['name_label'])
            storage_repo = default_sr
        else:
            storage_repo = None
    log.debug('storage repository: %s', storage_repo)
    return storage_repo
def _determine_storage_repo ( session , resource_pool , vm_ ) : storage_repo = '' if 'storage_repo' in vm_ . keys ( ) : storage_repo = _get_sr ( vm_ [ 'storage_repo' ] , session ) else : storage_repo = None if resource_pool : default_sr = session . xenapi . pool . get_default_SR ( resource_pool ) sr_record = session . xenapi . SR . get_record ( default_sr ) log . debug ( 'storage repository: %s' , sr_record [ 'name_label' ] ) storage_repo = default_sr else : storage_repo = None log . debug ( 'storage repository: %s' , storage_repo ) return storage_repo
Called by create() used to determine storage repo for create