def get_backend_api(cluster_id):
 backend_config_filename = environ.get('FLOCKER_ACCEPTANCE_TEST_VOLUME_BACKEND_CONFIG')
 if (backend_config_filename is None):
  raise SkipTest('This test requires the ability to construct an IBlockDeviceAPI in order to verify construction. Please set FLOCKER_ACCEPTANCE_TEST_VOLUME_BACKEND_CONFIG to a yaml filepath with the dataset configuration.')
 backend_name = environ.get('FLOCKER_ACCEPTANCE_VOLUME_BACKEND')
 if (backend_name is None):
  raise SkipTest(('Set acceptance testing volume backend using the ' + 'FLOCKER_ACCEPTANCE_VOLUME_BACKEND environment variable.'))
 if (backend_name in ('loopback', 'zfs')):
  raise SkipTest("The loopback backend API can't be used remotely.")
 backend_config_filepath = FilePath(backend_config_filename)
 full_backend_config = yaml.safe_load(backend_config_filepath.getContent())
 backend_config = full_backend_config.get(backend_name)
 if ('backend' in backend_config):
  backend_config.pop('backend')
 backend = backend_loader.get(backend_name)
 return get_api(backend, pmap(backend_config), reactor, cluster_id)

def get_backend_api ( cluster_id ) : backend_config_filename = environ . get ( 'FLOCKER_ACCEPTANCE_TEST_VOLUME_BACKEND_CONFIG' ) if ( backend_config_filename is None ) : raise SkipTest ( 'This test requires the ability to construct an IBlockDeviceAPI in order to verify construction. Please set FLOCKER_ACCEPTANCE_TEST_VOLUME_BACKEND_CONFIG to a yaml filepath with the dataset configuration.' ) backend_name = environ . get ( 'FLOCKER_ACCEPTANCE_VOLUME_BACKEND' ) if ( backend_name is None ) : raise SkipTest ( ( 'Set acceptance testing volume backend using the ' + 'FLOCKER_ACCEPTANCE_VOLUME_BACKEND environment variable.' ) ) if ( backend_name in ( 'loopback' , 'zfs' ) ) : raise SkipTest ( "The loopback backend API can't be used remotely." ) backend_config_filepath = FilePath ( backend_config_filename ) full_backend_config = yaml . safe_load ( backend_config_filepath . getContent ( ) ) backend_config = full_backend_config . get ( backend_name ) if ( 'backend' in backend_config ) : backend_config . pop ( 'backend' ) backend = backend_loader . get ( backend_name ) return get_api ( backend , pmap ( backend_config ) , reactor , cluster_id )
get an appropriate backendapi for the specified dataset backend .