Merge "Make swiftclient an optional dependency"

This commit is contained in:
Jenkins 2014-08-14 16:44:18 +00:00 committed by Gerrit Code Review
commit f2ee0d9495
2 changed files with 8 additions and 4 deletions

View File

@ -187,8 +187,11 @@ swift
"""""
To send (optional) swift upload instructions this section must be
present. Multiple destinations can be defined in the :ref:`jobs`
section of the layout.
present. Multiple destinations can be defined in the :ref:`jobs` section
of the layout.
If you are sending the temp-url-key or fetching the x-storage-url, you
will need the python-swiftclient module installed.
**X-Account-Meta-Temp-Url-Key** (optional)
This is the key used to sign the HMAC message. If you do not set a
@ -199,12 +202,13 @@ section of the layout.
you have set up the appropriate credentials in ``authurl`` below.
This isn't necessary if you know and have set your
X-Account-Meta-Temp-Url-Key.
If set, Zuul requires the python-swiftclient module.
``default: true``
**X-Storage-Url** (optional)
The storage URL is the destination to upload files into. If you do
not set this the ``authurl`` credentials are used to fetch the url
from swift.
from swift and Zuul will requires the python-swiftclient module.
**authurl** (optional)
The (keystone) Auth URL for swift.

View File

@ -20,7 +20,6 @@ import os
import random
import six
import string
import swiftclient
import urlparse
@ -111,6 +110,7 @@ class Swift(object):
if self.config.has_option('swift', os_option):
os_options[os_option] = self.config.get('swift', os_option)
import swiftclient
self.connection = swiftclient.client.Connection(
authurl=authurl, user=user, key=key, retries=retries,
preauthurl=preauthurl, preauthtoken=preauthtoken, snet=snet,