def load_engine_driver(engine_driver):
"""Load a engine driver module.
Load the engine driver module specified by the engine_driver
configuration option or, if supplied, the driver name supplied as an
argument.
:param engine_driver: a engine driver name to override the config opt
:returns: a EngineDriver server
"""
if not engine_driver:
LOG.error("Engine driver option required, but not specified")
sys.exit(1)
LOG.info("Loading engine driver '%s'", engine_driver)
try:
driver = importutils.import_object(
'mogan.baremetal.%s' % engine_driver)
return utils.check_isinstance(driver, BaseEngineDriver)
except ImportError:
LOG.exception("Unable to load the baremetal driver")
sys.exit(1)
评论列表
文章目录