Skip to content

Commit

Permalink
Add comments for swift options in glance-api.conf.
Browse files Browse the repository at this point in the history
Fixes bug #771465.

Comments added for the following two options in
glance-api.conf
    'swift_store_auth_address'
    'swift_store_user'

Indent reason for BadStoreUri exception in swift.py.

Change-Id: Ife28e01a4e2344cf1e5a179752d244b68e45d348
  • Loading branch information
hudayou committed Jan 5, 2012
1 parent b7796ec commit 9633697
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions Authors
Expand Up @@ -9,6 +9,7 @@ Dan Prince <dan.prince@rackspace.com>
Donal Lafferty <donal.lafferty@citrix.com>
Eldar Nugaev <enugaev@griddynamics.com>
Ewan Mellor <ewan.mellor@citrix.com>
Hengqing Hu <hudayou@hotmail.com>
Isaku Yamahata <yamahata@valinux.co.jp>
Jason Koelker <jason@koelker.net>
Jay Pipes <jaypipes@gmail.com>
Expand Down
7 changes: 6 additions & 1 deletion etc/glance-api.conf
Expand Up @@ -102,10 +102,15 @@ filesystem_store_datadir = /var/lib/glance/images/
# ============ Swift Store Options =============================

# Address where the Swift authentication service lives
# Valid schemes are 'http://' and 'https://'
# If no scheme specified, default to 'https://'
swift_store_auth_address = 127.0.0.1:8080/v1.0/

# User to authenticate against the Swift authentication service
swift_store_user = jdoe
# If you use Swift authentication service, set it to 'account':'user'
# where 'account' is a Swift storage account and 'user'
# is a user in that account
swift_store_user = jdoe:jdoe

# Auth key for the user authenticating against the
# Swift authentication service
Expand Down
14 changes: 8 additions & 6 deletions glance/store/swift.py
Expand Up @@ -101,12 +101,14 @@ def parse_uri(self, uri):
# swift://user:pass@http://authurl.com/v1/container/obj
# are immediately rejected.
if uri.count('://') != 1:
reason = _("URI Cannot contain more than one occurrence of a "
"scheme. If you have specified a "
"URI like swift://user:pass@http://authurl.com/v1/"
"container/obj, you need to change it to use the "
"swift+http:// scheme, like so: "
"swift+http://user:pass@authurl.com/v1/container/obj")
reason = _(
"URI cannot contain more than one occurrence of a scheme."
"If you have specified a URI like "
"swift://user:pass@http://authurl.com/v1/container/obj"
", you need to change it to use the swift+http:// scheme, "
"like so: "
"swift+http://user:pass@authurl.com/v1/container/obj"
)
raise exception.BadStoreUri(uri, reason)

pieces = urlparse.urlparse(uri)
Expand Down

0 comments on commit 9633697

Please sign in to comment.