]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
3PAR update driver to store stats
authorWalter A. Boring IV <walter.boring@hp.com>
Tue, 25 Aug 2015 15:31:33 +0000 (08:31 -0700)
committerWalter A. Boring IV (hemna) <walter.boring@hp.com>
Thu, 27 Aug 2015 20:46:53 +0000 (20:46 +0000)
The BaseVD class declares _stats in the constructor and
some drivers seem to be storing their stats from get_volume_stats
in there.   This patch updates the 3PAR drivers to do the same
as most.

Change-Id: Ia1bc73089cff1f2c04c4782ef9fbaf130e57d02b

cinder/volume/drivers/san/hp/hp_3par_fc.py
cinder/volume/drivers/san/hp/hp_3par_iscsi.py

index 6ea71f8d09ae26235826fd5bbd4972500aa1c1ea..831b57e3e5536fb1e214cfdcca4a1f1dd4e57c72 100644 (file)
@@ -122,16 +122,16 @@ class HP3PARFCDriver(driver.TransferVD,
     def get_volume_stats(self, refresh=False):
         common = self._login()
         try:
-            stats = common.get_volume_stats(
+            self._stats = common.get_volume_stats(
                 refresh,
                 self.get_filter_function(),
                 self.get_goodness_function())
-            stats['storage_protocol'] = 'FC'
-            stats['driver_version'] = self.VERSION
+            self._stats['storage_protocol'] = 'FC'
+            self._stats['driver_version'] = self.VERSION
             backend_name = self.configuration.safe_get('volume_backend_name')
-            stats['volume_backend_name'] = (backend_name or
-                                            self.__class__.__name__)
-            return stats
+            self._stats['volume_backend_name'] = (backend_name or
+                                                  self.__class__.__name__)
+            return self._stats
         finally:
             self._logout(common)
 
index 54b61479caf78fda6a029e7358896c6b9b7db537..4605e6b985dae4d0bc2acf4fc38cf5c520e3a2fa 100644 (file)
@@ -131,16 +131,16 @@ class HP3PARISCSIDriver(driver.TransferVD,
     def get_volume_stats(self, refresh=False):
         common = self._login()
         try:
-            stats = common.get_volume_stats(
+            self._stats = common.get_volume_stats(
                 refresh,
                 self.get_filter_function(),
                 self.get_goodness_function())
-            stats['storage_protocol'] = 'iSCSI'
-            stats['driver_version'] = self.VERSION
+            self._stats['storage_protocol'] = 'iSCSI'
+            self._stats['driver_version'] = self.VERSION
             backend_name = self.configuration.safe_get('volume_backend_name')
-            stats['volume_backend_name'] = (backend_name or
-                                            self.__class__.__name__)
-            return stats
+            self._stats['volume_backend_name'] = (backend_name or
+                                                  self.__class__.__name__)
+            return self._stats
         finally:
             self._logout(common)