SHOW_KEYSTONE_V2_RC defaults to False

In favor of keystone v2 support, SHOW_KEYSTONE_V2_RC now defaults
to False. SHOW_KEYSTONE_V2_RC setting is also deprecated.

Along with this change, "v3" part of "OpenStack RC File (Identity API v3)"
is now unnecessary, so "v3" information is dropped.

Change-Id: If0359e2dc1f2c8fb5f3c87046fd23043f94abc21
This commit is contained in:
Akihiro Motoki 2018-12-23 04:01:04 +09:00
parent 25b6706f50
commit d32359e011
6 changed files with 66 additions and 17 deletions

View File

@ -826,7 +826,16 @@ SHOW_KEYSTONE_V2_RC
.. versionadded:: 13.0.0(Queens) .. 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 Controls whether the keystone v2 openrc file is accessible from the user
menu and the api access panel. menu and the api access panel.
@ -858,7 +867,21 @@ USER_MENU_LINKS
.. versionadded:: 13.0.0(Queens) .. 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'), {'name': _('OpenStack RC File v2'),

View File

@ -88,7 +88,7 @@ def openstack(request):
user_menu_links = getattr(settings, "USER_MENU_LINKS", []) 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 = [ user_menu_links = [
link for link in user_menu_links link for link in user_menu_links
if 'horizon:project:api_access:openrcv2' != link['url']] if 'horizon:project:api_access:openrcv2' != link['url']]

View File

@ -54,11 +54,19 @@ class DownloadCloudsYaml(tables.LinkAction):
class DownloadOpenRC(tables.LinkAction): class DownloadOpenRC(tables.LinkAction):
name = "download_openrc" name = "download_openrc"
verbose_name = _("OpenStack RC File (Identity API v3)") verbose_name = _("OpenStack RC File")
verbose_name_plural = _("OpenStack RC File (Identity API v3)") verbose_name_plural = _("OpenStack RC File")
icon = "download" icon = "download"
url = "horizon:project:api_access:openrc" 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): def allowed(self, request, datum=None):
return utils.get_keystone_version() >= 3 return utils.get_keystone_version() >= 3

View File

@ -112,7 +112,7 @@ WEBROOT = '/'
# Toggle showing the openrc file for Keystone V2. # Toggle showing the openrc file for Keystone V2.
# If set to false the link will be removed from the user dropdown menu # If set to false the link will be removed from the user dropdown menu
# and the API Access page # 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 # 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 # which links to the value of this setting (ideally a URL containing

View File

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