def load_physical_driver(physical_driver=None): """Load ad physical driver module. Load the physical driver module specified by the physical_driver configuration option or, if supplied, the driver name supplied as an argument. :param physical_driver: a physical driver name to override the config opt. :returns: a PhysicalDriver interface. """ if not physical_driver: physical_driver = CONF.physical_driver if not physical_driver: LOG.warn(_("Physical driver option required, but not specified")) raise try: # If just write driver.CephDriver driver = importutils.import_object_ns('vsm.physical', physical_driver) return utils.check_isinstance(driver, PhysicalDriver) except ImportError: try: # If vsm.physical.driver.CephDriver driver = importutils.import_object(physical_driver) return utils.check_isinstance(driver, PhysicalDriver) except ImportError: LOG.exception(_("Unable to load the physical driver")) raise
def load_physical_driver(physical_driver=None): """Load ad physical driver module. Load the physical driver module specified by the physical_driver configuration option or, if supplied, the driver name supplied as an argument. :param physical_driver: a physical driver name to override the config opt. :returns: a PhysicalDriver interface. """ if not physical_driver: physical_driver = CONF.physical_driver if not physical_driver: LOG.warn(_("Physical driver option required, but not specified")) raise try: # If just write driver.CephDriver driver = importutils.import_object_ns("vsm.physical", physical_driver) return utils.check_isinstance(driver, PhysicalDriver) except ImportError: try: # If vsm.physical.driver.CephDriver driver = importutils.import_object(physical_driver) return utils.check_isinstance(driver, PhysicalDriver) except ImportError: LOG.exception(_("Unable to load the physical driver")) raise
def __init__(self, quota_driver_class=None): """Initialize a Quota object.""" if not quota_driver_class: quota_driver_class = FLAGS.quota_driver if isinstance(quota_driver_class, basestring): quota_driver_class = importutils.import_object(quota_driver_class) self._resources = {} self._driver = quota_driver_class
def _get_matchmaker(*args, **kwargs): global matchmaker if not matchmaker: matchmaker = importutils.import_object(CONF.rpc_zmq_matchmaker, *args, **kwargs) return matchmaker
def _get_matchmaker(*args, **kwargs): global matchmaker if not matchmaker: matchmaker = importutils.import_object( CONF.rpc_zmq_matchmaker, *args, **kwargs) return matchmaker