]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Handle ECONNREFUSED exception in SolidFire driver.
authorJohn Griffith <john.griffith@solidfire.com>
Fri, 28 Jun 2013 21:56:46 +0000 (15:56 -0600)
committerJohn Griffith <john.griffith@solidfire.com>
Fri, 28 Jun 2013 22:23:29 +0000 (16:23 -0600)
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

index f4bf1bb8b0d8eb60438ae4bc845e23deb1a35392..ce4d56af6ee91029b69942b99f522451bebafd0e 100644 (file)
@@ -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