Improved fail_reason for cinder-backup swift connection errors

Modified swift backup service to catch socket errors when talking to
swift and raise a specific SwiftConnectionFailed exception in these
cases. This allows us to provide a more readable error message
detailing the problem connecting to swift to the end user when they
view the backup. Also reduced the default number of swift retries
so devstack environments fail faster - production environments can
tune these in cinder.conf.

Fixes bug: 1132791

Change-Id: Ibca744ea5adcbd31d068ac3d858bde6a4a0c9844
This commit is contained in:
Stephen Mulcahy
2013-02-28 12:11:39 +00:00
parent dd01069033
commit 3fc515e77a
4 changed files with 80 additions and 8 deletions

View File

@@ -558,3 +558,7 @@ class BackupNotFound(NotFound):
class InvalidBackup(Invalid):
message = _("Invalid backup: %(reason)s")
class SwiftConnectionFailed(CinderException):
message = _("Connection to swift failed") + ": %(reason)s"