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

openstack swift authentication problem in 0.16.0

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Storage
    • Labels:
      None

      Description

      On 0.16.0, after connection to an OpenStack installation with code of the form:

      cls = get_driver(Provider.OPENSTACK_SWIFT)
      
      driver = cls("user", "password" , ex_force_auth_url="url", ex_tenant_name="tenant", ex_force_auth_version="2.0_password",ex_force_service_type='object-store', ex_force_service_name='swift', ex_force_service_region="region")
      

      When trying to do

      driver.list_containers()
      

      I get an exception, the bottom of the traceback for which looks like:

      /home/ubuntu/verify/local/lib/python2.7/site-packages/libcloud/common/openstack.pyc in morph_action_hook(self, action)
          253
          254     def morph_action_hook(self, action):
      --> 255         self._populate_hosts_and_request_paths()
          256         return super(OpenStackBaseConnection, self).morph_action_hook(action)
          257
      
      /home/ubuntu/verify/local/lib/python2.7/site-packages/libcloud/common/openstack.pyc in _populate_hosts_and_request_paths(self)
          297             self.service_catalog = osc
          298
      --> 299         url = self._ex_force_base_url or self.get_endpoint()
          300         self._set_up_connection_info(url=url)
          301
      
      /home/ubuntu/verify/local/lib/python2.7/site-packages/libcloud/storage/drivers/cloudfiles.pyc in get_endpoint(self, *args, **kwargs)
          139                 name=self._service_name, region=self._service_region)
          140
      --> 141         if PUBLIC_ENDPOINT_KEY in endpoint:
          142             return endpoint[PUBLIC_ENDPOINT_KEY]
          143         else:
      
      TypeError: argument of type 'OpenStackServiceCatalogEntryEndpoint' is not iterable
      

      The same code works without error on 0.15.1

        Activity

        Hide
        fifieldt Tom Fifield added a comment -

        Confirming this bug in libcloud 0.17.0

        Show
        fifieldt Tom Fifield added a comment - Confirming this bug in libcloud 0.17.0
        Hide
        fifieldt Tom Fifield added a comment -

        Here's a full ipython session that adds a print endpoint line above the trace (libcloud 0.17)

        In [9]: conn = OpenStack('demo', 'DEMO_PASS',
        ex_force_auth_url='http://10.0.0.11:5000',
        ex_force_auth_version='2.0_password',
        ex_tenant_name='demo',
        ex_force_service_region='regionOne')

        In [10]: conn.list_containers()
        <OpenStackServiceCatalogEntryEndpoint region=regionOne, url=http://controller:8080/v1/AUTH_4705ad9afbcf47918e1ec59ae203be50, type=external
        <OpenStackServiceCatalogEntryEndpoint region=regionOne, url=http://controller:8080/v1/AUTH_4705ad9afbcf47918e1ec59ae203be50, type=external
        <OpenStackServiceCatalogEntryEndpoint region=regionOne, url=http://controller:8080/v1/AUTH_4705ad9afbcf47918e1ec59ae203be50, type=external
        ---------------------------------------------------------------------------
        TypeError Traceback (most recent call last)
        <ipython-input-10-8f181ac12ed2> in <module>()
        ----> 1 conn.list_containers()

        /usr/local/lib/python2.7/dist-packages/libcloud/storage/base.pyc in list_containers(self)
        214 :rtype: ``list`` of :class:`Container`
        215 """
        --> 216 return list(self.iterate_containers())
        217
        218 def iterate_container_objects(self, container):

        /usr/local/lib/python2.7/dist-packages/libcloud/storage/drivers/cloudfiles.py in iterate_containers(self)
        270
        271 def iterate_containers(self):
        --> 272 response = self.connection.request('')
        273
        274 if response.status == httplib.NO_CONTENT:

        /usr/local/lib/python2.7/dist-packages/libcloud/storage/drivers/cloudfiles.py in request(self, action, params, data, headers, method, raw, cdn_request)
        164 params=params, data=data,
        165 method=method, headers=headers,
        --> 166 raw=raw)
        167
        168

        /usr/local/lib/python2.7/dist-packages/libcloud/common/openstack.pyc in request(self, action, params, data, headers, method, raw)
        198 method=method,
        199 headers=headers,
        --> 200 raw=raw)
        201
        202 def _get_auth_url(self):

        /usr/local/lib/python2.7/dist-packages/libcloud/common/base.pyc in request(self, action, params, data, headers, method, raw)
        655 headers = copy.copy(headers)
        656
        --> 657 action = self.morph_action_hook(action)
        658 self.action = action
        659 self.method = method

        /usr/local/lib/python2.7/dist-packages/libcloud/common/openstack.pyc in morph_action_hook(self, action)
        253
        254 def morph_action_hook(self, action):
        --> 255 self._populate_hosts_and_request_paths()
        256 return super(OpenStackBaseConnection, self).morph_action_hook(action)
        257

        /usr/local/lib/python2.7/dist-packages/libcloud/common/openstack.pyc in _populate_hosts_and_request_paths(self)
        297 self.service_catalog = osc
        298
        --> 299 url = self._ex_force_base_url or self.get_endpoint()
        300 self._set_up_connection_info(url=url)
        301

        /usr/local/lib/python2.7/dist-packages/libcloud/storage/drivers/cloudfiles.py in get_endpoint(self, *args, **kwargs)
        142 print endpoint
        143 print endpoint
        --> 144 if PUBLIC_ENDPOINT_KEY in endpoint:
        145 return endpoint[PUBLIC_ENDPOINT_KEY]
        146 else:

        TypeError: argument of type 'OpenStackServiceCatalogEntryEndpoint' is not iterable

        Show
        fifieldt Tom Fifield added a comment - Here's a full ipython session that adds a print endpoint line above the trace (libcloud 0.17) In [9] : conn = OpenStack('demo', 'DEMO_PASS', ex_force_auth_url='http://10.0.0.11:5000', ex_force_auth_version='2.0_password', ex_tenant_name='demo', ex_force_service_region='regionOne') In [10] : conn.list_containers() <OpenStackServiceCatalogEntryEndpoint region=regionOne, url= http://controller:8080/v1/AUTH_4705ad9afbcf47918e1ec59ae203be50 , type=external <OpenStackServiceCatalogEntryEndpoint region=regionOne, url= http://controller:8080/v1/AUTH_4705ad9afbcf47918e1ec59ae203be50 , type=external <OpenStackServiceCatalogEntryEndpoint region=regionOne, url= http://controller:8080/v1/AUTH_4705ad9afbcf47918e1ec59ae203be50 , type=external --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-10-8f181ac12ed2> in <module>() ----> 1 conn.list_containers() /usr/local/lib/python2.7/dist-packages/libcloud/storage/base.pyc in list_containers(self) 214 :rtype: ``list`` of :class:`Container` 215 """ --> 216 return list(self.iterate_containers()) 217 218 def iterate_container_objects(self, container): /usr/local/lib/python2.7/dist-packages/libcloud/storage/drivers/cloudfiles.py in iterate_containers(self) 270 271 def iterate_containers(self): --> 272 response = self.connection.request('') 273 274 if response.status == httplib.NO_CONTENT: /usr/local/lib/python2.7/dist-packages/libcloud/storage/drivers/cloudfiles.py in request(self, action, params, data, headers, method, raw, cdn_request) 164 params=params, data=data, 165 method=method, headers=headers, --> 166 raw=raw) 167 168 /usr/local/lib/python2.7/dist-packages/libcloud/common/openstack.pyc in request(self, action, params, data, headers, method, raw) 198 method=method, 199 headers=headers, --> 200 raw=raw) 201 202 def _get_auth_url(self): /usr/local/lib/python2.7/dist-packages/libcloud/common/base.pyc in request(self, action, params, data, headers, method, raw) 655 headers = copy.copy(headers) 656 --> 657 action = self.morph_action_hook(action) 658 self.action = action 659 self.method = method /usr/local/lib/python2.7/dist-packages/libcloud/common/openstack.pyc in morph_action_hook(self, action) 253 254 def morph_action_hook(self, action): --> 255 self._populate_hosts_and_request_paths() 256 return super(OpenStackBaseConnection, self).morph_action_hook(action) 257 /usr/local/lib/python2.7/dist-packages/libcloud/common/openstack.pyc in _populate_hosts_and_request_paths(self) 297 self.service_catalog = osc 298 --> 299 url = self._ex_force_base_url or self.get_endpoint() 300 self._set_up_connection_info(url=url) 301 /usr/local/lib/python2.7/dist-packages/libcloud/storage/drivers/cloudfiles.py in get_endpoint(self, *args, **kwargs) 142 print endpoint 143 print endpoint --> 144 if PUBLIC_ENDPOINT_KEY in endpoint: 145 return endpoint [PUBLIC_ENDPOINT_KEY] 146 else: TypeError: argument of type 'OpenStackServiceCatalogEntryEndpoint' is not iterable
        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user fifieldt opened a pull request:

        https://github.com/apache/libcloud/pull/492

        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.

        You can merge this pull request into a Git repository by running:

        $ git pull https://github.com/fifieldt/libcloud trunk

        Alternatively you can review and apply these changes as the patch at:

        https://github.com/apache/libcloud/pull/492.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 #492


        commit ec58868c3344a9bfe7a0166fc31c0548ed22ea87
        Author: Tom Fifield <tom@openstack.org>
        Date: 2015-04-01T02:05:36Z

        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.


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user fifieldt opened a pull request: https://github.com/apache/libcloud/pull/492 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. You can merge this pull request into a Git repository by running: $ git pull https://github.com/fifieldt/libcloud trunk Alternatively you can review and apply these changes as the patch at: https://github.com/apache/libcloud/pull/492.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 #492 commit ec58868c3344a9bfe7a0166fc31c0548ed22ea87 Author: Tom Fifield <tom@openstack.org> Date: 2015-04-01T02:05:36Z 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.
        Show
        fifieldt Tom Fifield added a comment - https://github.com/apache/libcloud/pull/492
        Hide
        fifieldt Tom Fifield added a comment -

        Received contact from Christian Berendt <christian@berendt.io>.

        He experienced the same bug on python-libcloud-0.17.0 on CentOS Linux 7 (Core) connecting to a Juno cloud (swift 2.2.0), and the fix worked for him.

        Show
        fifieldt Tom Fifield added a comment - Received contact from Christian Berendt <christian@berendt.io>. He experienced the same bug on python-libcloud-0.17.0 on CentOS Linux 7 (Core) connecting to a Juno cloud (swift 2.2.0), and the fix worked for him.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 06cdd4e4b98c2ad4bf9857218c26cc423214823b in libcloud's branch refs/heads/trunk from Tom Fifield
        [ https://git-wip-us.apache.org/repos/asf?p=libcloud.git;h=06cdd4e ]

        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 <tomaz@apache.org>

        Show
        jira-bot ASF subversion and git services added a comment - Commit 06cdd4e4b98c2ad4bf9857218c26cc423214823b in libcloud's branch refs/heads/trunk from Tom Fifield [ https://git-wip-us.apache.org/repos/asf?p=libcloud.git;h=06cdd4e ] 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 <tomaz@apache.org>
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 06cdd4e4b98c2ad4bf9857218c26cc423214823b in libcloud's branch refs/heads/trunk from Tom Fifield
        [ https://git-wip-us.apache.org/repos/asf?p=libcloud.git;h=06cdd4e ]

        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 <tomaz@apache.org>

        Show
        jira-bot ASF subversion and git services added a comment - Commit 06cdd4e4b98c2ad4bf9857218c26cc423214823b in libcloud's branch refs/heads/trunk from Tom Fifield [ https://git-wip-us.apache.org/repos/asf?p=libcloud.git;h=06cdd4e ] 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 <tomaz@apache.org>
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 06cdd4e4b98c2ad4bf9857218c26cc423214823b in libcloud's branch refs/heads/trunk from Tom Fifield
        [ https://git-wip-us.apache.org/repos/asf?p=libcloud.git;h=06cdd4e ]

        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 <tomaz@apache.org>

        Show
        jira-bot ASF subversion and git services added a comment - Commit 06cdd4e4b98c2ad4bf9857218c26cc423214823b in libcloud's branch refs/heads/trunk from Tom Fifield [ https://git-wip-us.apache.org/repos/asf?p=libcloud.git;h=06cdd4e ] 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 <tomaz@apache.org>
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user asfgit closed the pull request at:

        https://github.com/apache/libcloud/pull/492

        Show
        githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/libcloud/pull/492

          People

          • Assignee:
            Unassigned
            Reporter:
            porterjamesj James
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:

              Development