Merge "SHOW_KEYSTONE_V2_RC defaults to False"

This commit is contained in:
Zuul 2019-01-03 11:47:40 +00:00 committed by Gerrit Code Review
commit 4391453c21
6 changed files with 66 additions and 17 deletions

View File

@ -841,7 +841,16 @@ SHOW_KEYSTONE_V2_RC
.. versionadded:: 13.0.0(Queens)
Default: ``True``
.. versionchanged:: 15.0.0(Stein)
The default value is changed from ``True`` to ``False``
in favor of the deprecation of keystone v2 API support in horizon.
.. deprecated:: 15.0.0(Stein)
This option will be dropped in 16.0.0(Train) release.
Default: ``False``
Controls whether the keystone v2 openrc file is accessible from the user
menu and the api access panel.
@ -873,7 +882,21 @@ USER_MENU_LINKS
.. versionadded:: 13.0.0(Queens)
Default::
Default (when ``SHOW_KEYSTONE_V2_RC`` is ``False``):
.. code-block:: python
[
{'name': _('OpenStack RC File'),
'icon_classes': ['fa-download', ],
'url': 'horizon:project:api_access:openrc',
'external': False,
}
]
Default (when ``SHOW_KEYSTONE_V2_RC`` is ``True``):
.. code-block:: python
[
{'name': _('OpenStack RC File v2'),

View File

@ -88,7 +88,7 @@ def openstack(request):
user_menu_links = getattr(settings, "USER_MENU_LINKS", [])
if not getattr(settings, "SHOW_KEYSTONE_V2_RC", True):
if not getattr(settings, "SHOW_KEYSTONE_V2_RC", False):
user_menu_links = [
link for link in user_menu_links
if 'horizon:project:api_access:openrcv2' != link['url']]

View File

@ -54,11 +54,19 @@ class DownloadCloudsYaml(tables.LinkAction):
class DownloadOpenRC(tables.LinkAction):
name = "download_openrc"
verbose_name = _("OpenStack RC File (Identity API v3)")
verbose_name_plural = _("OpenStack RC File (Identity API v3)")
verbose_name = _("OpenStack RC File")
verbose_name_plural = _("OpenStack RC File")
icon = "download"
url = "horizon:project:api_access:openrc"
def __init__(self, attrs=None, **kwargs):
super(DownloadOpenRC, self).__init__(attrs, **kwargs)
# When keystone v2 RC file is enabled, we need to show
# the version information of keystone API.
# Note that we don't need to care verbose_name_plural here.
if getattr(settings, 'SHOW_KEYSTONE_V2_RC', False):
self.verbose_name = _("OpenStack RC File (Identity API v3)")
def allowed(self, request, datum=None):
return utils.get_keystone_version() >= 3

View File

@ -112,7 +112,7 @@ WEBROOT = '/'
# Toggle showing the openrc file for Keystone V2.
# If set to false the link will be removed from the user dropdown menu
# and the API Access page
#SHOW_KEYSTONE_V2_RC = True
#SHOW_KEYSTONE_V2_RC = False
# If provided, a "Report Bug" link will be displayed in the site header
# which links to the value of this setting (ideally a URL containing

View File

@ -315,16 +315,9 @@ SECURITY_GROUP_RULES = {
ADD_INSTALLED_APPS = []
USER_MENU_LINKS = [
{'name': _('OpenStack RC File v2'),
'icon_classes': ['fa-download', ],
'url': 'horizon:project:api_access:openrcv2'
},
{'name': _('OpenStack RC File v3'),
'icon_classes': ['fa-download', ],
'url': 'horizon:project:api_access:openrc'
}
]
# NOTE: The default value of USER_MENU_LINKS will be set after loading
# local_settings if it is not configured.
USER_MENU_LINKS = None
# 'key', 'label', 'path'
AVAILABLE_THEMES = [
@ -354,7 +347,7 @@ CSRF_COOKIE_AGE = None
COMPRESS_OFFLINE_CONTEXT = 'horizon.themes.offline_context'
SHOW_KEYSTONE_V2_RC = True
SHOW_KEYSTONE_V2_RC = False
# Dictionary of currently available angular features
ANGULAR_FEATURES = {
@ -428,6 +421,21 @@ if os.path.exists(LOCAL_SETTINGS_DIR_PATH):
OPENSTACK_IMAGE_FORMATS = [fmt for (fmt, name)
in OPENSTACK_IMAGE_BACKEND['image_formats']]
if USER_MENU_LINKS is None:
USER_MENU_LINKS = []
if SHOW_KEYSTONE_V2_RC:
USER_MENU_LINKS.append({
'name': _('OpenStack RC File v2'),
'icon_classes': ['fa-download', ],
'url': 'horizon:project:api_access:openrcv2',
})
USER_MENU_LINKS.append({
'name': (_('OpenStack RC File v3') if SHOW_KEYSTONE_V2_RC
else _('OpenStack RC File')),
'icon_classes': ['fa-download', ],
'url': 'horizon:project:api_access:openrc',
})
if not WEBROOT.endswith('/'):
WEBROOT += '/'
if LOGIN_URL is None:

View File

@ -0,0 +1,10 @@
---
upgrade:
- |
The default value of ``SHOW_KEYSTONE_V2_RC`` setting is changed to
``False`` in favor of the deprecation of keystone v2 API support
in horizon.
deprecations:
- |
``SHOW_KEYSTONE_V2_RC`` setting is deprecated in favor of the deprecation
of keystone v2 API support in horizon.