Hitachi: Use get_volume_stats in the base driver

The get_volume_stats has moved to the base volume driver. Therefore
Hitachi VSP driver should use it.

Change-Id: I7825392f2f5d9d1300eba4b66ebb89a0a0df4711
This commit is contained in:
Kazumasa Nomura 2021-02-16 07:44:42 +00:00
parent c6b2ea4253
commit 3343ca773f
3 changed files with 8 additions and 17 deletions

View File

@ -137,8 +137,6 @@ class HBSDCommon():
'portals': {},
}
self._stats = {}
def create_ldev(self, size):
"""Create an LDEV and return its LDEV number."""
raise NotImplementedError()
@ -331,11 +329,10 @@ class HBSDCommon():
backend_state='down'))
data["pools"].append(single_pool)
LOG.debug("Updating volume status. (%s)", data)
self._stats = data
utils.output_log(
MSG.POOL_INFO_RETRIEVAL_FAILED,
pool=self.conf.hitachi_pool)
return
return data
single_pool.update(dict(
total_capacity_gb=total_capacity,
free_capacity_gb=free_capacity,
@ -349,13 +346,7 @@ class HBSDCommon():
single_pool.update(dict(backend_state='up'))
data["pools"].append(single_pool)
LOG.debug("Updating volume status. (%s)", data)
self._stats = data
def get_volume_stats(self, refresh=False):
"""Return properties, capabilities and current states of the driver."""
if refresh:
self.update_volume_stats()
return self._stats
return data
def discard_zero_page(self, volume):
"""Return the volume's no-data pages to the storage pool."""

View File

@ -120,14 +120,14 @@ class HBSDFCDriver(driver.FibreChannelDriver):
def local_path(self, volume):
pass
def get_volume_stats(self, refresh=False):
def _update_volume_stats(self):
"""Return properties, capabilities and current states of the driver."""
data = self.common.get_volume_stats(refresh)
data = self.common.update_volume_stats()
if 'pools' in data:
data["pools"][0]["filter_function"] = self.get_filter_function()
data["pools"][0]["goodness_function"] = (
self.get_goodness_function())
return data
self._stats = data
@volume_utils.trace
def update_migrated_volume(

View File

@ -104,14 +104,14 @@ class HBSDISCSIDriver(driver.ISCSIDriver):
def local_path(self, volume):
pass
def get_volume_stats(self, refresh=False):
def _update_volume_stats(self):
"""Return properties, capabilities and current states of the driver."""
data = self.common.get_volume_stats(refresh)
data = self.common.update_volume_stats()
if 'pools' in data:
data["pools"][0]["filter_function"] = self.get_filter_function()
data["pools"][0]["goodness_function"] = (
self.get_goodness_function())
return data
self._stats = data
@volume_utils.trace
def update_migrated_volume(