Merge "Deprecate Django launch instance form"

This commit is contained in:
Zuul 2021-03-10 18:03:27 +00:00 committed by Gerrit Code Review
commit ade661e50d
4 changed files with 37 additions and 0 deletions

View File

@ -2233,6 +2233,11 @@ LAUNCH_INSTANCE_LEGACY_ENABLED
The default value for this setting has been changed to ``False``
.. deprecated:: 19.1.0(Wallaby)
The Python Launch Instance workflow is deprecated.
Consider switching to the AngujarJS workflow instead.
Default: ``False``
This setting enables the Python Launch Instance workflow.

View File

@ -263,6 +263,14 @@ def _swap_filter(resources, search_opts, fake_field, real_field):
class LaunchInstanceView(workflows.WorkflowView):
workflow_class = project_workflows.LaunchInstance
def __init__(self):
super().__init__()
LOG.warning('Django version of the launch instance form is '
'deprecated since Wallaby release. Switch to '
'the AngularJS version of the form by setting '
'LAUNCH_INSTANCE_NG_ENABLED to True and '
'LAUNCH_INSTANCE_LEGACY_ENABLED to False.')
def get_initial(self):
initial = super().get_initial()
initial['project_id'] = self.request.user.tenant_id

View File

@ -299,6 +299,19 @@ def check_chinese_locale_rename(dummy):
return upgradecheck.Result(upgradecheck.Code.SUCCESS)
@register_check(_("Django launch instance form"))
def check_django_launch_instance_form(dummy):
if settings.LAUNCH_INSTANCE_LEGACY_ENABLED:
return upgradecheck.Result(
upgradecheck.Code.WARNING,
_("The Django version of the launch instance form is deprecated "
"since Wallaby release. Switch to the AngularJS version of the "
"form by setting LAUNCH_INSTANCE_NG_ENABLED to True and "
"LAUNCH_INSTANCE_LEGACY_ENABLED to False.")
)
return upgradecheck.Result(upgradecheck.Code.SUCCESS)
class UpgradeCheckTable(upgradecheck.UpgradeCommands):
_upgrade_checks = CHECKS

View File

@ -0,0 +1,11 @@
---
deprecations:
- |
The Django version of the launch instance form is deprecated now.
Switch to the AngularJS version of the form by setting
``LAUNCH_INSTANCE_NG_ENABLED`` to ``True`` and
``LAUNCH_INSTANCE_LEGACY_ENABLED`` to ``False``.
The horizon team believes that feature gaps between Django and
AngularJS implementations have been closed and we can drop the
Django version. If you see any feature gap, please file a bug to
horizon or contact the horizon team.