示例#1
0
 def __init__(self, scheduler_driver=None, *args, **kwargs):
     super(ConsoleAuthManager, self).__init__(service_name='consoleauth',
                                              *args,
                                              **kwargs)
     self.mc = memorycache.get_client()
     self.compute_rpcapi = compute_rpcapi.ComputeAPI()
     self.cells_rpcapi = cells_rpcapi.CellsAPI()
示例#2
0
def _get_cache():
    global MC

    if MC is None:
        MC = memorycache.get_client()

    return MC
示例#3
0
def _get_cache():
    global MC

    if MC is None:
        MC = memorycache.get_client()

    return MC
示例#4
0
 def memoizer(context, reqid):
     global _CACHE
     if not _CACHE:
         _CACHE = memorycache.get_client()
     key = "%s:%s" % (func.__name__, reqid)
     key = str(key)
     value = _CACHE.get(key)
     if value is None:
         value = func(context, reqid)
         _CACHE.set(key, value, time=_CACHE_TIME)
     return value
示例#5
0
文件: mc.py 项目: hsluoyz/patron
 def __init__(self, *args, **kwargs):
     if not CONF.memcached_servers:
         raise RuntimeError(_('memcached_servers not defined'))
     self.mc = memorycache.get_client()
     self.db_allowed = kwargs.get('db_allowed', True)
     self.conductor_api = conductor.API(use_local=self.db_allowed)
示例#6
0
 def __init__(self):
     self._cache = memorycache.get_client()
     self.conductor_api = conductor.API()
示例#7
0
文件: handler.py 项目: hsluoyz/patron
 def __init__(self):
     self._cache = memorycache.get_client()
     self.conductor_api = conductor.API()
示例#8
0
 def __init__(self, application):
     """middleware can use fake for testing."""
     self.mc = memorycache.get_client()
     super(Lockout, self).__init__(application)
示例#9
0
文件: mc.py 项目: 2Exception/patron
 def __init__(self, *args, **kwargs):
     if not CONF.memcached_servers:
         raise RuntimeError(_('memcached_servers not defined'))
     self.mc = memorycache.get_client()
     self.db_allowed = kwargs.get('db_allowed', True)
     self.conductor_api = conductor.API(use_local=self.db_allowed)
示例#10
0
文件: manager.py 项目: hsluoyz/patron
 def __init__(self, scheduler_driver=None, *args, **kwargs):
     super(ConsoleAuthManager, self).__init__(service_name='consoleauth',
                                              *args, **kwargs)
     self.mc = memorycache.get_client()
     self.compute_rpcapi = compute_rpcapi.ComputeAPI()
     self.cells_rpcapi = cells_rpcapi.CellsAPI()
示例#11
0
 def __init__(self, application):
     """middleware can use fake for testing."""
     self.mc = memorycache.get_client()
     super(Lockout, self).__init__(application)