From 9633697ae08bc222c07b96e777061c7d24f45273 Mon Sep 17 00:00:00 2001 From: Hengqing Hu Date: Thu, 5 Jan 2012 10:27:30 +0800 Subject: [PATCH] Add comments for swift options in glance-api.conf. 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 --- Authors | 1 + etc/glance-api.conf | 7 ++++++- glance/store/swift.py | 14 ++++++++------ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Authors b/Authors index 3b9e3652f3..2f86707646 100644 --- a/Authors +++ b/Authors @@ -9,6 +9,7 @@ Dan Prince Donal Lafferty Eldar Nugaev Ewan Mellor +Hengqing Hu Isaku Yamahata Jason Koelker Jay Pipes diff --git a/etc/glance-api.conf b/etc/glance-api.conf index ae396db9f9..37fa901074 100644 --- a/etc/glance-api.conf +++ b/etc/glance-api.conf @@ -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 diff --git a/glance/store/swift.py b/glance/store/swift.py index 876e1ea1a4..918eed67de 100644 --- a/glance/store/swift.py +++ b/glance/store/swift.py @@ -101,12 +101,14 @@ class StoreLocation(glance.store.location.StoreLocation): # 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)