def load_drivers(service_type, plugin):
 service_type_manager = sdb.ServiceTypeManager.get_instance()
 providers = service_type_manager.get_service_providers(None, filters={'service_type': [service_type]})
 if (not providers):
  msg = (_LE("No providers specified for '%s' service, exiting") % service_type)
  LOG.error(msg)
  raise SystemExit(1)
 drivers = {}
 for provider in providers:
  try:
   drivers[provider['name']] = importutils.import_object(provider['driver'], plugin)
   LOG.debug("Loaded '%(provider)s' provider for service %(service_type)s", {'provider': provider['driver'], 'service_type': service_type})
  except ImportError:
   with excutils.save_and_reraise_exception():
    LOG.exception(_LE("Error loading provider '%(provider)s' for service %(service_type)s"), {'provider': provider['driver'], 'service_type': service_type})
 default_provider = None
 try:
  provider = service_type_manager.get_default_service_provider(None, service_type)
  default_provider = provider['name']
 except pconf.DefaultServiceProviderNotFound:
  LOG.info(_LI('Default provider is not specified for service type %s'), service_type)
 return (drivers, default_provider)

def load_drivers ( service_type , plugin ) : service_type_manager = sdb . ServiceTypeManager . get_instance ( ) providers = service_type_manager . get_service_providers ( None , filters = { 'service_type' : [ service_type ] } ) if ( not providers ) : msg = ( _LE ( "No providers specified for '%s' service, exiting" ) % service_type ) LOG . error ( msg ) raise SystemExit ( 1 ) drivers = { } for provider in providers : try : drivers [ provider [ 'name' ] ] = importutils . import_object ( provider [ 'driver' ] , plugin ) LOG . debug ( "Loaded '%(provider)s' provider for service %(service_type)s" , { 'provider' : provider [ 'driver' ] , 'service_type' : service_type } ) except ImportError : with excutils . save_and_reraise_exception ( ) : LOG . exception ( _LE ( "Error loading provider '%(provider)s' for service %(service_type)s" ) , { 'provider' : provider [ 'driver' ] , 'service_type' : service_type } ) default_provider = None try : provider = service_type_manager . get_default_service_provider ( None , service_type ) default_provider = provider [ 'name' ] except pconf . DefaultServiceProviderNotFound : LOG . info ( _LI ( 'Default provider is not specified for service type %s' ) , service_type ) return ( drivers , default_provider )
loads drivers for specific service .