[gnuoy, r=james-page] If the swift proxy servers are down the swift client throws requests.exceptions.ConnectionError not exceptions.ClientException

This commit is contained in:
Liam Young 2016-01-28 09:43:20 +01:00
commit 36b68332dd
1 changed files with 3 additions and 1 deletions

View File

@ -473,6 +473,7 @@ def swift_temp_url_key():
"""Generate a temp URL key, post it to Swift and return its value.
If it is already posted, the current value of the key will be returned.
"""
import requests
keystone_ctxt = context.IdentityServiceContext(service='glance',
service_user='glance')()
if not keystone_ctxt:
@ -487,7 +488,8 @@ def swift_temp_url_key():
from swiftclient import exceptions
@retry_on_exception(15, base_delay=10,
exc_type=exceptions.ClientException)
exc_type=(exceptions.ClientException,
requests.exceptions.ConnectionError))
def connect_and_post():
log('Connecting swift client...')
swift_connection = client.Connection(