From b6559c117191dece3a3addf0088d4bef8a0fdc86 Mon Sep 17 00:00:00 2001 From: David White Date: Wed, 4 May 2022 10:10:46 -0600 Subject: [PATCH] Seagate/Lenovo drivers: Update get_driver_options Lenovo driver: Return additional options from get_driver_options that the driver may use but were not previously being returned Seagate driver: Implement get_driver_options static method Change-Id: Ic66a055358c4afaf198acad48f0afd75d9304dca --- cinder/volume/drivers/lenovo/lenovo_common.py | 8 ++++++++ cinder/volume/drivers/lenovo/lenovo_fc.py | 2 +- cinder/volume/drivers/lenovo/lenovo_iscsi.py | 3 ++- cinder/volume/drivers/stx/common.py | 8 ++++++++ cinder/volume/drivers/stx/fc.py | 4 ++++ cinder/volume/drivers/stx/iscsi.py | 4 ++++ releasenotes/notes/get-driver-opts-924f72346ca1e459.yaml | 5 +++++ 7 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/get-driver-opts-924f72346ca1e459.yaml diff --git a/cinder/volume/drivers/lenovo/lenovo_common.py b/cinder/volume/drivers/lenovo/lenovo_common.py index e4a2c43efd1..6718374f924 100644 --- a/cinder/volume/drivers/lenovo/lenovo_common.py +++ b/cinder/volume/drivers/lenovo/lenovo_common.py @@ -17,6 +17,7 @@ from oslo_config import cfg from cinder.volume import configuration +from cinder.volume import driver import cinder.volume.drivers.lenovo.lenovo_client as lenovo_client import cinder.volume.drivers.stx.common as common @@ -83,3 +84,10 @@ class LenovoCommon(common.STXCommon): self.config.san_password, self.api_protocol, ssl_verify) + + @staticmethod + def get_driver_options(): + additional_opts = driver.BaseVD._get_oslo_driver_opts( + 'san_ip', 'san_login', 'san_password', 'driver_use_ssl', + 'driver_ssl_cert_verify', 'driver_ssl_cert_path') + return common_opts + additional_opts diff --git a/cinder/volume/drivers/lenovo/lenovo_fc.py b/cinder/volume/drivers/lenovo/lenovo_fc.py index 58438ae0350..57f417340c8 100644 --- a/cinder/volume/drivers/lenovo/lenovo_fc.py +++ b/cinder/volume/drivers/lenovo/lenovo_fc.py @@ -46,7 +46,7 @@ class LenovoFCDriver(fc.STXFCDriver): @staticmethod def get_driver_options(): - return lenovo_common.common_opts + return lenovo_common.LenovoCommon.get_driver_options() def _init_common(self): return lenovo_common.LenovoCommon(self.configuration) diff --git a/cinder/volume/drivers/lenovo/lenovo_iscsi.py b/cinder/volume/drivers/lenovo/lenovo_iscsi.py index 3d3cc053c7c..ec189484668 100644 --- a/cinder/volume/drivers/lenovo/lenovo_iscsi.py +++ b/cinder/volume/drivers/lenovo/lenovo_iscsi.py @@ -48,7 +48,8 @@ class LenovoISCSIDriver(iscsi.STXISCSIDriver): @staticmethod def get_driver_options(): - return lenovo_common.common_opts + lenovo_common.iscsi_opts + return (lenovo_common.LenovoCommon.get_driver_options() + + lenovo_common.iscsi_opts) def _init_common(self): return lenovo_common.LenovoCommon(self.configuration) diff --git a/cinder/volume/drivers/stx/common.py b/cinder/volume/drivers/stx/common.py index c1fb46df0d8..a0bfad7a2f3 100644 --- a/cinder/volume/drivers/stx/common.py +++ b/cinder/volume/drivers/stx/common.py @@ -27,6 +27,7 @@ from cinder import exception from cinder.i18n import _ from cinder.objects import fields from cinder.volume import configuration +from cinder.volume import driver import cinder.volume.drivers.stx.client as client import cinder.volume.drivers.stx.exception as stx_exception from cinder.volume import volume_utils @@ -618,3 +619,10 @@ class STXCommon(object): return self._get_manageable_vols(cinder_snapshots, 'snapshot', marker, limit, offset, sort_keys, sort_dirs) + + @staticmethod + def get_driver_options(): + additional_opts = driver.BaseVD._get_oslo_driver_opts( + 'san_ip', 'san_login', 'san_password', 'driver_use_ssl', + 'driver_ssl_cert_verify', 'driver_ssl_cert_path') + return common_opts + additional_opts diff --git a/cinder/volume/drivers/stx/fc.py b/cinder/volume/drivers/stx/fc.py index e7b60b4e6cc..a2ab6012e3f 100644 --- a/cinder/volume/drivers/stx/fc.py +++ b/cinder/volume/drivers/stx/fc.py @@ -204,3 +204,7 @@ class STXFCDriver(cinder.volume.driver.FibreChannelDriver): return self.common.get_manageable_snapshots(cinder_snapshots, marker, limit, offset, sort_keys, sort_dirs) + + @staticmethod + def get_driver_options(): + return common.STXCommon.get_driver_options() diff --git a/cinder/volume/drivers/stx/iscsi.py b/cinder/volume/drivers/stx/iscsi.py index 787aa4d52b9..1a6d6683518 100644 --- a/cinder/volume/drivers/stx/iscsi.py +++ b/cinder/volume/drivers/stx/iscsi.py @@ -230,3 +230,7 @@ class STXISCSIDriver(cinder.volume.driver.ISCSIDriver): return self.common.get_manageable_snapshots(cinder_snapshots, marker, limit, offset, sort_keys, sort_dirs) + + @staticmethod + def get_driver_options(): + return (common.STXCommon.get_driver_options() + common.iscsi_opts) diff --git a/releasenotes/notes/get-driver-opts-924f72346ca1e459.yaml b/releasenotes/notes/get-driver-opts-924f72346ca1e459.yaml new file mode 100644 index 00000000000..c822fdcb109 --- /dev/null +++ b/releasenotes/notes/get-driver-opts-924f72346ca1e459.yaml @@ -0,0 +1,5 @@ +features: + - | + Seagate driver: Added support for ``get_driver_options`` api call + - | + Lenovo driver: Return additional configuration options from ``get_driver_options`` call