From e64f664a1c90614fb163baba8766e4eb765d7da5 Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Fri, 12 Apr 2013 16:47:34 -0400 Subject: [PATCH] Use VERSION var for volume_stats version (Gluster/NFS) Establish a formal version number to help with maintenance. Change-Id: Iffe1a6f809ec9385c7407efac25ca39eff0d1329 --- cinder/volume/drivers/glusterfs.py | 3 ++- cinder/volume/drivers/nfs.py | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cinder/volume/drivers/glusterfs.py b/cinder/volume/drivers/glusterfs.py index 5d1aced24..17252bf07 100644 --- a/cinder/volume/drivers/glusterfs.py +++ b/cinder/volume/drivers/glusterfs.py @@ -42,6 +42,7 @@ 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' FLAGS = flags.FLAGS FLAGS.register_opts(volume_opts) @@ -271,7 +272,7 @@ class GlusterfsDriver(nfs.RemoteFsDriver): backend_name = self.configuration.safe_get('volume_backend_name') data['volume_backend_name'] = backend_name or 'GlusterFS' data['vendor_name'] = 'Open Source' - data['driver_version'] = '1.0' + data['driver_version'] = VERSION data['storage_protocol'] = 'glusterfs' self._ensure_shares_mounted() diff --git a/cinder/volume/drivers/nfs.py b/cinder/volume/drivers/nfs.py index 9939fcfec..67b9d6abd 100755 --- a/cinder/volume/drivers/nfs.py +++ b/cinder/volume/drivers/nfs.py @@ -48,6 +48,8 @@ volume_opts = [ 'of the nfs man page for details'), ] +VERSION = '1.0' + class RemoteFsDriver(driver.VolumeDriver): """Common base for drivers that work like NFS.""" @@ -340,7 +342,7 @@ class NfsDriver(RemoteFsDriver): backend_name = self.configuration.safe_get('volume_backend_name') data["volume_backend_name"] = backend_name or 'Generic_NFS' data["vendor_name"] = 'Open Source' - data["driver_version"] = '1.0' + data["driver_version"] = VERSION data["storage_protocol"] = 'nfs' self._ensure_shares_mounted() -- 2.45.2