From d596bfe6562307343858f419062756640000b0c8 Mon Sep 17 00:00:00 2001 From: John Griffith Date: Fri, 28 Jun 2013 15:56:46 -0600 Subject: [PATCH] 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 --- cinder/volume/drivers/solidfire.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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 -- 2.45.2