From: John Griffith Date: Fri, 28 Jun 2013 21:56:46 +0000 (-0600) Subject: Handle ECONNREFUSED exception in SolidFire driver. X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=d596bfe6562307343858f419062756640000b0c8;p=openstack-build%2Fcinder-build.git Handle ECONNREFUSED exception in SolidFire driver. The SolidFire driver wasn't handling connection exceptions during init (capacity updates from scheduler). This patch add a try/except wrap around the two places that this is called and logs and error rather than crashing cinder-volume service. Fixes bug: 1195910 Change-Id: I30347cc0973bbf9dbc30ea02e204560095fc75b4 --- diff --git a/cinder/volume/drivers/solidfire.py b/cinder/volume/drivers/solidfire.py index f4bf1bb8b..ce4d56af6 100644 --- a/cinder/volume/drivers/solidfire.py +++ b/cinder/volume/drivers/solidfire.py @@ -85,7 +85,12 @@ class SolidFire(SanISCSIDriver): def __init__(self, *args, **kwargs): super(SolidFire, self).__init__(*args, **kwargs) self.configuration.append_config_values(sf_opts) - self._update_cluster_status() + try: + self._update_cluster_status() + except Exception as ex: + LOG.error(_("Update SolidFire Cluster stats failed: %s"), + ex.strerror) + pass def _issue_api_request(self, method_name, params): """All API requests to SolidFire device go through this method. @@ -566,7 +571,12 @@ class SolidFire(SanISCSIDriver): data """ if refresh: - self._update_cluster_status() + try: + self._update_cluster_status() + except Exception as ex: + LOG.error(_("Update SolidFire Cluster stats failed: %s"), + ex.strerror) + pass return self.cluster_stats