From: John Griffith Date: Wed, 21 Aug 2013 19:05:30 +0000 (-0600) Subject: Dont crash service if sf cluster isnt available X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=e13b7d8a46cd54e61bdc20500ad597c2545ffaed;p=openstack-build%2Fcinder-build.git Dont crash service if sf cluster isnt available Currently if the SolidFire driver is configured but the cluster isn't available for some reason the ensure_export call will raise an unhandled exception and crash the volume-service. We should be able to handle things like loosing connectivity to a single back-end without impacting the other volume-service backends. We'll wrap the ensure_export call in a try block here and return None in the case that the connection can't be made. This will keep the service from crashing and log an error message that the connection timed out. Additional work would include adding a periodic retry task to the manager to try and start the backend service for us on some regular interval incase the device comes back. Fixes: bug 1215064 Change-Id: Ice3f517d220c40113074bb77adbb10d5e32abd0b --- diff --git a/cinder/volume/drivers/solidfire.py b/cinder/volume/drivers/solidfire.py index 3dc055577..59acd2021 100644 --- a/cinder/volume/drivers/solidfire.py +++ b/cinder/volume/drivers/solidfire.py @@ -557,7 +557,10 @@ class SolidFireDriver(SanISCSIDriver): def ensure_export(self, context, volume): """Verify the iscsi export info.""" LOG.debug(_("Executing SolidFire ensure_export...")) - return self._do_export(volume) + try: + return self._do_export(volume) + except exception.SolidFireAPIException: + return None def create_export(self, context, volume): """Setup the iscsi export info."""