Merge "Add in check for successful swift setup"

This commit is contained in:
Jenkins 2014-08-05 19:36:12 +00:00 committed by Gerrit Code Review
commit e1d66f7935
1 changed files with 10 additions and 1 deletions

View File

@ -14,6 +14,7 @@
import hmac
from hashlib import sha1
import logging
from time import time
import os
import random
@ -24,6 +25,8 @@ import urlparse
class Swift(object):
log = logging.getLogger("zuul.lib.swift")
def __init__(self, config):
self.config = config
self.connection = False
@ -36,7 +39,13 @@ class Swift(object):
for x in range(20)
)
self.connect()
self.storage_url = ''
try:
self.connect()
except Exception as e:
self.log.warning("Unable to set up swift. Signed storage URL is "
"likely to be wrong. %s" % e)
def connect(self):
if self.config.has_section('swift'):