in pygenie/auth.py [0:0]
def __init__(self, conf=None):
self._conf = conf or GenieConf()
self.auth_name = self._conf.get('genie.auth')
self.auth = None
if self.auth_name:
mod_name, cls_name = self.auth_name.rsplit('.', 1)
logger.debug('loading module: %s', mod_name)
mod = __import__(mod_name, fromlist=[cls_name])
try:
cls = getattr(mod, cls_name)
logger.debug('setting auth to: %s', cls)
self.auth = cls(conf=self._conf, **self._conf.genie_auth.to_dict())
except AttributeError:
logger.warning('%s not found in module %s (auth set to None).',
cls_name,
mod_name)