Пример #1
0
def _get_impl():
    """
    Get the RPC backend
    """
    global _RPCIMPL
    if _RPCIMPL is None:
        try:
            #TODO
            _RPCIMPL = importutils.import_module(cfg.CONF.rpc_backend)
        except ImportError:
            impl = "glance.rpc.impl_kombu"
            _RPCIMPL = importutils.import_module(impl)

    return _RPCIMPL
Пример #2
0
def _get_impl():
    
    """
    Get the RPC backend
    """
    global _RPCIMPL
    if _RPCIMPL is None:
        try:
#TODO
            _RPCIMPL = importutils.import_module(cfg.CONF.rpc_backend)
        except ImportError:
            impl = "glance.rpc.impl_kombu"
            _RPCIMPL = importutils.import_module(impl)

    return _RPCIMPL
Пример #3
0
 def __init__(self, *args, **kwargs):
     self.regexlist = CONF.regex
     self.driver = importutils.import_module(CONF.GlanceAgentDriver)
     self.GlanceAPI = rpcapi.API()
     self.GlanceSystemList = CONF.GlanceSystemList
     self.uptime = self.driver.getUptime()
     self.lastcheck = self.driver.getNow()
     super(GlanceAgentManager, self).__init__(*args, **kwargs)
Пример #4
0
 def __init__(self, *args, **kwargs):
     self.regexlist = CONF.regex
     self.driver = importutils.import_module(CONF.GlanceAgentDriver)
     self.GlanceAPI = rpcapi.API()
     self.GlanceSystemList = CONF.GlanceSystemList
     self.uptime = self.driver.getUptime()
     self.lastcheck = self.driver.getNow()
     super(GlanceAgentManager, self).__init__(*args, **kwargs)
Пример #5
0
 def _get_classes_from_module(self, module_name):
     """Get the classes from a module that match the type we want."""
     classes = []
     module = importutils.import_module(module_name)
     for obj_name in dir(module):
         # Skip objects that are meant to be private.
         if obj_name.startswith('_'):
             continue
         itm = getattr(module, obj_name)
         if self._is_correct_class(itm):
             classes.append(itm)
     return classes
Пример #6
0
 def _get_classes_from_module(self, module_name):
     """Get the classes from a module that match the type we want."""
     classes = []
     module = importutils.import_module(module_name)
     for obj_name in dir(module):
         # Skip objects that are meant to be private.
         if obj_name.startswith('_'):
             continue
         itm = getattr(module, obj_name)
         if self._is_correct_class(itm):
             classes.append(itm)
     return classes
Пример #7
0
 def __init__(self, *args, **kwargs):
     self.driver = importutils.import_module(CONF.GlanceDBDriver)
     #self.GlanceAPI = rpcapi.API()
     super(GlancePullManager, self).__init__(*args, **kwargs)
Пример #8
0
 def __init__(self, *args, **kwargs):
     self.driver = importutils.import_module(CONF.GlanceDBDriver)
     #self.GlanceAPI = rpcapi.API()
     super(GlancePullManager, self).__init__(*args, **kwargs)
Пример #9
0
 def __init__(self, *args, **kwargs):
     self.driver = importutils.import_module(CONF.GlanceAgentDriver)
     super(GlancePushManager, self).__init__(*args, **kwargs)