Repository: libcloud Updated Branches: refs/heads/trunk 37364fe81 -> 06cdd4e4b
Fix bug LIBCLOUD-635 - openstack-swift auth v2 As reported by James in LIBCLOUD-635 https://issues.apache.org/jira/browse/LIBCLOUD-635 OpenStack-Swift authentication is broken from at least 0.16. I confirmed the bug in 0.17 and master. the code here tries to perform operations on a OpenStackServiceCatalogEntryEndpoint that cannot be performed on this class. Since get_endpoint() will return an endpoint with a URL (not 3 different URLs: publicURL/internalURL/ adminURL) or error, it should be safe to test for existence and use the url. However, review very welcome! This fix has been tested against OpenStack Juno. Closes #492 Signed-off-by: Tomaz Muraus <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/06cdd4e4 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/06cdd4e4 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/06cdd4e4 Branch: refs/heads/trunk Commit: 06cdd4e4b98c2ad4bf9857218c26cc423214823b Parents: 37364fe Author: Tom Fifield <[email protected]> Authored: Wed Apr 1 10:05:36 2015 +0800 Committer: Tomaz Muraus <[email protected]> Committed: Sat Apr 4 21:51:40 2015 +0200 ---------------------------------------------------------------------- CHANGES.rst | 7 +++++++ libcloud/storage/drivers/cloudfiles.py | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/06cdd4e4/CHANGES.rst ---------------------------------------------------------------------- diff --git a/CHANGES.rst b/CHANGES.rst index 73da6ec..09bc432 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -141,6 +141,13 @@ Compute (GITHUB-490) [Tomaz Muraus] +Storage +~~~~~~~ + +- Fix a bug with authentication in the OpenStack Swift driver. + (GITHUB-492, LIBCLOUD-635) + [Tom Fifield] + DNS ~~~ http://git-wip-us.apache.org/repos/asf/libcloud/blob/06cdd4e4/libcloud/storage/drivers/cloudfiles.py ---------------------------------------------------------------------- diff --git a/libcloud/storage/drivers/cloudfiles.py b/libcloud/storage/drivers/cloudfiles.py index 314586b..ef854fc 100644 --- a/libcloud/storage/drivers/cloudfiles.py +++ b/libcloud/storage/drivers/cloudfiles.py @@ -138,8 +138,8 @@ class OpenStackSwiftConnection(OpenStackBaseConnection): endpoint = self.service_catalog.get_endpoint( name=self._service_name, region=self._service_region) - if PUBLIC_ENDPOINT_KEY in endpoint: - return endpoint[PUBLIC_ENDPOINT_KEY] + if endpoint: + return endpoint.url else: raise LibcloudError('Could not find specified endpoint')
