Tempest fails with unversioned identity url in catalog

Bug #1552475 reported by Jamie Lennox
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tempest
Fix Released
Undecided
Jamie Lennox

Bug Description

When i create a keystone entry in the catalog without a /v2.0 I get the following error from tempest verify-config:

2016-02-29 08:38:34.229 | Traceback (most recent call last):
2016-02-29 08:38:34.230 | File "/opt/stack/new/tempest/tempest/cmd/verify_tempest_config.py", line 397, in take_action
2016-02-29 08:38:34.230 | return main(parsed_args)
2016-02-29 08:38:34.230 | File "/opt/stack/new/tempest/tempest/cmd/verify_tempest_config.py", line 364, in main
2016-02-29 08:38:34.230 | os = clients.Manager(icreds.get_primary_creds())
2016-02-29 08:38:34.230 | File "/opt/stack/new/tempest/tempest/common/dynamic_creds.py", line 268, in get_primary_creds
2016-02-29 08:38:34.230 | return self.get_credentials('primary')
2016-02-29 08:38:34.230 | File "/opt/stack/new/tempest/tempest/common/dynamic_creds.py", line 249, in get_credentials
2016-02-29 08:38:34.230 | credentials = self._create_creds(admin=is_admin)
2016-02-29 08:38:34.230 | File "/opt/stack/new/tempest/tempest/common/dynamic_creds.py", line 122, in _create_creds
2016-02-29 08:38:34.230 | name=project_name, description=project_desc)
2016-02-29 08:38:34.230 | File "/opt/stack/new/tempest/tempest/common/cred_client.py", line 108, in create_project
2016-02-29 08:38:34.230 | name=name, description=description)['tenant']
2016-02-29 08:38:34.230 | File "/opt/stack/new/tempest/tempest/services/identity/v2/json/tenants_client.py", line 36, in create_tenant
2016-02-29 08:38:34.230 | resp, body = self.post('tenants', post_body)
2016-02-29 08:38:34.230 | File "/opt/stack/new/tempest/tempest/lib/common/rest_client.py", line 259, in post
2016-02-29 08:38:34.230 | return self.request('POST', url, extra_headers, headers, body)
2016-02-29 08:38:34.230 | File "/opt/stack/new/tempest/tempest/lib/common/rest_client.py", line 629, in request
2016-02-29 08:38:34.230 | headers=headers, body=body)
2016-02-29 08:38:34.230 | File "/opt/stack/new/tempest/tempest/lib/common/rest_client.py", line 528, in _request
2016-02-29 08:38:34.230 | req_url, method, headers=req_headers, body=req_body)
2016-02-29 08:38:34.230 | File "/opt/stack/new/tempest/tempest/lib/common/rest_client.py", line 559, in raw_request
2016-02-29 08:38:34.230 | headers=headers, body=body)
2016-02-29 08:38:34.230 | File "/opt/stack/new/tempest/tempest/lib/common/http.py", line 25, in request
2016-02-29 08:38:34.230 | return super(ClosingHttp, self).request(*args, **new_kwargs)
2016-02-29 08:38:34.230 | File "/opt/stack/new/tempest/.tox/venv/local/lib/python2.7/site-packages/httplib2/__init__.py", line 1457, in request
2016-02-29 08:38:34.230 | (scheme, authority, request_uri, defrag_uri) = urlnorm(uri)
2016-02-29 08:38:34.230 | File "/opt/stack/new/tempest/.tox/venv/local/lib/python2.7/site-packages/httplib2/__init__.py", line 218, in urlnorm
2016-02-29 08:38:34.230 | raise RelativeURIError("Only absolute URIs are allowed. uri = %s" % uri)
2016-02-29 08:38:34.231 | RelativeURIError: Only absolute URIs are allowed. uri = /v2.0h/v2.0t/v2.0t/v2.0p/v2.0:/v2.0/v2.0/v2.01/v2.02/v2.07/v2.0./v2.00/v2.0./v2.00/v2.0./v2.01/v2.0:/v2.03/v2.05/v2.03/v2.05/v2.07/v2.0/tenants

This is because the way that tempest is handling path substitution it attempts to find the existing version number in the URL and then string replace it onto the old string. When there is no version this search pattern is '' and it inserts a /v2.0 everywhere.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tempest (master)

Fix proposed to branch: master
Review: https://review.openstack.org/287532

Changed in tempest:
assignee: nobody → Jamie Lennox (jamielennox)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tempest (master)

Reviewed: https://review.openstack.org/287532
Committed: https://git.openstack.org/cgit/openstack/tempest/commit/?id=823a00433fe6622f25a3c9dacf86fcd66b3e819b
Submitter: Jenkins
Branch: master

commit 823a00433fe6622f25a3c9dacf86fcd66b3e819b
Author: Jamie Lennox <email address hidden>
Date: Wed Mar 2 18:33:24 2016 -0600

    Use urlunparse to reconstruct base_url

    Using string replace to replace the new path back onto the old path
    fails when there is no path setup in the catalog initially. Instead of
    this lets use the inverse to the urlparse previously performed.

    Change-Id: I931f0c558aafc8dfaa5519744c6e4e7fcffc3205
    Closes-Bug: #1552475

Changed in tempest:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to tempest (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/290207

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tempest (master)

Reviewed: https://review.openstack.org/290207
Committed: https://git.openstack.org/cgit/openstack/tempest/commit/?id=a934a7052c6f1a9aed02fd5fbc088cf25fc5cbea
Submitter: Jenkins
Branch: master

commit a934a7052c6f1a9aed02fd5fbc088cf25fc5cbea
Author: Jamie Lennox <email address hidden>
Date: Wed Mar 9 11:36:36 2016 +1100

    Test base_url works with an unversioned endpoint

    Add a test for previously merged patch to ensure that endpoints in the
    service catalog that do not have a version in the URL correctly add the
    version.

    Original Patch: I931f0c558aafc8dfaa5519744c6e4e7fcffc3205
    Related-Bug: #1552475

    Change-Id: I992874f9f0b0c192e5ac58b97ca14cd3c4e5e0a0

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tempest 11.0.0

This issue was fixed in the openstack/tempest 11.0.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.