Uploaded image for project: 'Libcloud'
  1. Libcloud
  2. LIBCLOUD-840

libcloud crashs when accessing Swift based object store using Keystone auth API v3

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • None
    • None
    • Storage
    • None
    • ANY

    • Patch

    Description

      libcloud crashs when accessing Swift based object store using Keystone auth API v3

      Code to reproduce:

      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')
      

      This produces the following stack trace:

      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
      

      Please see attached patch for a trivial fix. Using the 2.0 endpoint locator
      mechanism works fine with 3.x

      Attachments

        1. LIBCLOUD-840-fix.patch
          0.6 kB
          Mario Oschwald

        Issue Links

          Activity

            People

              Unassigned Unassigned
              moschwald Mario Oschwald
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: