From: Steven Kaufer Date: Wed, 18 Feb 2015 21:45:57 +0000 (+0000) Subject: Implement refresh as kwargs in get_volume_stats X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=02f55f859f9dce178b0e6b633fe893192f4e5306;p=openstack-build%2Fcinder-build.git Implement refresh as kwargs in get_volume_stats 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 --- diff --git a/cinder/volume/drivers/san/hp/hp_3par_common.py b/cinder/volume/drivers/san/hp/hp_3par_common.py index e9e0e9721..4d8d44967 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_common.py +++ b/cinder/volume/drivers/san/hp/hp_3par_common.py @@ -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() diff --git a/cinder/volume/drivers/san/hp/hp_3par_fc.py b/cinder/volume/drivers/san/hp/hp_3par_fc.py index 4bec1a7ec..b003174b7 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_fc.py +++ b/cinder/volume/drivers/san/hp/hp_3par_fc.py @@ -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) diff --git a/cinder/volume/drivers/san/hp/hp_3par_iscsi.py b/cinder/volume/drivers/san/hp/hp_3par_iscsi.py index 834b0247d..71aebe250 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_iscsi.py +++ b/cinder/volume/drivers/san/hp/hp_3par_iscsi.py @@ -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) diff --git a/cinder/volume/drivers/san/hp/hp_lefthand_cliq_proxy.py b/cinder/volume/drivers/san/hp/hp_lefthand_cliq_proxy.py index c6954984b..dc6f1ac8d 100644 --- a/cinder/volume/drivers/san/hp/hp_lefthand_cliq_proxy.py +++ b/cinder/volume/drivers/san/hp/hp_lefthand_cliq_proxy.py @@ -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() diff --git a/cinder/volume/drivers/san/hp/hp_lefthand_iscsi.py b/cinder/volume/drivers/san/hp/hp_lefthand_iscsi.py index 342d2c57e..a13e6e010 100644 --- a/cinder/volume/drivers/san/hp/hp_lefthand_iscsi.py +++ b/cinder/volume/drivers/san/hp/hp_lefthand_iscsi.py @@ -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 diff --git a/cinder/volume/drivers/san/hp/hp_lefthand_rest_proxy.py b/cinder/volume/drivers/san/hp/hp_lefthand_rest_proxy.py index 59e03b341..19efa9112 100644 --- a/cinder/volume/drivers/san/hp/hp_lefthand_rest_proxy.py +++ b/cinder/volume/drivers/san/hp/hp_lefthand_rest_proxy.py @@ -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: diff --git a/cinder/volume/drivers/san/hp/hp_msa_common.py b/cinder/volume/drivers/san/hp/hp_msa_common.py index 74d3266e1..11e98985f 100644 --- a/cinder/volume/drivers/san/hp/hp_msa_common.py +++ b/cinder/volume/drivers/san/hp/hp_msa_common.py @@ -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()