Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 921121 Details for
Bug 1123542
file templated catalogs do not work in protocol v3
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Catalog driver generates v3 catalog from v2 catalog
v3_catalogs.patch (text/plain), 9.52 KB, created by
Fabrice A. Marie
on 2014-07-26 03:27:50 UTC
(
hide
)
Description:
Catalog driver generates v3 catalog from v2 catalog
Filename:
MIME Type:
Creator:
Fabrice A. Marie
Created:
2014-07-26 03:27:50 UTC
Size:
9.52 KB
patch
obsolete
>diff -uNr old/0004-catalog-driver-generates-v3-catalog-from-v2-catalog.patch new/0004-catalog-driver-generates-v3-catalog-from-v2-catalog.patch >--- old/0004-catalog-driver-generates-v3-catalog-from-v2-catalog.patch 1970-01-01 07:30:00.000000000 +0730 >+++ new/0004-catalog-driver-generates-v3-catalog-from-v2-catalog.patch 2014-07-25 17:49:56.000000000 +0800 >@@ -0,0 +1,178 @@ >+diff -uNr old/keystone-2014.1.1/keystone/catalog/backends/kvs.py keystone-2014.1.1/keystone/catalog/backends/kvs.py >+--- old/keystone-2014.1.1/keystone/catalog/backends/kvs.py 2014-06-06 05:33:20.000000000 +0800 >++++ keystone-2014.1.1/keystone/catalog/backends/kvs.py 2014-07-25 17:47:32.341820788 +0800 >+@@ -15,7 +15,6 @@ >+ >+ from keystone import catalog >+ from keystone.common import kvs >+-from keystone import exception >+ >+ >+ class Catalog(kvs.Base, catalog.Driver): >+@@ -138,6 +137,3 @@ >+ def _create_catalog(self, user_id, tenant_id, data): >+ self.db.set('catalog-%s-%s' % (tenant_id, user_id), data) >+ return data >+- >+- def get_v3_catalog(self, user_id, tenant_id, metadata=None): >+- raise exception.NotImplemented() >+diff -uNr old/keystone-2014.1.1/keystone/catalog/backends/templated.py keystone-2014.1.1/keystone/catalog/backends/templated.py >+--- old/keystone-2014.1.1/keystone/catalog/backends/templated.py 2014-06-06 05:33:20.000000000 +0800 >++++ keystone-2014.1.1/keystone/catalog/backends/templated.py 2014-07-25 17:47:32.342820804 +0800 >+@@ -19,7 +19,6 @@ >+ from keystone.catalog.backends import kvs >+ from keystone.catalog import core >+ from keystone import config >+-from keystone import exception >+ from keystone.openstack.common.gettextutils import _ >+ from keystone.openstack.common import log >+ from keystone.openstack.common import versionutils >+@@ -121,9 +120,6 @@ >+ >+ return o >+ >+- def get_v3_catalog(self, user_id, tenant_id, metadata=None): >+- raise exception.NotImplemented() >+- >+ >+ @versionutils.deprecated( >+ versionutils.deprecated.ICEHOUSE, >+diff -uNr old/keystone-2014.1.1/keystone/catalog/core.py keystone-2014.1.1/keystone/catalog/core.py >+--- old/keystone-2014.1.1/keystone/catalog/core.py 2014-06-06 05:33:24.000000000 +0800 >++++ keystone-2014.1.1/keystone/catalog/core.py 2014-07-25 17:47:32.342820804 +0800 >+@@ -322,10 +322,11 @@ >+ """ >+ raise exception.NotImplemented() >+ >+- @abc.abstractmethod >+ def get_v3_catalog(self, user_id, tenant_id, metadata=None): >+ """Retrieve and format the current V3 service catalog. >+ >++ The default implementation builds the V3 catalog from the V2 catalog. >++ >+ Example:: >+ >+ [ >+@@ -351,4 +352,35 @@ >+ :raises: keystone.exception.NotFound >+ >+ """ >+- raise exception.NotImplemented() >++ v2_catalog = self.get_catalog(user_id, tenant_id, metadata=metadata) >++ v3_catalog = [] >++ >++ for region_name, region in six.iteritems(v2_catalog): >++ for service_type, service in six.iteritems(region): >++ service_v3 = { >++ 'type': service_type, >++ 'endpoints': [] >++ } >++ >++ for attr, value in six.iteritems(service): >++ # Attributes that end in URL are interfaces. In the V2 >++ # catalog, these are internalURL, publicURL, and adminURL. >++ # For example, <region_name>.publicURL=<URL> in the V2 >++ # catalog becomes the V3 interface for the service: >++ # { 'interface': 'public', 'url': '<URL>', 'region': >++ # 'region: '<region_name>' } >++ if attr.endswith('URL'): >++ v3_interface = attr[:-len('URL')] >++ service_v3['endpoints'].append({ >++ 'interface': v3_interface, >++ 'region': region_name, >++ 'url': value, >++ }) >++ continue >++ >++ # Other attributes are copied to the service. >++ service_v3[attr] = value >++ >++ v3_catalog.append(service_v3) >++ >++ return v3_catalog >+diff -uNr old/keystone-2014.1.1/keystone/tests/test_backend_kvs.py keystone-2014.1.1/keystone/tests/test_backend_kvs.py >+--- old/keystone-2014.1.1/keystone/tests/test_backend_kvs.py 2014-06-06 05:33:24.000000000 +0800 >++++ keystone-2014.1.1/keystone/tests/test_backend_kvs.py 2014-07-25 17:47:32.342820804 +0800 >+@@ -213,8 +213,11 @@ >+ self.assertRaises(exception.NotFound, f) >+ >+ def test_get_v3_catalog_endpoint_disabled(self): >++ # There's no need to have disabled endpoints in the kvs catalog. Those >++ # endpoints should just be removed from the store. This just tests >++ # what happens currently when the super impl is called. >+ f = super(KvsCatalog, self).test_get_v3_catalog_endpoint_disabled >+- self.assertRaises(exception.NotImplemented, f) >++ self.assertRaises(exception.NotFound, f) >+ >+ >+ class KvsTokenCacheInvalidation(tests.TestCase, >+diff -uNr old/keystone-2014.1.1/keystone/tests/test_backend_templated.py keystone-2014.1.1/keystone/tests/test_backend_templated.py >+--- old/keystone-2014.1.1/keystone/tests/test_backend_templated.py 2014-06-06 05:33:20.000000000 +0800 >++++ keystone-2014.1.1/keystone/tests/test_backend_templated.py 2014-07-25 17:47:32.342820804 +0800 >+@@ -13,6 +13,7 @@ >+ # under the License. >+ >+ import os >++import uuid >+ >+ from keystone import exception >+ from keystone import tests >+@@ -73,6 +74,37 @@ >+ self.skipTest("Templated backend doesn't have disabled endpoints") >+ >+ def test_get_v3_catalog_endpoint_disabled(self): >+- f = (super(TestTemplatedCatalog, self). >+- test_get_v3_catalog_endpoint_disabled) >+- self.assertRaises(exception.NotImplemented, f) >++ self.skipTest("Templated backend doesn't have disabled endpoints") >++ >++ def test_get_v3_catalog(self): >++ user_id = uuid.uuid4().hex >++ project_id = uuid.uuid4().hex >++ catalog_ref = self.catalog_api.get_v3_catalog(user_id, project_id) >++ exp_catalog = [ >++ {'endpoints': [ >++ {'interface': 'admin', >++ 'region': 'RegionOne', >++ 'url': 'http://localhost:8774/v1.1/%s' % project_id}, >++ {'interface': 'public', >++ 'region': 'RegionOne', >++ 'url': 'http://localhost:8774/v1.1/%s' % project_id}, >++ {'interface': 'internal', >++ 'region': 'RegionOne', >++ 'url': 'http://localhost:8774/v1.1/%s' % project_id}], >++ 'type': 'compute', >++ 'name': "'Compute Service'", >++ 'id': '2'}, >++ {'endpoints': [ >++ {'interface': 'admin', >++ 'region': 'RegionOne', >++ 'url': 'http://localhost:35357/v2.0'}, >++ {'interface': 'public', >++ 'region': 'RegionOne', >++ 'url': 'http://localhost:5000/v2.0'}, >++ {'interface': 'internal', >++ 'region': 'RegionOne', >++ 'url': 'http://localhost:35357/v2.0'}], >++ 'type': 'identity', >++ 'name': "'Identity Service'", >++ 'id': '1'}] >++ self.assertEqual(exp_catalog, catalog_ref) >+diff -uNr old/keystone-2014.1.1/keystone/token/providers/common.py keystone-2014.1.1/keystone/token/providers/common.py >+--- old/keystone-2014.1.1/keystone/token/providers/common.py 2014-06-06 05:33:24.000000000 +0800 >++++ keystone-2014.1.1/keystone/token/providers/common.py 2014-07-25 17:47:32.342820804 +0800 >+@@ -306,12 +306,8 @@ >+ if CONF.trust.enabled and trust: >+ user_id = trust['trustor_user_id'] >+ if project_id or domain_id: >+- try: >+- service_catalog = self.catalog_api.get_v3_catalog( >+- user_id, project_id) >+- except exception.NotImplemented: >+- service_catalog = {} >+- # TODO(gyee): v3 service catalog is not quite completed yet >++ service_catalog = self.catalog_api.get_v3_catalog( >++ user_id, project_id) >+ # TODO(ayoung): Enforce Endpoints for trust >+ token_data['catalog'] = service_catalog >+ >diff -uNr old/openstack-keystone.spec new/openstack-keystone.spec >--- old/openstack-keystone.spec 2014-06-07 07:15:44.000000000 +0800 >+++ new/openstack-keystone.spec 2014-07-26 11:09:46.919887383 +0800 >@@ -7,7 +7,7 @@ > > Name: openstack-keystone > Version: 2014.1.1 >-Release: 1%{?dist} >+Release: 2%{?dist} > Summary: OpenStack Identity Service > > License: ASL 2.0 >@@ -27,6 +27,7 @@ > Patch0001: 0001-remove-runtime-dep-on-python-pbr.patch > Patch0002: 0002-sync-parameter-values-with-keystone-dist.conf.patch > Patch0003: 0003-Refactor-service-readiness-notification.patch >+Patch0004: 0004-catalog-driver-generates-v3-catalog-from-v2-catalog.patch > > BuildArch: noarch > >@@ -113,6 +114,7 @@ > %patch0001 -p1 > %patch0002 -p1 > %patch0003 -p1 >+%patch0004 -p1 > > find . \( -name .gitignore -o -name .placeholder \) -delete > find keystone -name \*.py -exec sed -i '/\/usr\/bin\/env python/d' {} \; >@@ -250,6 +252,10 @@ > %endif > > %changelog >+* Fri Jul 25 2014 Fabrice A. Marie <fabrice@kibinlabs.com> 2014-1.1-2 >+- Patch 0004: Catalog driver generates v3 catalog from v2 catalog: >+ https://review.openstack.org/#/c/70630/ >+ > * Fri Jun 06 2014 Alan Pevec <apevec@redhat.com> 2014.1.1-1 > - updated to stable icehouse 2014.1.1 release > - Keystone user and group id mismatch CVE-2014-0204
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1123542
: 921121