]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Implement refresh as kwargs in get_volume_stats
authorSteven Kaufer <kaufer@us.ibm.com>
Wed, 18 Feb 2015 21:45:57 +0000 (21:45 +0000)
committerSteven Kaufer <kaufer@us.ibm.com>
Wed, 18 Feb 2015 21:55:01 +0000 (21:55 +0000)
When implementing the base driver "get_volume_stats" function, not all
drivers implemented 'refresh' as a kwarg. This can cause failures for any
code that simply invokes the following (assuming that refresh will default
to False -- which is does for 50+ drivers):

    driver.get_volume_stats()

This patch set updates the 7 drivers that did not implement refresh as a
kwarg so that the various driver implementations are consistent.

Closes-bug: 1423357
Change-Id: I6520155d1cbde4bf41573c170f4ea81815b5c1c2

cinder/volume/drivers/san/hp/hp_3par_common.py
cinder/volume/drivers/san/hp/hp_3par_fc.py
cinder/volume/drivers/san/hp/hp_3par_iscsi.py
cinder/volume/drivers/san/hp/hp_lefthand_cliq_proxy.py
cinder/volume/drivers/san/hp/hp_lefthand_iscsi.py
cinder/volume/drivers/san/hp/hp_lefthand_rest_proxy.py
cinder/volume/drivers/san/hp/hp_msa_common.py

index e9e0e97212227282dc518aa0d98d6f320b4c593b..4d8d44967ad3a8e22ca4ef8d2cc05ec442c08739 100644 (file)
@@ -658,7 +658,7 @@ class HP3PARCommon(object):
 
         return iscsi_ports
 
-    def get_volume_stats(self, refresh):
+    def get_volume_stats(self, refresh=False):
         if refresh:
             self._update_volume_stats()
 
index 4bec1a7ecf8943de862c73d5b689cf08183f4d87..b003174b7d78ee386fefff3d60ec7edf29237029 100644 (file)
@@ -105,7 +105,7 @@ class HP3PARFCDriver(cinder.volume.driver.FibreChannelDriver):
                           'san_ip', 'san_login', 'san_password']
         common.check_flags(self.configuration, required_flags)
 
-    def get_volume_stats(self, refresh):
+    def get_volume_stats(self, refresh=False):
         common = self._login()
         try:
             stats = common.get_volume_stats(refresh)
index 834b0247d56f653bb0b7ef17768100bc5acd871e..71aebe250042e5b4ac2404937633ee422fc56656 100644 (file)
@@ -109,7 +109,7 @@ class HP3PARISCSIDriver(cinder.volume.driver.ISCSIDriver):
                           'san_password']
         common.check_flags(self.configuration, required_flags)
 
-    def get_volume_stats(self, refresh):
+    def get_volume_stats(self, refresh=False):
         common = self._login()
         try:
             stats = common.get_volume_stats(refresh)
index c6954984b5a9322b40ec8c6c8a26971b7663dcba..dc6f1ac8d46c37584a6f58a2616b309e4b5dd805 100644 (file)
@@ -415,7 +415,7 @@ class HPLeftHandCLIQProxy(SanISCSIDriver):
         cliq_args['serverName'] = connector['host']
         self._cliq_run_xml("unassignVolumeToServer", cliq_args)
 
-    def get_volume_stats(self, refresh):
+    def get_volume_stats(self, refresh=False):
         if refresh:
             self._update_backend_status()
 
index 342d2c57e681947bb1289402d145dfad6ea38378..a13e6e01068bb39fdbdca77732a1ec7c24bf80a2 100644 (file)
@@ -128,7 +128,7 @@ class HPLeftHandISCSIDriver(VolumeDriver):
         """Unassign the volume from the host."""
         self.proxy.terminate_connection(volume, connector)
 
-    def get_volume_stats(self, refresh):
+    def get_volume_stats(self, refresh=False):
         data = self.proxy.get_volume_stats(refresh)
         data['driver_version'] = self.VERSION
         return data
index 59e03b34132ee6e12ff1c5fcbb715a318d362b4f..19efa91122af1dac66746350aff25eeaa8bc68d9 100644 (file)
@@ -260,7 +260,7 @@ class HPLeftHandRESTProxy(ISCSIDriver):
         finally:
             self._logout(client)
 
-    def get_volume_stats(self, refresh):
+    def get_volume_stats(self, refresh=False):
         """Gets volume stats."""
         client = self._login()
         try:
index 74d3266e105b97b55e971c71f72b152d93b38437..11e98985f280e997e1c372db6908f03e53107a49 100644 (file)
@@ -226,7 +226,7 @@ class HPMSACommon(object):
                 return
             raise exception.Invalid(ex)
 
-    def get_volume_stats(self, refresh):
+    def get_volume_stats(self, refresh=False):
         if refresh:
             self._update_volume_stats()