From abac1a6c1c55c673603d4943711c02a09ed4c34d Mon Sep 17 00:00:00 2001 From: "Walter A. Boring IV" Date: Thu, 15 Aug 2013 15:54:30 -0700 Subject: [PATCH] refactor/unify driver version strings This patch updates each driver to provide the same mechanism for reporting the version of the driver. It also includes fixing the reported driver version at get_volume_stats() time to be the version set in the driver. When the manager starts the driver it now logs the driver's name and version in the log file. fixes Bug #1212878 Change-Id: Icefd065f885ad417735490e6ac90e2b21557d2dc --- cinder/tests/test_block_device.py | 2 +- cinder/tests/test_rbd.py | 4 ++-- cinder/tests/test_sheepdog.py | 4 ++-- cinder/volume/driver.py | 7 +++++++ cinder/volume/drivers/block_device.py | 2 +- cinder/volume/drivers/coraid.py | 2 +- cinder/volume/drivers/emc/emc_smis_iscsi.py | 2 ++ cinder/volume/drivers/glusterfs.py | 3 +-- cinder/volume/drivers/gpfs.py | 5 +++-- cinder/volume/drivers/hds/hds.py | 2 ++ cinder/volume/drivers/huawei/huawei_iscsi.py | 4 +++- cinder/volume/drivers/lvm.py | 2 +- cinder/volume/drivers/netapp/iscsi.py | 4 +++- cinder/volume/drivers/netapp/nfs.py | 5 ++++- cinder/volume/drivers/nexenta/volume.py | 5 +++-- cinder/volume/drivers/nfs.py | 9 ++++++--- cinder/volume/drivers/rbd.py | 7 ++++--- cinder/volume/drivers/san/hp/hp_3par_fc.py | 4 +++- cinder/volume/drivers/san/hp/hp_3par_iscsi.py | 5 ++++- cinder/volume/drivers/san/hp_lefthand.py | 4 +++- cinder/volume/drivers/scality.py | 4 +++- cinder/volume/drivers/sheepdog.py | 4 +++- cinder/volume/drivers/solidfire.py | 5 +++-- cinder/volume/drivers/storwize_svc.py | 4 ++-- cinder/volume/drivers/xenapi/sm.py | 5 ++++- cinder/volume/manager.py | 3 +++ 26 files changed, 74 insertions(+), 33 deletions(-) diff --git a/cinder/tests/test_block_device.py b/cinder/tests/test_block_device.py index b51424382..f0cf19911 100644 --- a/cinder/tests/test_block_device.py +++ b/cinder/tests/test_block_device.py @@ -119,7 +119,7 @@ class TestBlockDeviceDriver(cinder.test.TestCase): self.configuration.reserved_percentage, 'QoS_support': False, 'vendor_name': "Open Source", - 'driver_version': '1.0', + 'driver_version': self.drv.VERSION, 'storage_protocol': 'unknown', 'volume_backend_name': 'BlockDeviceDriver', }) diff --git a/cinder/tests/test_rbd.py b/cinder/tests/test_rbd.py index 6d68b8198..20a8e81a0 100644 --- a/cinder/tests/test_rbd.py +++ b/cinder/tests/test_rbd.py @@ -299,7 +299,7 @@ class RBDTestCase(test.TestCase): expected = dict( volume_backend_name='RBD', vendor_name='Open Source', - driver_version=driver.VERSION, + driver_version=self.driver.VERSION, storage_protocol='ceph', total_capacity_gb=1177, free_capacity_gb=953, @@ -325,7 +325,7 @@ class RBDTestCase(test.TestCase): expected = dict( volume_backend_name='RBD', vendor_name='Open Source', - driver_version=driver.VERSION, + driver_version=self.driver.VERSION, storage_protocol='ceph', total_capacity_gb='unknown', free_capacity_gb='unknown', diff --git a/cinder/tests/test_sheepdog.py b/cinder/tests/test_sheepdog.py index 9203f19ec..b41026657 100644 --- a/cinder/tests/test_sheepdog.py +++ b/cinder/tests/test_sheepdog.py @@ -68,7 +68,7 @@ class SheepdogTestCase(test.TestCase): expected = dict( volume_backend_name='sheepdog', vendor_name='Open Source', - dirver_version='1.0', + dirver_version=self.driver.VERSION, storage_protocol='sheepdog', total_capacity_gb=float(107287605248) / (1024 ** 3), free_capacity_gb=float(107287605248 - 3623897354) / (1024 ** 3), @@ -84,7 +84,7 @@ class SheepdogTestCase(test.TestCase): expected = dict( volume_backend_name='sheepdog', vendor_name='Open Source', - dirver_version='1.0', + dirver_version=self.driver.VERSION, storage_protocol='sheepdog', total_capacity_gb='unknown', free_capacity_gb='unknown', diff --git a/cinder/volume/driver.py b/cinder/volume/driver.py index da5458bc2..cb82d6bd4 100644 --- a/cinder/volume/driver.py +++ b/cinder/volume/driver.py @@ -95,6 +95,9 @@ CONF.import_opt('iser_helper', 'cinder.brick.iser.iser') class VolumeDriver(object): """Executes commands relating to Volumes.""" + + VERSION = "N/A" + def __init__(self, execute=utils.execute, *args, **kwargs): # NOTE(vish): db is set by Manager self.db = None @@ -107,6 +110,10 @@ class VolumeDriver(object): def set_execute(self, execute): self._execute = execute + def get_version(self): + """Get the current version of this driver.""" + return self.VERSION + def _is_non_recoverable(self, err, non_recoverable_list): for item in non_recoverable_list: if item in err: diff --git a/cinder/volume/drivers/block_device.py b/cinder/volume/drivers/block_device.py index 4b1ad2fdd..1b3031add 100644 --- a/cinder/volume/drivers/block_device.py +++ b/cinder/volume/drivers/block_device.py @@ -41,7 +41,7 @@ CONF.register_opts(volume_opts) class BlockDeviceDriver(driver.ISCSIDriver): - VERSION = '1.0' + VERSION = '1.0.0' def __init__(self, *args, **kwargs): self.tgtadm = iscsi.get_target_admin() diff --git a/cinder/volume/drivers/coraid.py b/cinder/volume/drivers/coraid.py index ed9c614da..23a656a6e 100644 --- a/cinder/volume/drivers/coraid.py +++ b/cinder/volume/drivers/coraid.py @@ -433,7 +433,7 @@ class CoraidDriver(driver.VolumeDriver): def get_volume_stats(self, refresh=False): """Return Volume Stats.""" - data = {'driver_version': '1.0', + data = {'driver_version': self.VERSION, 'free_capacity_gb': 'unknown', 'reserved_percentage': 0, 'storage_protocol': 'aoe', diff --git a/cinder/volume/drivers/emc/emc_smis_iscsi.py b/cinder/volume/drivers/emc/emc_smis_iscsi.py index 24956246f..e6b510dfb 100644 --- a/cinder/volume/drivers/emc/emc_smis_iscsi.py +++ b/cinder/volume/drivers/emc/emc_smis_iscsi.py @@ -32,6 +32,8 @@ LOG = logging.getLogger(__name__) class EMCSMISISCSIDriver(driver.ISCSIDriver): """EMC ISCSI Drivers for VMAX and VNX using SMI-S.""" + VERSION = "1.0.0" + def __init__(self, *args, **kwargs): super(EMCSMISISCSIDriver, self).__init__(*args, **kwargs) diff --git a/cinder/volume/drivers/glusterfs.py b/cinder/volume/drivers/glusterfs.py index ea79fc8c4..5035a22c4 100644 --- a/cinder/volume/drivers/glusterfs.py +++ b/cinder/volume/drivers/glusterfs.py @@ -41,7 +41,6 @@ volume_opts = [ help=('Create volumes as sparsed files which take no space.' 'If set to False volume is created as regular file.' 'In such case volume creation takes a lot of time.'))] -VERSION = '1.0' CONF = cfg.CONF CONF.register_opts(volume_opts) @@ -55,7 +54,7 @@ class GlusterfsDriver(nfs.RemoteFsDriver): driver_volume_type = 'glusterfs' driver_prefix = 'glusterfs' volume_backend_name = 'GlusterFS' - version = VERSION + VERSION = '1.0.0' def __init__(self, *args, **kwargs): super(GlusterfsDriver, self).__init__(*args, **kwargs) diff --git a/cinder/volume/drivers/gpfs.py b/cinder/volume/drivers/gpfs.py index fe4577ce4..b0c76b46a 100644 --- a/cinder/volume/drivers/gpfs.py +++ b/cinder/volume/drivers/gpfs.py @@ -31,7 +31,6 @@ from cinder.openstack.common import log as logging from cinder import units from cinder.volume import driver -VERSION = 1.0 GPFS_CLONE_MIN_RELEASE = 1200 LOG = logging.getLogger(__name__) @@ -74,6 +73,8 @@ class GPFSDriver(driver.VolumeDriver): """Implements volume functions using GPFS primitives.""" + VERSION = "1.0.0" + def __init__(self, *args, **kwargs): super(GPFSDriver, self).__init__(*args, **kwargs) self.configuration.append_config_values(gpfs_opts) @@ -399,7 +400,7 @@ class GPFSDriver(driver.VolumeDriver): backend_name = self.configuration.safe_get('volume_backend_name') data["volume_backend_name"] = backend_name or 'GPFS' data["vendor_name"] = 'IBM' - data["driver_version"] = '1.0' + data["driver_version"] = self.VERSION data["storage_protocol"] = 'file' free, capacity = self._get_available_capacity(self.configuration. gpfs_mount_point_base) diff --git a/cinder/volume/drivers/hds/hds.py b/cinder/volume/drivers/hds/hds.py index f26051d6f..b9a69e02b 100644 --- a/cinder/volume/drivers/hds/hds.py +++ b/cinder/volume/drivers/hds/hds.py @@ -144,6 +144,8 @@ def _read_config(xml_config_file): class HUSDriver(driver.ISCSIDriver): """HDS HUS volume driver.""" + VERSION = HDS_VERSION + def _array_info_get(self): """Get array parameters.""" out = self.bend.get_version(self.config['hus_cmd'], diff --git a/cinder/volume/drivers/huawei/huawei_iscsi.py b/cinder/volume/drivers/huawei/huawei_iscsi.py index ac66098e4..42a9fa16d 100644 --- a/cinder/volume/drivers/huawei/huawei_iscsi.py +++ b/cinder/volume/drivers/huawei/huawei_iscsi.py @@ -129,6 +129,8 @@ class SSHConn(utils.SSHPool): class HuaweiISCSIDriver(driver.ISCSIDriver): """Huawei T series and Dorado iSCSI volume driver.""" + VERSION = "1.0.0" + def __init__(self, *args, **kwargs): super(HuaweiISCSIDriver, self).__init__(*args, **kwargs) self.configuration.append_config_values(huawei_opt) @@ -1509,7 +1511,7 @@ class HuaweiISCSIDriver(driver.ISCSIDriver): backend_name = self.configuration.safe_get('volume_backend_name') data["volume_backend_name"] = backend_name or 'HuaweiISCSIDriver' data['vendor_name'] = 'Huawei' - data['driver_version'] = '1.0' + data['driver_version'] = self.VERSION data['storage_protocol'] = 'iSCSI' data['total_capacity_gb'] = 'infinite' diff --git a/cinder/volume/drivers/lvm.py b/cinder/volume/drivers/lvm.py index 29b4d5541..7c596554a 100644 --- a/cinder/volume/drivers/lvm.py +++ b/cinder/volume/drivers/lvm.py @@ -60,7 +60,7 @@ CONF.register_opts(volume_opts) class LVMVolumeDriver(driver.VolumeDriver): """Executes commands relating to Volumes.""" - VERSION = '1.0' + VERSION = '1.0.0' def __init__(self, *args, **kwargs): super(LVMVolumeDriver, self).__init__(*args, **kwargs) diff --git a/cinder/volume/drivers/netapp/iscsi.py b/cinder/volume/drivers/netapp/iscsi.py index 266b926cf..3f182f32e 100644 --- a/cinder/volume/drivers/netapp/iscsi.py +++ b/cinder/volume/drivers/netapp/iscsi.py @@ -83,6 +83,8 @@ class NetAppLun(object): class NetAppDirectISCSIDriver(driver.ISCSIDriver): """NetApp Direct iSCSI volume driver.""" + VERSION = "1.0.0" + IGROUP_PREFIX = 'openstack-' required_flags = ['netapp_transport_type', 'netapp_login', 'netapp_password', 'netapp_server_hostname', @@ -1122,7 +1124,7 @@ class NetAppDirect7modeISCSIDriver(NetAppDirectISCSIDriver): data["volume_backend_name"] = ( backend_name or 'NetApp_iSCSI_7mode_direct') data["vendor_name"] = 'NetApp' - data["driver_version"] = '1.0' + data["driver_version"] = self.VERSION data["storage_protocol"] = 'iSCSI' data['total_capacity_gb'] = 'infinite' diff --git a/cinder/volume/drivers/netapp/nfs.py b/cinder/volume/drivers/netapp/nfs.py index 30d4b49b2..05ce1796d 100644 --- a/cinder/volume/drivers/netapp/nfs.py +++ b/cinder/volume/drivers/netapp/nfs.py @@ -49,6 +49,9 @@ class NetAppNFSDriver(nfs.NfsDriver): """Base class for NetApp NFS driver. Executes commands relating to Volumes. """ + + VERSION = "1.0.0" + def __init__(self, *args, **kwargs): # NOTE(vish): db is set by Manager validate_instantiation(**kwargs) @@ -484,6 +487,6 @@ class NetAppDirect7modeNfsDriver (NetAppDirectNfsDriver): self._stats["volume_backend_name"] = (backend_name or 'NetApp_NFS_7mode_direct') self._stats["vendor_name"] = 'NetApp' - self._stats["driver_version"] = '1.0' + self._stats["driver_version"] = self.VERSION provide_ems(self, self._client, self._stats, netapp_backend, server_type="7mode") diff --git a/cinder/volume/drivers/nexenta/volume.py b/cinder/volume/drivers/nexenta/volume.py index d3965a13c..077136e4c 100644 --- a/cinder/volume/drivers/nexenta/volume.py +++ b/cinder/volume/drivers/nexenta/volume.py @@ -31,7 +31,6 @@ from cinder.volume import driver from cinder.volume.drivers import nexenta from cinder.volume.drivers.nexenta import jsonrpc -VERSION = '1.0' LOG = logging.getLogger(__name__) NEXENTA_OPTS = [ @@ -78,6 +77,8 @@ CONF.register_opts(NEXENTA_OPTS) class NexentaDriver(driver.ISCSIDriver): # pylint: disable=R0921 """Executes volume driver commands on Nexenta Appliance.""" + VERSION = '1.0.0' + def __init__(self, *args, **kwargs): super(NexentaDriver, self).__init__(*args, **kwargs) self.nms = None @@ -367,7 +368,7 @@ class NexentaDriver(driver.ISCSIDriver): # pylint: disable=R0921 backend_name = self.configuration.safe_get('volume_backend_name') data["volume_backend_name"] = backend_name or self.__class__.__name__ data["vendor_name"] = 'Nexenta' - data["driver_version"] = VERSION + data["driver_version"] = self.VERSION data["storage_protocol"] = 'iSCSI' stats = self.nms.volume.get_child_props(CONF.nexenta_volume, diff --git a/cinder/volume/drivers/nfs.py b/cinder/volume/drivers/nfs.py index cf4803100..98bda3064 100644 --- a/cinder/volume/drivers/nfs.py +++ b/cinder/volume/drivers/nfs.py @@ -27,6 +27,8 @@ from cinder.openstack.common import log as logging from cinder import units from cinder.volume import driver +VERSION = '1.1.0' + LOG = logging.getLogger(__name__) volume_opts = [ @@ -57,7 +59,6 @@ volume_opts = [ 'number, the destination will no longer be valid.')) ] -VERSION = '1.1' CONF = cfg.CONF CONF.register_opts(volume_opts) @@ -66,6 +67,8 @@ CONF.register_opts(volume_opts) class RemoteFsDriver(driver.VolumeDriver): """Common base for drivers that work like NFS.""" + VERSION = "0.0.0" + def check_for_setup_error(self): """Just to override parent behavior.""" pass @@ -295,7 +298,7 @@ class RemoteFsDriver(driver.VolumeDriver): backend_name = self.configuration.safe_get('volume_backend_name') data['volume_backend_name'] = backend_name or self.volume_backend_name data['vendor_name'] = 'Open Source' - data['driver_version'] = self.version + data['driver_version'] = self.get_version() data['storage_protocol'] = self.driver_volume_type self._ensure_shares_mounted() @@ -346,7 +349,7 @@ class NfsDriver(RemoteFsDriver): driver_volume_type = 'nfs' driver_prefix = 'nfs' volume_backend_name = 'Generic_NFS' - version = VERSION + VERSION = VERSION def __init__(self, *args, **kwargs): super(NfsDriver, self).__init__(*args, **kwargs) diff --git a/cinder/volume/drivers/rbd.py b/cinder/volume/drivers/rbd.py index f4cccd1f2..3bc580bff 100644 --- a/cinder/volume/drivers/rbd.py +++ b/cinder/volume/drivers/rbd.py @@ -64,8 +64,6 @@ rbd_opts = [ help='where to store temporary image files if the volume ' 'driver does not write them directly to the volume'), ] -VERSION = '1.1' - def ascii_str(string): """Convert a string to ascii, or return None if the input is None. @@ -240,6 +238,9 @@ CONF.register_opts(rbd_opts) class RBDDriver(driver.VolumeDriver): """Implements RADOS block device (RBD) volume commands.""" + + VERSION = '1.1.0' + def __init__(self, *args, **kwargs): super(RBDDriver, self).__init__(*args, **kwargs) self.configuration.append_config_values(rbd_opts) @@ -317,7 +318,7 @@ class RBDDriver(driver.VolumeDriver): def _update_volume_stats(self): stats = { 'vendor_name': 'Open Source', - 'driver_version': VERSION, + 'driver_version': self.VERSION, 'storage_protocol': 'ceph', 'total_capacity_gb': 'unknown', 'free_capacity_gb': 'unknown', diff --git a/cinder/volume/drivers/san/hp/hp_3par_fc.py b/cinder/volume/drivers/san/hp/hp_3par_fc.py index f852f5a3c..521a88c47 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_fc.py +++ b/cinder/volume/drivers/san/hp/hp_3par_fc.py @@ -40,7 +40,6 @@ import cinder.volume.driver from cinder.volume.drivers.san.hp import hp_3par_common as hpcommon from cinder.volume.drivers.san import san -VERSION = 1.1 LOG = logging.getLogger(__name__) @@ -54,6 +53,8 @@ class HP3PARFCDriver(cinder.volume.driver.FibreChannelDriver): copy volume <--> Image. """ + VERSION = "1.1.0" + def __init__(self, *args, **kwargs): super(HP3PARFCDriver, self).__init__(*args, **kwargs) self.common = None @@ -75,6 +76,7 @@ class HP3PARFCDriver(cinder.volume.driver.FibreChannelDriver): self.common.client_login() stats = self.common.get_volume_stats(refresh) stats['storage_protocol'] = 'FC' + stats['driver_version'] = self.VERSION backend_name = self.configuration.safe_get('volume_backend_name') stats['volume_backend_name'] = backend_name or self.__class__.__name__ self.common.client_logout() diff --git a/cinder/volume/drivers/san/hp/hp_3par_iscsi.py b/cinder/volume/drivers/san/hp/hp_3par_iscsi.py index 3cd6bea78..f542227f0 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_iscsi.py +++ b/cinder/volume/drivers/san/hp/hp_3par_iscsi.py @@ -41,7 +41,6 @@ import cinder.volume.driver from cinder.volume.drivers.san.hp import hp_3par_common as hpcommon from cinder.volume.drivers.san import san -VERSION = 1.1 LOG = logging.getLogger(__name__) DEFAULT_ISCSI_PORT = 3260 @@ -55,6 +54,9 @@ class HP3PARISCSIDriver(cinder.volume.driver.ISCSIDriver): session changes, faster clone, requires 3.1.2 MU2 firmware. """ + + VERSION = "1.1.0" + def __init__(self, *args, **kwargs): super(HP3PARISCSIDriver, self).__init__(*args, **kwargs) self.common = None @@ -76,6 +78,7 @@ class HP3PARISCSIDriver(cinder.volume.driver.ISCSIDriver): self.common.client_login() stats = self.common.get_volume_stats(refresh) stats['storage_protocol'] = 'iSCSI' + stats['driver_version'] = self.VERSION backend_name = self.configuration.safe_get('volume_backend_name') stats['volume_backend_name'] = backend_name or self.__class__.__name__ self.common.client_logout() diff --git a/cinder/volume/drivers/san/hp_lefthand.py b/cinder/volume/drivers/san/hp_lefthand.py index 7fea86a38..c02dd7692 100644 --- a/cinder/volume/drivers/san/hp_lefthand.py +++ b/cinder/volume/drivers/san/hp_lefthand.py @@ -51,6 +51,8 @@ class HpSanISCSIDriver(SanISCSIDriver): compute layer. """ + VERSION = "1.0.0" + device_stats = {} def __init__(self, *args, **kwargs): @@ -298,7 +300,7 @@ class HpSanISCSIDriver(SanISCSIDriver): data = {} backend_name = self.configuration.safe_get('volume_backend_name') data['volume_backend_name'] = backend_name or self.__class__.__name__ - data['driver_version'] = '1.0' + data['driver_version'] = self.VERSION data['reserved_percentage'] = 0 data['storage_protocol'] = 'iSCSI' data['vendor_name'] = 'Hewlett-Packard' diff --git a/cinder/volume/drivers/scality.py b/cinder/volume/drivers/scality.py index c11d4f8ab..31e75bd26 100644 --- a/cinder/volume/drivers/scality.py +++ b/cinder/volume/drivers/scality.py @@ -55,6 +55,8 @@ class ScalityDriver(driver.VolumeDriver): devices. """ + VERSION = '1.0.0' + def _check_prerequisites(self): """Sanity checks before attempting to mount SOFS.""" @@ -221,7 +223,7 @@ class ScalityDriver(driver.VolumeDriver): """ stats = { 'vendor_name': 'Scality', - 'driver_version': '1.0', + 'driver_version': self.VERSION, 'storage_protocol': 'scality', 'total_capacity_gb': 'infinite', 'free_capacity_gb': 'infinite', diff --git a/cinder/volume/drivers/sheepdog.py b/cinder/volume/drivers/sheepdog.py index 1e610fd0e..b3bda9c7d 100644 --- a/cinder/volume/drivers/sheepdog.py +++ b/cinder/volume/drivers/sheepdog.py @@ -40,6 +40,8 @@ CONF.import_opt("image_conversion_dir", "cinder.image.image_utils") class SheepdogDriver(driver.VolumeDriver): """Executes commands relating to Sheepdog Volumes""" + VERSION = "1.0.0" + def __init__(self, *args, **kwargs): super(SheepdogDriver, self).__init__(*args, **kwargs) self.stats_pattern = re.compile(r'[\w\s%]*Total\s(\d+)\s(\d+)*') @@ -157,7 +159,7 @@ class SheepdogDriver(driver.VolumeDriver): backend_name = self.configuration.safe_get('volume_backend_name') stats["volume_backend_name"] = backend_name or 'sheepdog' stats['vendor_name'] = 'Open Source' - stats['dirver_version'] = '1.0' + stats['dirver_version'] = self.VERSION stats['storage_protocol'] = 'sheepdog' stats['total_capacity_gb'] = 'unknown' stats['free_capacity_gb'] = 'unknown' diff --git a/cinder/volume/drivers/solidfire.py b/cinder/volume/drivers/solidfire.py index 25e40c828..b9e4e6f60 100644 --- a/cinder/volume/drivers/solidfire.py +++ b/cinder/volume/drivers/solidfire.py @@ -34,7 +34,6 @@ from cinder.openstack.common import timeutils from cinder.volume.drivers.san.san import SanISCSIDriver from cinder.volume import volume_types -VERSION = '1.2' LOG = logging.getLogger(__name__) sf_opts = [ @@ -64,6 +63,8 @@ class SolidFireDriver(SanISCSIDriver): """ + VERSION = '1.2.0' + sf_qos_dict = {'slow': {'minIOPS': 100, 'maxIOPS': 200, 'burstIOPS': 200}, @@ -652,7 +653,7 @@ class SolidFireDriver(SanISCSIDriver): backend_name = self.configuration.safe_get('volume_backend_name') data["volume_backend_name"] = backend_name or self.__class__.__name__ data["vendor_name"] = 'SolidFire Inc' - data["driver_version"] = VERSION + data["driver_version"] = self.VERSION data["storage_protocol"] = 'iSCSI' data['total_capacity_gb'] = results['maxProvisionedSpace'] diff --git a/cinder/volume/drivers/storwize_svc.py b/cinder/volume/drivers/storwize_svc.py index 71fd3c4ef..221e83217 100644 --- a/cinder/volume/drivers/storwize_svc.py +++ b/cinder/volume/drivers/storwize_svc.py @@ -56,7 +56,6 @@ from cinder import utils from cinder.volume.drivers.san import san from cinder.volume import volume_types -VERSION = 1.1 LOG = logging.getLogger(__name__) storwize_svc_opts = [ @@ -118,6 +117,7 @@ class StorwizeSVCDriver(san.SanDriver): """=====================================================================""" """ SETUP """ """=====================================================================""" + VERSION = "1.1.0" def __init__(self, *args, **kwargs): super(StorwizeSVCDriver, self).__init__(*args, **kwargs) @@ -1363,7 +1363,7 @@ class StorwizeSVCDriver(san.SanDriver): data = {} data['vendor_name'] = 'IBM' - data['driver_version'] = '1.1' + data['driver_version'] = self.VERSION data['storage_protocol'] = list(self._enabled_protocols) data['total_capacity_gb'] = 0 # To be overwritten diff --git a/cinder/volume/drivers/xenapi/sm.py b/cinder/volume/drivers/xenapi/sm.py index 85dcb57b1..7df2b1b9f 100644 --- a/cinder/volume/drivers/xenapi/sm.py +++ b/cinder/volume/drivers/xenapi/sm.py @@ -58,6 +58,9 @@ CONF.register_opts(xenapi_nfs_opts) class XenAPINFSDriver(driver.VolumeDriver): + + VERSION = "1.0.0" + def __init__(self, *args, **kwargs): super(XenAPINFSDriver, self).__init__(*args, **kwargs) self.configuration.append_config_values(xenapi_opts) @@ -250,7 +253,7 @@ class XenAPINFSDriver(driver.VolumeDriver): backend_name = self.configuration.safe_get('volume_backend_name') data["volume_backend_name"] = backend_name or 'XenAPINFS', data['vendor_name'] = 'Open Source', - data['driver_version'] = '1.0' + data['driver_version'] = self.VERSION data['storage_protocol'] = 'xensm' data['total_capacity_gb'] = 'unknown' data['free_capacity_gb'] = 'unknown' diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py index 89b517c39..2d64c1f9e 100644 --- a/cinder/volume/manager.py +++ b/cinder/volume/manager.py @@ -145,6 +145,9 @@ class VolumeManager(manager.SchedulerDependentManager): """ ctxt = context.get_admin_context() + LOG.info(_("Starting volume driver %(driver_name)s (%(version)s)") % + {'driver_name': self.driver.__class__.__name__, + 'version': self.driver.get_version()}) self.driver.do_setup(ctxt) self.driver.check_for_setup_error() -- 2.45.2