[ https://issues.apache.org/jira/browse/LIBCLOUD-840?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16040731#comment-16040731 ]
ASF GitHub Bot commented on LIBCLOUD-840: ----------------------------------------- GitHub user hcarlsso opened a pull request: https://github.com/apache/libcloud/pull/1068 Fix #LIBCLOUD-840 ## Update OpenStackSwiftConnection to work with auth version 3.0 ### Description Trivial change ### Status - done, ready for review ### Checklist (tick everything that applies) - [x] [Code linting](http://libcloud.readthedocs.org/en/latest/development.html#code-style-guide) (required, can be done after the PR checks) - [ ] Documentation - [ ] [Tests](http://libcloud.readthedocs.org/en/latest/testing.html) - [ ] [ICLA](http://libcloud.readthedocs.org/en/latest/development.html#contributing-bigger-changes) (required for bigger changes) You can merge this pull request into a Git repository by running: $ git pull https://github.com/hcarlsso/libcloud hcarlsso-patch-LIBCLOUD-840 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/libcloud/pull/1068.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1068 ---- commit 848d9a8c8fb4be81c31231ef602b0aea43b5fa6b Author: Hakan Carlsson <hakan.carls...@gmail.com> Date: 2017-06-07T11:22:40Z Fix #LIBCLOUD-840 Update OpenStackSwiftConnection to work with auth version 3.0 ---- > libcloud crashs when accessing Swift based object store using Keystone auth > API v3 > ---------------------------------------------------------------------------------- > > Key: LIBCLOUD-840 > URL: https://issues.apache.org/jira/browse/LIBCLOUD-840 > Project: Libcloud > Issue Type: Bug > Components: Storage > Environment: ANY > Reporter: Mario Oschwald > Priority: Critical > Attachments: LIBCLOUD-840-fix.patch > > > libcloud crashs when accessing Swift based object store using Keystone auth > API v3 > Code to reproduce: > {code} > from libcloud.storage.types import Provider > from libcloud.storage.providers import get_driver > cls = get_driver(Provider.OPENSTACK_SWIFT) > driver = cls('USER', 'PASSWORD', ex_force_auth_version='3.x_password', > ex_force_auth_url='https://keystone.cst.de:5001', > ex_tenant_name='signing_service', ex_domain_name='AD', > ex_force_service_name='ceph') > container = driver.create_container(container_name='fnord') > {code} > This produces the following stack trace: > {code} > Traceback (most recent call last): > File "D:/DEV/MAIN/Release Management/bin/cstutil/cloudtools.py", line 18, > in <module> > main() > File "D:/DEV/MAIN/Release Management/bin/cstutil/cloudtools.py", line 14, > in main > container = driver.create_container(container_name='fnord') > File > "C:\Python27\lib\site-packages\libcloud\storage\drivers\cloudfiles.py", line > 358, in create_container > '/%s' % (container_name_encoded), method='PUT') > File > "C:\Python27\lib\site-packages\libcloud\storage\drivers\cloudfiles.py", line > 163, in request > raw=raw) > File "C:\Python27\lib\site-packages\libcloud\common\openstack.py", line > 227, in request > raw=raw) > File "C:\Python27\lib\site-packages\libcloud\common\base.py", line 753, in > request > action = self.morph_action_hook(action) > File "C:\Python27\lib\site-packages\libcloud\common\openstack.py", line > 294, in morph_action_hook > self._populate_hosts_and_request_paths() > File "C:\Python27\lib\site-packages\libcloud\common\openstack.py", line > 338, in _populate_hosts_and_request_paths > url = self._ex_force_base_url or self.get_endpoint() > File > "C:\Python27\lib\site-packages\libcloud\storage\drivers\cloudfiles.py", line > 141, in get_endpoint > if endpoint: > UnboundLocalError: local variable 'endpoint' referenced before assignment > {code} > Please see attached patch for a trivial fix. Using the 2.0 endpoint locator > mechanism works fine with 3.x -- This message was sent by Atlassian JIRA (v6.3.15#6346)