]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
refactor/unify driver version strings
authorWalter A. Boring IV <walter.boring@hp.com>
Thu, 15 Aug 2013 22:54:30 +0000 (15:54 -0700)
committerWalter A. Boring IV <walter.boring@hp.com>
Thu, 15 Aug 2013 23:19:00 +0000 (16:19 -0700)
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

26 files changed:
cinder/tests/test_block_device.py
cinder/tests/test_rbd.py
cinder/tests/test_sheepdog.py
cinder/volume/driver.py
cinder/volume/drivers/block_device.py
cinder/volume/drivers/coraid.py
cinder/volume/drivers/emc/emc_smis_iscsi.py
cinder/volume/drivers/glusterfs.py
cinder/volume/drivers/gpfs.py
cinder/volume/drivers/hds/hds.py
cinder/volume/drivers/huawei/huawei_iscsi.py
cinder/volume/drivers/lvm.py
cinder/volume/drivers/netapp/iscsi.py
cinder/volume/drivers/netapp/nfs.py
cinder/volume/drivers/nexenta/volume.py
cinder/volume/drivers/nfs.py
cinder/volume/drivers/rbd.py
cinder/volume/drivers/san/hp/hp_3par_fc.py
cinder/volume/drivers/san/hp/hp_3par_iscsi.py
cinder/volume/drivers/san/hp_lefthand.py
cinder/volume/drivers/scality.py
cinder/volume/drivers/sheepdog.py
cinder/volume/drivers/solidfire.py
cinder/volume/drivers/storwize_svc.py
cinder/volume/drivers/xenapi/sm.py
cinder/volume/manager.py

index b51424382d61f73755528f83ea731fcffa44ce0f..f0cf199113db62cbef9c2efddd6f116ed3614e5f 100644 (file)
@@ -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',
                            })
index 6d68b8198c7b135515e28c1af6c13b72f0196002..20a8e81a02f309fb47946df08a9d2c642897d662 100644 (file)
@@ -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',
index 9203f19ec2a6ad2f7d3ebb609d30cbb5372dcf0b..b410266570d86312a4feaf4c1daadca90de753e3 100644 (file)
@@ -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',
index da5458bc2ec0d37771a8224eac1567eaf084c218..cb82d6bd4dcacb63a3ca04ed74052aafe38cbbb3 100644 (file)
@@ -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:
index 4b1ad2fdd4660d82ba190283fdc29152999e9357..1b3031add43cfc759179862316110d609fbab5f2 100644 (file)
@@ -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()
index ed9c614dacf29fdca6dbf5bbd6eeca377615f9c0..23a656a6e38c950a2ca0bc066563906fe481605e 100644 (file)
@@ -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',
index 24956246f2143b5ffe89e7656aaa1ff137b4101a..e6b510dfb0c3a23e39b869cabfd60dc322a504cd 100644 (file)
@@ -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)
index ea79fc8c46ab4351ab43cfcdba5c5ca67e497671..5035a22c401e09787b1d9872602fe709cfc3fbec 100644 (file)
@@ -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)
index fe4577ce487606044293adcb85b62209831057a0..b0c76b46a3d7dc7ee7838b050b3fc6b52b4ca145 100644 (file)
@@ -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)
index f26051d6f3f2846ad6acbd1761de3b6eede97ef1..b9a69e02ba963ed33ff606a780ef9a75adc6024a 100644 (file)
@@ -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'],
index ac66098e4fbb3966f7d8b922d01f5754c631e556..42a9fa16dc4476f5e8e3b51801cad50047c7dbec 100644 (file)
@@ -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'
index 29b4d55418f24b41f7aaf5c86cb3a4fa4bd7043c..7c596554ac75948ed9257e0aecf3746e7823d38a 100644 (file)
@@ -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)
index 266b926cf1d76d1a86ce95172c8a2a498416ad0b..3f182f32e20410fedbe39eb80767dae1417a3db1 100644 (file)
@@ -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'
index 30d4b49b2b83f36be890104ea0eef17dab41c3c5..05ce1796dfe3735f60683eda2d9ec73f1057bf30 100644 (file)
@@ -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")
index d3965a13c43ea8cb64012dbb1b6afeab8c0739d6..077136e4cd1ed7bbc6456a38d1d3f9e3c12cf698 100644 (file)
@@ -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,
index cf4803100db5caccbaf29a3e6af755a9cd28bfaf..98bda30645073b6b1b54c3fc35ffd5bc9d068b64 100644 (file)
@@ -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)
index f4cccd1f28198abed038791066a5526377b6a6b1..3bc580bff05baab27efdcef53ff59379e0e00b1f 100644 (file)
@@ -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',
index f852f5a3c728159b8f12480ca8dcc2f3c2b7b77b..521a88c474a901c547b91e40e7a261ababa3e9dc 100644 (file)
@@ -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()
index 3cd6bea78ead7978807c136f392e86acd24d6b01..f542227f020c3053e7f0b392b0c6752ec30f64fb 100644 (file)
@@ -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()
index 7fea86a38ff43044e886d799134c9358a592bc39..c02dd7692d7936f514354513cdbcfc253e226db3 100644 (file)
@@ -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'
index c11d4f8abe407d519783a1d7a6d30b4a9adcd7fe..31e75bd2642fd7ca2fa4dff5d40712ce8f8c9291 100644 (file)
@@ -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',
index 1e610fd0e801a3c34c1aafa9e8b955652d504b7a..b3bda9c7df377898ea823041a807fdd5ac688502 100644 (file)
@@ -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'
index 25e40c828a39caba48197b2c3f5a21037e549678..b9e4e6f60acbfcd27fefd378849885a4f93574bd 100644 (file)
@@ -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']
index 71fd3c4efae3787a056c50627fa7e61846dd84cc..221e8321784a528674fc373cb663311085b235fc 100644 (file)
@@ -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
index 85dcb57b1c038a430bc4987cb92e1d62acd25072..7df2b1b9f58e92c44c0585501eeee1a3716e0e66 100644 (file)
@@ -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'
index 89b517c396d24ca93d79dc6228a1c0194f3876a1..2d64c1f9e63b9a09e0d5e4c52195f0074e3d36f1 100644 (file)
@@ -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()