def load_class_by_alias_or_classname(namespace, name):
 if (not name):
  LOG.error(_LE('Alias or class name is not set'))
  raise ImportError(_('Class not found.'))
 try:
  mgr = _SilentDriverManager(namespace, name)
  class_to_load = mgr.driver
 except RuntimeError:
  e1_info = sys.exc_info()
  try:
   class_to_load = importutils.import_class(name)
  except (ImportError, ValueError):
   LOG.error(_LE('Error loading class by alias'), exc_info=e1_info)
   LOG.error(_LE('Error loading class by class name'), exc_info=True)
   raise ImportError(_('Class not found.'))
 return class_to_load

def load_class_by_alias_or_classname ( namespace , name ) : if ( not name ) : LOG . error ( _LE ( 'Alias or class name is not set' ) ) raise ImportError ( _ ( 'Class not found.' ) ) try : mgr = _SilentDriverManager ( namespace , name ) class_to_load = mgr . driver except RuntimeError : e1_info = sys . exc_info ( ) try : class_to_load = importutils . import_class ( name ) except ( ImportError , ValueError ) : LOG . error ( _LE ( 'Error loading class by alias' ) , exc_info = e1_info ) LOG . error ( _LE ( 'Error loading class by class name' ) , exc_info = True ) raise ImportError ( _ ( 'Class not found.' ) ) return class_to_load
load class using stevedore alias or the class name .