diff --git a/cinder/tests/test_block_device.py b/cinder/tests/test_block_device.py index cd928b2c926..b51424382d6 100644 --- a/cinder/tests/test_block_device.py +++ b/cinder/tests/test_block_device.py @@ -101,7 +101,7 @@ def test_create_volume(self): 'provider_location': 'None:3260,None None ' 'None dev_path'}) - def test_update_volume_status(self): + def test_update_volume_stats(self): self.mox.StubOutWithMock(self.drv, '_devices_sizes') self.drv._devices_sizes().AndReturn({'/dev/loop1': 1024, '/dev/loop2': 1024}) @@ -111,7 +111,7 @@ def test_update_volume_status(self): self.configuration.safe_get('volume_backend_name'). \ AndReturn('BlockDeviceDriver') self.mox.ReplayAll() - self.drv._update_volume_status() + self.drv._update_volume_stats() self.assertEquals(self.drv._stats, {'total_capacity_gb': 2, 'free_capacity_gb': 2, diff --git a/cinder/tests/test_volume.py b/cinder/tests/test_volume.py index 41c389b6e6e..949e435a024 100644 --- a/cinder/tests/test_volume.py +++ b/cinder/tests/test_volume.py @@ -1613,7 +1613,7 @@ def _emulate_vgs_execute(_command, *_args, **_kwargs): self.volume.driver.set_execute(_emulate_vgs_execute) - self.volume.driver._update_volume_status() + self.volume.driver._update_volume_stats() stats = self.volume.driver._stats diff --git a/cinder/volume/driver.py b/cinder/volume/driver.py index bb088573da0..0543cbcd121 100644 --- a/cinder/volume/driver.py +++ b/cinder/volume/driver.py @@ -467,19 +467,19 @@ def _get_iscsi_initiator(self): return l[l.index('=') + 1:].strip() def get_volume_stats(self, refresh=False): - """Get volume status. + """Get volume stats. If 'refresh' is True, run update the stats first. """ if refresh: - self._update_volume_status() + self._update_volume_stats() return self._stats - def _update_volume_status(self): - """Retrieve status info from volume group.""" + def _update_volume_stats(self): + """Retrieve stats info from volume group.""" - LOG.debug(_("Updating volume status")) + LOG.debug(_("Updating volume stats")) data = {} backend_name = self.configuration.safe_get('volume_backend_name') data["volume_backend_name"] = backend_name or 'Generic_iSCSI' diff --git a/cinder/volume/drivers/block_device.py b/cinder/volume/drivers/block_device.py index 130c642dfb5..b94be1bf37a 100644 --- a/cinder/volume/drivers/block_device.py +++ b/cinder/volume/drivers/block_device.py @@ -318,11 +318,11 @@ def create_cloned_volume(self, volume, src_vref): def get_volume_stats(self, refresh=False): if refresh: - self._update_volume_status() + self._update_volume_stats() return self._stats - def _update_volume_status(self): - """Retrieve status info from volume group.""" + def _update_volume_stats(self): + """Retrieve stats info from volume group.""" dict_of_devices_sizes = self._devices_sizes() used_devices = self._get_used_devices() total_size = 0 @@ -332,7 +332,7 @@ def _update_volume_status(self): free_size += size total_size += size - LOG.debug("Updating volume status") + LOG.debug("Updating volume stats") backend_name = self.configuration.safe_get('volume_backend_name') data = {'total_capacity_gb': total_size / 1024, 'free_capacity_gb': free_size / 1024, diff --git a/cinder/volume/drivers/emc/emc_smis_common.py b/cinder/volume/drivers/emc/emc_smis_common.py index 90ae06103a1..7e22befdd55 100644 --- a/cinder/volume/drivers/emc/emc_smis_common.py +++ b/cinder/volume/drivers/emc/emc_smis_common.py @@ -852,9 +852,9 @@ def terminate_connection(self, volume, connector): self.conn = self._get_ecom_connection() self._unmap_lun(volume, connector) - def update_volume_status(self): - """Retrieve status info.""" - LOG.debug(_("Updating volume status")) + def update_volume_stats(self): + """Retrieve stats info.""" + LOG.debug(_("Updating volume stats")) self.conn = self._get_ecom_connection() storage_type = self._get_storage_type() diff --git a/cinder/volume/drivers/emc/emc_smis_iscsi.py b/cinder/volume/drivers/emc/emc_smis_iscsi.py index 41117429906..24956246f21 100644 --- a/cinder/volume/drivers/emc/emc_smis_iscsi.py +++ b/cinder/volume/drivers/emc/emc_smis_iscsi.py @@ -221,19 +221,19 @@ def terminate_connection(self, volume, connector, **kwargs): self.common.terminate_connection(volume, connector) def get_volume_stats(self, refresh=False): - """Get volume status. + """Get volume stats. If 'refresh' is True, run update the stats first. """ if refresh: - self.update_volume_status() + self.update_volume_stats() return self._stats - def update_volume_status(self): - """Retrieve status info from volume group.""" - LOG.debug(_("Updating volume status")) - data = self.common.update_volume_status() + def update_volume_stats(self): + """Retrieve stats info from volume group.""" + LOG.debug(_("Updating volume stats")) + data = self.common.update_volume_stats() backend_name = self.configuration.safe_get('volume_backend_name') data['volume_backend_name'] = backend_name or 'EMCSMISISCSIDriver' data['storage_protocol'] = 'iSCSI' diff --git a/cinder/volume/drivers/gpfs.py b/cinder/volume/drivers/gpfs.py index 901924c7e77..c076e561a99 100644 --- a/cinder/volume/drivers/gpfs.py +++ b/cinder/volume/drivers/gpfs.py @@ -332,20 +332,20 @@ def terminate_connection(self, volume, connector, **kwargs): pass def get_volume_stats(self, refresh=False): - """Get volume status. + """Get volume stats. If 'refresh' is True, or stats have never been updated, run update the stats first. """ if not self._stats or refresh: - self._update_volume_status() + self._update_volume_stats() return self._stats - def _update_volume_status(self): - """Retrieve status info from volume group.""" + def _update_volume_stats(self): + """Retrieve stats info from volume group.""" - LOG.debug("Updating volume status") + LOG.debug("Updating volume stats") data = {} backend_name = self.configuration.safe_get('volume_backend_name') data["volume_backend_name"] = backend_name or 'GPFS' diff --git a/cinder/volume/drivers/huawei/huawei_iscsi.py b/cinder/volume/drivers/huawei/huawei_iscsi.py index 4c868668b14..ac66098e4fb 100644 --- a/cinder/volume/drivers/huawei/huawei_iscsi.py +++ b/cinder/volume/drivers/huawei/huawei_iscsi.py @@ -546,12 +546,12 @@ def create_volume_from_snapshot(self, volume, snapshot): self._delete_luncopy(luncopy_id) def get_volume_stats(self, refresh=False): - """Get volume status. + """Get volume stats. If 'refresh' is True, run update the stats first. """ if refresh: - self._update_volume_status() + self._update_volume_stats() return self._stats @@ -1501,10 +1501,10 @@ def _is_resource_pool_enough(self): return False return True - def _update_volume_status(self): - """Retrieve status info from volume group.""" + def _update_volume_stats(self): + """Retrieve stats info from volume group.""" - LOG.debug(_("Updating volume status")) + LOG.debug(_("Updating volume stats")) data = {} backend_name = self.configuration.safe_get('volume_backend_name') data["volume_backend_name"] = backend_name or 'HuaweiISCSIDriver' diff --git a/cinder/volume/drivers/lvm.py b/cinder/volume/drivers/lvm.py index 18640c077df..9b26468948a 100644 --- a/cinder/volume/drivers/lvm.py +++ b/cinder/volume/drivers/lvm.py @@ -531,19 +531,19 @@ def remove_export(self, context, volume): self.tgtadm.remove_iscsi_target(iscsi_target, 0, volume['id']) def get_volume_stats(self, refresh=False): - """Get volume status. + """Get volume stats. If 'refresh' is True, run update the stats first. """ if refresh: - self._update_volume_status() + self._update_volume_stats() return self._stats - def _update_volume_status(self): - """Retrieve status info from volume group.""" + def _update_volume_stats(self): + """Retrieve stats info from volume group.""" - LOG.debug(_("Updating volume status")) + LOG.debug(_("Updating volume stats")) data = {} # Note(zhiteng): These information are driver/backend specific, @@ -566,7 +566,7 @@ def _update_volume_status(self): self.configuration.volume_group, run_as_root=True) except exception.ProcessExecutionError as exc: - LOG.error(_("Error retrieving volume status: %s"), exc.stderr) + LOG.error(_("Error retrieving volume stats: %s"), exc.stderr) out = False if out: @@ -659,18 +659,18 @@ def create_snapshot(self, snapshot): self._do_lvm_snapshot(orig_lv_name, snapshot) def get_volume_stats(self, refresh=False): - """Get volume status. + """Get volume stats. If 'refresh' is True, run update the stats first. """ if refresh: - self._update_volume_status() + self._update_volume_stats() return self._stats - def _update_volume_status(self): - """Retrieve status info from volume group.""" + def _update_volume_stats(self): + """Retrieve stats info from volume group.""" - LOG.debug(_("Updating volume status")) + LOG.debug(_("Updating volume stats")) data = {} backend_name = self.configuration.safe_get('volume_backend_name') diff --git a/cinder/volume/drivers/netapp/iscsi.py b/cinder/volume/drivers/netapp/iscsi.py index a83e274a15d..266b926cf1d 100644 --- a/cinder/volume/drivers/netapp/iscsi.py +++ b/cinder/volume/drivers/netapp/iscsi.py @@ -537,17 +537,17 @@ def create_cloned_volume(self, volume, src_vref): self._clone_lun(src_vol.name, new_name, 'true') def get_volume_stats(self, refresh=False): - """Get volume status. + """Get volume stats. If 'refresh' is True, run update the stats first. """ if refresh: - self._update_volume_status() + self._update_volume_stats() return self._stats - def _update_volume_status(self): - """Retrieve status info from volume group.""" + def _update_volume_stats(self): + """Retrieve stats info from volume group.""" raise NotImplementedError() @@ -829,10 +829,10 @@ def _configure_tunneling(self, do_tunneling=False): else: self.client.set_vserver(None) - def _update_volume_status(self): - """Retrieve status info from volume group.""" + def _update_volume_stats(self): + """Retrieve stats info from volume group.""" - LOG.debug(_("Updating volume status")) + LOG.debug(_("Updating volume stats")) data = {} netapp_backend = 'NetApp_iSCSI_Cluster_direct' backend_name = self.configuration.safe_get('volume_backend_name') @@ -1112,10 +1112,10 @@ def _create_lun_meta(self, lun): 'is-space-reservation-enabled') return meta_dict - def _update_volume_status(self): + def _update_volume_stats(self): """Retrieve status info from volume group.""" - LOG.debug(_("Updating volume status")) + LOG.debug(_("Updating volume stats")) data = {} netapp_backend = 'NetApp_iSCSI_7mode_direct' backend_name = self.configuration.safe_get('volume_backend_name') diff --git a/cinder/volume/drivers/netapp/nfs.py b/cinder/volume/drivers/netapp/nfs.py index c15787584bb..30d4b49b2b8 100644 --- a/cinder/volume/drivers/netapp/nfs.py +++ b/cinder/volume/drivers/netapp/nfs.py @@ -182,9 +182,9 @@ def create_cloned_volume(self, volume, src_vref): return {'provider_location': share} - def _update_volume_status(self): - """Retrieve status info from volume group.""" - super(NetAppNFSDriver, self)._update_volume_status() + def _update_volume_stats(self): + """Retrieve stats info from volume group.""" + super(NetAppNFSDriver, self)._update_volume_stats() class NetAppDirectNfsDriver (NetAppNFSDriver): @@ -344,9 +344,9 @@ def _clone_file(self, volume, src_path, dest_path, vserver=None): 'destination-path': dest_path}) self._invoke_successfully(clone_create, vserver) - def _update_volume_status(self): - """Retrieve status info from volume group.""" - super(NetAppDirectCmodeNfsDriver, self)._update_volume_status() + def _update_volume_stats(self): + """Retrieve stats info from volume group.""" + super(NetAppDirectCmodeNfsDriver, self)._update_volume_stats() netapp_backend = 'NetApp_NFS_cluster_direct' backend_name = self.configuration.safe_get('volume_backend_name') self._stats["volume_backend_name"] = (backend_name or @@ -476,9 +476,9 @@ def _clear_clone(self, clone_id): time.sleep(5) retry = retry - 1 - def _update_volume_status(self): - """Retrieve status info from volume group.""" - super(NetAppDirect7modeNfsDriver, self)._update_volume_status() + def _update_volume_stats(self): + """Retrieve stats info from volume group.""" + super(NetAppDirect7modeNfsDriver, self)._update_volume_stats() netapp_backend = 'NetApp_NFS_7mode_direct' backend_name = self.configuration.safe_get('volume_backend_name') self._stats["volume_backend_name"] = (backend_name or diff --git a/cinder/volume/drivers/nexenta/volume.py b/cinder/volume/drivers/nexenta/volume.py index 4bc3f68789b..d1813618609 100644 --- a/cinder/volume/drivers/nexenta/volume.py +++ b/cinder/volume/drivers/nexenta/volume.py @@ -284,17 +284,17 @@ def remove_export(self, _ctx, volume): {'target': target_name, 'exc': exc}) def get_volume_stats(self, refresh=False): - """Get volume status. + """Get volume stats. If 'refresh' is True, run update the stats first. """ if refresh: - self._update_volume_status() + self._update_volume_stats() return self._stats - def _update_volume_status(self): - """Retrieve status info for Nexenta device.""" + def _update_volume_stats(self): + """Retrieve stats info for Nexenta device.""" # NOTE(jdg): Aimon Bustardo was kind enough to point out the # info he had regarding Nexenta Capabilities, ideally it would @@ -303,7 +303,7 @@ def _update_volume_status(self): KB = 1024 MB = KB ** 2 - LOG.debug(_("Updating volume status")) + LOG.debug(_("Updating volume stats")) data = {} backend_name = self.__class__.__name__ if self.configuration: diff --git a/cinder/volume/drivers/nfs.py b/cinder/volume/drivers/nfs.py index 275b6100008..b851c4eb87d 100644 --- a/cinder/volume/drivers/nfs.py +++ b/cinder/volume/drivers/nfs.py @@ -436,17 +436,17 @@ def _mount_nfs(self, nfs_share, mount_path, ensure=False): raise def get_volume_stats(self, refresh=False): - """Get volume status. + """Get volume stats. If 'refresh' is True, run update the stats first. """ if refresh or not self._stats: - self._update_volume_status() + self._update_volume_stats() return self._stats - def _update_volume_status(self): - """Retrieve status info from volume group.""" + def _update_volume_stats(self): + """Retrieve stats info from volume group.""" data = {} backend_name = self.configuration.safe_get('volume_backend_name') diff --git a/cinder/volume/drivers/storwize_svc.py b/cinder/volume/drivers/storwize_svc.py index ad545c09f59..c339e34a89f 100755 --- a/cinder/volume/drivers/storwize_svc.py +++ b/cinder/volume/drivers/storwize_svc.py @@ -1343,20 +1343,20 @@ def copy_volume_to_image(self, context, volume, image_service, image_meta): """=====================================================================""" def get_volume_stats(self, refresh=False): - """Get volume status. + """Get volume stats. If we haven't gotten stats yet or 'refresh' is True, run update the stats first. """ if not self._stats or refresh: - self._update_volume_status() + self._update_volume_stats() return self._stats - def _update_volume_status(self): - """Retrieve status info from volume group.""" + def _update_volume_stats(self): + """Retrieve stats info from volume group.""" - LOG.debug(_("Updating volume status")) + LOG.debug(_("Updating volume stats")) data = {} data['vendor_name'] = 'IBM' @@ -1373,7 +1373,7 @@ def _update_volume_status(self): ssh_cmd = 'svcinfo lssystem -delim !' attributes = self._execute_command_and_parse_attributes(ssh_cmd) if not attributes or not attributes['name']: - exception_message = (_('_update_volume_status: ' + exception_message = (_('_update_volume_stats: ' 'Could not get system name')) raise exception.VolumeBackendAPIException(data=exception_message) @@ -1386,7 +1386,7 @@ def _update_volume_status(self): attributes = self._execute_command_and_parse_attributes(ssh_cmd) if not attributes: LOG.error(_('Could not get pool data from the storage')) - exception_message = (_('_update_volume_status: ' + exception_message = (_('_update_volume_stats: ' 'Could not get storage pool data')) raise exception.VolumeBackendAPIException(data=exception_message)