From: Walter A. Boring IV Date: Tue, 25 Aug 2015 15:31:33 +0000 (-0700) Subject: 3PAR update driver to store stats X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=18a76ba1878fd2bcd98921b9e063f733eb0a6451;p=openstack-build%2Fcinder-build.git 3PAR update driver to store stats 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 --- diff --git a/cinder/volume/drivers/san/hp/hp_3par_fc.py b/cinder/volume/drivers/san/hp/hp_3par_fc.py index 6ea71f8d0..831b57e3e 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_fc.py +++ b/cinder/volume/drivers/san/hp/hp_3par_fc.py @@ -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) diff --git a/cinder/volume/drivers/san/hp/hp_3par_iscsi.py b/cinder/volume/drivers/san/hp/hp_3par_iscsi.py index 54b61479c..4605e6b98 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_iscsi.py +++ b/cinder/volume/drivers/san/hp/hp_3par_iscsi.py @@ -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)