From 3f7fc6808590d0a223124df4e63d4f05b75f831c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=AD=90=E7=8E=89?= Date: Thu, 5 Dec 2019 11:04:48 +0800 Subject: [PATCH] Changed default identity url to horizon The keystone doesn't use 5000 port anymore from Newton version. And all the references should be changed together. Change-Id: I3f02686ab5b3abf48f129fde92e90427ca148317 --- doc/source/admin/customize-configure.rst | 6 +++--- doc/source/configuration/settings.rst | 8 ++++++-- doc/source/contributor/quickstart.rst | 2 +- doc/source/install/install-debian.rst | 2 +- doc/source/install/install-obs.rst | 2 +- doc/source/install/install-rdo.rst | 2 +- doc/source/install/install-ubuntu.rst | 2 +- openstack_auth/defaults.py | 3 +-- openstack_auth/tests/data_v3.py | 8 ++++---- openstack_auth/tests/unit/test_auth.py | 11 ++++++----- openstack_dashboard/defaults.py | 4 ++-- openstack_dashboard/local/local_settings.py.example | 2 +- openstack_dashboard/test/settings.py | 6 +++--- openstack_dashboard/test/test_data/keystone_data.py | 6 +++--- openstack_dashboard/test/unit/api/test_base.py | 2 +- openstack_dashboard/test/unit/api/test_keystone.py | 4 ++-- ...e-keystone-url-default-value-6a56397acf4f7328.yaml | 6 ++++++ 17 files changed, 43 insertions(+), 33 deletions(-) create mode 100644 releasenotes/notes/change-keystone-url-default-value-6a56397acf4f7328.yaml diff --git a/doc/source/admin/customize-configure.rst b/doc/source/admin/customize-configure.rst index 5a35fe21c0..2821c4b387 100644 --- a/doc/source/admin/customize-configure.rst +++ b/doc/source/admin/customize-configure.rst @@ -224,12 +224,12 @@ The standard installation uses a non-encrypted HTTP channel. # For multiple regions uncomment this configuration, and add (endpoint, title). # AVAILABLE_REGIONS = [ - # ('http://cluster1.example.com:5000/v3', 'cluster1'), - # ('http://cluster2.example.com:5000/v3', 'cluster2'), + # ('http://cluster1.example.com/identity/v3', 'cluster1'), + # ('http://cluster2.example.com/identity/v3', 'cluster2'), # ] OPENSTACK_HOST = "127.0.0.1" - OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST + OPENSTACK_KEYSTONE_URL = "http://%s/identity/v3" % OPENSTACK_HOST OPENSTACK_KEYSTONE_DEFAULT_ROLE = "Member" # The OPENSTACK_KEYSTONE_BACKEND settings can be used to identify the diff --git a/doc/source/configuration/settings.rst b/doc/source/configuration/settings.rst index 6f133ae4e1..976f4696d1 100644 --- a/doc/source/configuration/settings.rst +++ b/doc/source/configuration/settings.rst @@ -1232,7 +1232,7 @@ AVAILABLE_REGIONS Default: ``None`` A list of tuples which define multiple regions. The tuple format is -``('http://{{ keystone_host }}:5000/v3', '{{ region_name }}')``. If any regions +``('http://{{ keystone_host }}/identity/v3', '{{ region_name }}')``. If any regions are specified the login form will have a dropdown selector for authenticating to the appropriate region, and there will be a region switcher dropdown in the site header when logged in. @@ -1438,11 +1438,15 @@ OPENSTACK_KEYSTONE_URL .. versionadded:: 2011.3(Diablo) +.. versionchanged:: 17.1.0(Ussuri) + + The default value was changed to ``"http://%s/identity/v3" % OPENSTACK_HOST`` + .. seealso:: Horizon's `OPENSTACK_HOST`_ documentation -Default: ``"http://%s:5000/v3" % OPENSTACK_HOST`` +Default: ``"http://%s/identity/v3" % OPENSTACK_HOST`` The full URL for the Keystone endpoint used for authentication. Unless you are using HTTPS, running your Keystone server on a nonstandard port, or using diff --git a/doc/source/contributor/quickstart.rst b/doc/source/contributor/quickstart.rst index 47c59b7176..15ea0d32a1 100644 --- a/doc/source/contributor/quickstart.rst +++ b/doc/source/contributor/quickstart.rst @@ -59,7 +59,7 @@ from within the ``horizon`` directory. $ cp openstack_dashboard/local/local_settings.py.example openstack_dashboard/local/local_settings.py Horizon connects to the rest of OpenStack via a Keystone service catalog. By -default Horizon looks for an endpoint at ``http://localhost:5000/v3``; this +default Horizon looks for an endpoint at ``http://localhost/identity/v3``; this can be customised by modifying the ``OPENSTACK_HOST`` and ``OPENSTACK_KEYSTONE_URL`` values in ``openstack_dashboard/local/local_settings.py`` diff --git a/doc/source/install/install-debian.rst b/doc/source/install/install-debian.rst index 0afce9222b..8bcf58db66 100644 --- a/doc/source/install/install-debian.rst +++ b/doc/source/install/install-debian.rst @@ -115,7 +115,7 @@ Install and configure components .. path /etc/openstack-dashboard/local_settings.py .. code-block:: python - OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST + OPENSTACK_KEYSTONE_URL = "http://%s/identity/v3" % OPENSTACK_HOST .. end diff --git a/doc/source/install/install-obs.rst b/doc/source/install/install-obs.rst index aabdc95a4e..b913bae678 100644 --- a/doc/source/install/install-obs.rst +++ b/doc/source/install/install-obs.rst @@ -101,7 +101,7 @@ Install and configure components .. path /srv/www/openstack-dashboard/openstack_dashboard/local/local_settings.py .. code-block:: python - OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST + OPENSTACK_KEYSTONE_URL = "http://%s/identity/v3" % OPENSTACK_HOST .. end diff --git a/doc/source/install/install-rdo.rst b/doc/source/install/install-rdo.rst index 1e69565850..e64f0c06cc 100644 --- a/doc/source/install/install-rdo.rst +++ b/doc/source/install/install-rdo.rst @@ -92,7 +92,7 @@ Install and configure components .. path /etc/openstack-dashboard/local_settings .. code-block:: python - OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST + OPENSTACK_KEYSTONE_URL = "http://%s/identity/v3" % OPENSTACK_HOST .. end diff --git a/doc/source/install/install-ubuntu.rst b/doc/source/install/install-ubuntu.rst index 018f139dff..19990ee80c 100644 --- a/doc/source/install/install-ubuntu.rst +++ b/doc/source/install/install-ubuntu.rst @@ -89,7 +89,7 @@ Install and configure components .. path /etc/openstack-dashboard/local_settings.py .. code-block:: python - OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST + OPENSTACK_KEYSTONE_URL = "http://%s/identity/v3" % OPENSTACK_HOST .. end diff --git a/openstack_auth/defaults.py b/openstack_auth/defaults.py index 8cb89cfa07..845a40e7ce 100644 --- a/openstack_auth/defaults.py +++ b/openstack_auth/defaults.py @@ -23,8 +23,7 @@ WEBROOT = '/' # TODO(amotoki): What is the right default value in openstack_auth? LOGIN_ERROR = 'error/' -OPENSTACK_KEYSTONE_URL = "http://localhost:5000/v3" -# OPENSTACK_KEYSTONE_URL = 'http://localhost/identity/v3' +OPENSTACK_KEYSTONE_URL = "http://localhost/identity/v3" # TODO(amotoki): The default value in openstack_dashboard is different: # publicURL. It should be consistent. diff --git a/openstack_auth/tests/data_v3.py b/openstack_auth/tests/data_v3.py index 81429efbf8..ae12514290 100644 --- a/openstack_auth/tests/data_v3.py +++ b/openstack_auth/tests/data_v3.py @@ -63,19 +63,19 @@ def generate_test_data(service_providers=False, endpoint='localhost'): 'id': uuid.uuid4().hex, 'endpoints': [ { - 'url': 'http://admin.%s:5000/v3' % endpoint, + 'url': 'http://admin.%s/identity/v3' % endpoint, 'region': 'RegionOne', 'interface': 'admin', 'id': uuid.uuid4().hex, }, { - 'url': 'http://internal.%s:5000/v3' % endpoint, + 'url': 'http://internal.%s/identity/v3' % endpoint, 'region': 'RegionOne', 'interface': 'internal', 'id': uuid.uuid4().hex }, { - 'url': 'http://public.%s:5000/v3' % endpoint, + 'url': 'http://public.%s/identity/v3' % endpoint, 'region': 'RegionOne', 'interface': 'public', 'id': uuid.uuid4().hex @@ -214,7 +214,7 @@ def generate_test_data(service_providers=False, endpoint='localhost'): sp_list = None if service_providers: - test_data.sp_auth_url = 'http://service_provider_endp:5000/v3' + test_data.sp_auth_url = 'http://service_provider_endp/identity/v3' test_data.service_provider_id = 'k2kserviceprovider' # The access info for the identity provider # should return a list of service providers diff --git a/openstack_auth/tests/unit/test_auth.py b/openstack_auth/tests/unit/test_auth.py index a668f2a7f0..a125d69249 100644 --- a/openstack_auth/tests/unit/test_auth.py +++ b/openstack_auth/tests/unit/test_auth.py @@ -244,7 +244,7 @@ class OpenStackAuthTestsV3(OpenStackAuthTestsMixin, self.data = data_v3.generate_test_data() self.ks_client_module = client_v3 settings.OPENSTACK_API_VERSIONS['identity'] = 3 - settings.OPENSTACK_KEYSTONE_URL = "http://localhost:5000/v3" + settings.OPENSTACK_KEYSTONE_URL = "http://localhost/identity/v3" self.mox.StubOutClassWithMocks(token_endpoint, 'Token') self.mox.StubOutClassWithMocks(v3_auth, 'Token') @@ -594,7 +594,7 @@ class OpenStackAuthTestsV3(OpenStackAuthTestsMixin, service_provider=target_provider) plugin.get_access(mox.IsA(session.Session)). \ AndReturn(self.sp_data.unscoped_access_info) - plugin.auth_url = 'http://service_provider_endp:5000/v3' + plugin.auth_url = 'http://service_provider_endp/identity/v3' # mock authenticate for service provider sp_projects = [self.sp_data.project_one, self.sp_data.project_two] @@ -833,7 +833,7 @@ class OpenStackAuthTestsWebSSO(OpenStackAuthTestsMixin, self.idp_saml2_id = uuid.uuid4().hex settings.OPENSTACK_API_VERSIONS['identity'] = 3 - settings.OPENSTACK_KEYSTONE_URL = 'http://localhost:5000/v3' + settings.OPENSTACK_KEYSTONE_URL = 'http://localhost/identity/v3' settings.WEBSSO_ENABLED = True settings.WEBSSO_CHOICES = ( ('credentials', 'Keystone Credentials'), @@ -895,7 +895,7 @@ class OpenStackAuthTestsWebSSO(OpenStackAuthTestsMixin, self.assertRedirects(response, redirect_url, status_code=302, target_status_code=404) - @override_settings(WEBSSO_KEYSTONE_URL='http://keystone-public:5000/v3') + @override_settings(WEBSSO_KEYSTONE_URL='http://keystone-public/identity/v3') def test_websso_redirect_using_websso_keystone_url(self): origin = 'http://testserver/auth/websso/' protocol = 'oidc' @@ -935,7 +935,8 @@ class OpenStackAuthTestsWebSSO(OpenStackAuthTestsMixin, self.assertRedirects(response, settings.LOGIN_REDIRECT_URL) def test_websso_login_with_auth_in_url(self): - settings.OPENSTACK_KEYSTONE_URL = 'http://auth.openstack.org:5000/v3' + settings.OPENSTACK_KEYSTONE_URL =\ + 'http://auth.openstack.org/identity/v3' projects = [self.data.project_one, self.data.project_two] domains = [] diff --git a/openstack_dashboard/defaults.py b/openstack_dashboard/defaults.py index 71215404d8..87ecc84398 100644 --- a/openstack_dashboard/defaults.py +++ b/openstack_dashboard/defaults.py @@ -131,8 +131,8 @@ API_RESULT_PAGE_SIZE = 20 # For multiple regions uncomment this configuration, and add (endpoint, title). # AVAILABLE_REGIONS = [ -# ('http://cluster1.example.com:5000/v3', 'cluster1'), -# ('http://cluster2.example.com:5000/v3', 'cluster2'), +# ('http://cluster1.example.com/identity/v3', 'cluster1'), +# ('http://cluster2.example.com/identity/v3', 'cluster2'), # ] AVAILABLE_REGIONS = [] diff --git a/openstack_dashboard/local/local_settings.py.example b/openstack_dashboard/local/local_settings.py.example index 5f891b592f..2b084bf242 100644 --- a/openstack_dashboard/local/local_settings.py.example +++ b/openstack_dashboard/local/local_settings.py.example @@ -118,7 +118,7 @@ EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' #EMAIL_HOST_PASSWORD = 'top-secret!' OPENSTACK_HOST = "127.0.0.1" -OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST +OPENSTACK_KEYSTONE_URL = "http://%s/identity/v3" % OPENSTACK_HOST # The timezone of the server. This should correspond with the timezone # of your entire OpenStack installation, and hopefully be in UTC. diff --git a/openstack_dashboard/test/settings.py b/openstack_dashboard/test/settings.py index 26ac805b39..e8407b7a11 100644 --- a/openstack_dashboard/test/settings.py +++ b/openstack_dashboard/test/settings.py @@ -120,11 +120,11 @@ settings_utils.find_static_files(HORIZON_CONFIG, AVAILABLE_THEMES, IMAGES_ALLOW_LOCATION = True AVAILABLE_REGIONS = [ - ('http://localhost:5000/v3', 'local'), - ('http://remote:5000/v3', 'remote'), + ('http://localhost/identity/v3', 'local'), + ('http://remote/identity/v3', 'remote'), ] -OPENSTACK_KEYSTONE_URL = "http://localhost:5000/v3" +OPENSTACK_KEYSTONE_URL = "http://localhost/identity/v3" OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = 'test_domain' diff --git a/openstack_dashboard/test/test_data/keystone_data.py b/openstack_dashboard/test/test_data/keystone_data.py index 2b7f231386..f13636b9ea 100644 --- a/openstack_dashboard/test/test_data/keystone_data.py +++ b/openstack_dashboard/test/test_data/keystone_data.py @@ -89,9 +89,9 @@ SERVICE_CATALOG = [ "endpoints_links": [], "endpoints": [ {"region": "RegionOne", - "adminURL": "http://admin.keystone.example.com:5000/v3", - "internalURL": "http://int.keystone.example.com:5000/v3", - "publicURL": "http://public.keystone.example.com:5000/v3"}]}, + "adminURL": "http://admin.keystone.example.com/identity/v3", + "internalURL": "http://int.keystone.example.com/identity/v3", + "publicURL": "http://public.keystone.example.com/identity/v3"}]}, {"type": "object-store", "name": "swift", "endpoints_links": [], diff --git a/openstack_dashboard/test/unit/api/test_base.py b/openstack_dashboard/test/unit/api/test_base.py index 5c93b0427f..3a3fc67636 100644 --- a/openstack_dashboard/test/unit/api/test_base.py +++ b/openstack_dashboard/test/unit/api/test_base.py @@ -315,7 +315,7 @@ class ApiHelperTests(test.APITestCase): self.request.user.services_region = "bogus_value" url = api_base.url_for(self.request, 'identity', endpoint_type='adminURL') - self.assertEqual('http://admin.keystone.example.com:5000/v3', url) + self.assertEqual('http://admin.keystone.example.com/identity/v3', url) self.request.user.services_region = "bogus_value" with self.assertRaises(exceptions.ServiceCatalogException): diff --git a/openstack_dashboard/test/unit/api/test_keystone.py b/openstack_dashboard/test/unit/api/test_keystone.py index 65f58c5ef2..280428422a 100644 --- a/openstack_dashboard/test/unit/api/test_keystone.py +++ b/openstack_dashboard/test/unit/api/test_keystone.py @@ -81,9 +81,9 @@ class ServiceAPITests(test.APIMockTestCase): self.assertEqual(u"identity (native backend)", six.text_type(service)) self.assertEqual(identity_data["endpoints"][0]["region"], service.region) - self.assertEqual("http://int.keystone.example.com:5000/v3", + self.assertEqual("http://int.keystone.example.com/identity/v3", service.url) - self.assertEqual("http://public.keystone.example.com:5000/v3", + self.assertEqual("http://public.keystone.example.com/identity/v3", service.public_url) self.assertEqual("int.keystone.example.com", service.host) diff --git a/releasenotes/notes/change-keystone-url-default-value-6a56397acf4f7328.yaml b/releasenotes/notes/change-keystone-url-default-value-6a56397acf4f7328.yaml new file mode 100644 index 0000000000..64f463ff71 --- /dev/null +++ b/releasenotes/notes/change-keystone-url-default-value-6a56397acf4f7328.yaml @@ -0,0 +1,6 @@ +--- +other: + - | + The default `OPENSTACK_KEYSTONE_URL` value has been changed to + ``"http://%s/identity/v3" % OPENSTACK_HOST`` from + ``"http://%s:5000/v3" % OPENSTACK_HOST``. \ No newline at end of file