예제 #1
0
 def _load_dynamic_class(self, module_name, class_prefix, base_name,
                         namespace):
     """Try to load a datastore specific class if it exists; use the
     default otherwise.
     """
     try:
         # This is for overridden Runner classes
         impl = self._build_class_path(module_name, class_prefix, base_name)
         return Strategy.get_strategy(impl, namespace)
     except ImportError:
         pass
     try:
         # This is for overridden Helper classes
         module = module_name.replace('test', class_prefix.lower())
         impl = self._build_class_path(module, class_prefix, base_name,
                                       strip_test=True)
         return Strategy.get_strategy(impl, namespace)
     except ImportError:
         # Just import the base class
         impl = self._build_class_path(module_name, '', base_name)
         return Strategy.get_strategy(impl, namespace)
예제 #2
0
 def _load_dynamic_class(self, module_name, class_prefix, base_name,
                         namespace):
     """Try to load a datastore specific class if it exists; use the
     default otherwise.
     """
     try:
         # This is for overridden Runner classes
         impl = self._build_class_path(module_name, class_prefix, base_name)
         return Strategy.get_strategy(impl, namespace)
     except ImportError:
         pass
     try:
         # This is for overridden Helper classes
         module = module_name.replace('test', class_prefix.lower())
         impl = self._build_class_path(module, class_prefix, base_name,
                                       strip_test=True)
         return Strategy.get_strategy(impl, namespace)
     except ImportError:
         # Just import the base class
         impl = self._build_class_path(module_name, '', base_name)
         return Strategy.get_strategy(impl, namespace)
예제 #3
0
def get_restore_strategy(restore_driver, ns=__name__):
    LOG.debug("Getting restore strategy: %s." % restore_driver)
    return Strategy.get_strategy(restore_driver, ns)
예제 #4
0
파일: __init__.py 프로젝트: zn-share/trove
def get_replication_strategy(replication_driver, ns=__name__):
    LOG.debug("Getting replication strategy: %s.", replication_driver)
    return Strategy.get_strategy(replication_driver, ns)
예제 #5
0
파일: __init__.py 프로젝트: tattabbum/trove
def get_backup_strategy(backup_driver, ns=__name__):
    LOG.debug("Getting backup strategy: %s" % backup_driver)
    return Strategy.get_strategy(backup_driver, ns)
예제 #6
0
def get_storage_strategy(storage_driver, ns=__name__):
    LOG.debug("Getting storage strategy: %s" % storage_driver)
    return Strategy.get_strategy(storage_driver, ns)
예제 #7
0
파일: __init__.py 프로젝트: cp16net/trove
def get_restore_strategy(restore_driver, ns=__name__):
    LOG.debug("Getting restore strategy: %s." % restore_driver)
    return Strategy.get_strategy(restore_driver, ns)
예제 #8
0
파일: __init__.py 프로젝트: magictour/trove
def get_strategy_cls(replication_driver, ns=__name__):
    return Strategy.get_strategy(replication_driver, ns)
예제 #9
0
def get_strategy_cls(replication_driver, ns=__name__):
    return Strategy.get_strategy(replication_driver, ns)