Refactor storage-init command

Use internal API to get a reference to the storage backend and remove
the need to use stevedore.

Change-Id: Iade2b11e8a4b1fe5199b303c1ba537d89083154f
This commit is contained in:
Stéphane Albert 2016-05-18 16:41:11 +02:00
parent 72fa2e21ea
commit 8dc02eed7d
1 changed files with 3 additions and 12 deletions

View File

@ -15,22 +15,13 @@
#
# @author: Stéphane Albert
#
from oslo_config import cfg
from stevedore import driver
from cloudkitty import config # noqa
from cloudkitty import service
CONF = cfg.CONF
STORAGES_NAMESPACE = 'cloudkitty.storage.backends'
from cloudkitty import storage
def init_storage_backend():
CONF.import_opt('backend', 'cloudkitty.storage', 'storage')
backend = driver.DriverManager(
STORAGES_NAMESPACE,
CONF.storage.backend)
backend.driver.init()
backend = storage.get_storage()
backend.init()
def main():