From 02f2ba049009a0f434bae59017e627e1675b12bb Mon Sep 17 00:00:00 2001 From: "Walter A. Boring IV" Date: Wed, 6 Feb 2019 19:58:40 +0000 Subject: [PATCH] Add driver_options This patch adds a new cinderlib base method to fetch a specific driver's driver options. This depends on a cinder patch here: https://review.openstack.org/635255 --- cinderlib/__init__.py | 1 + cinderlib/cinderlib.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/cinderlib/__init__.py b/cinderlib/__init__.py index 7648dd9..fc1b1e9 100644 --- a/cinderlib/__init__.py +++ b/cinderlib/__init__.py @@ -36,6 +36,7 @@ setup = cinderlib.setup Backend = cinderlib.Backend +driver_options = cinderlib.Backend.driver_options get_connector_properties = objects.brick_connector.get_connector_properties list_supported_drivers = cinderlib.Backend.list_supported_drivers diff --git a/cinderlib/cinderlib.py b/cinderlib/cinderlib.py index 0009b45..e9c2b1b 100644 --- a/cinderlib/cinderlib.py +++ b/cinderlib/cinderlib.py @@ -101,6 +101,11 @@ def __init__(self, volume_backend_name, **driver_cfg): self._pool_names = tuple(pool['pool_name'] for pool in stats['pools']) + @staticmethod + def driver_options(volume_driver): + """Return the driver specific configuration options.""" + return importutils.import_class(volume_driver).get_driver_options() + @property def pool_names(self): return self._pool_names