From 57380fae71a6e6428da234db65228fe95656e7b4 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Mon, 8 Mar 2021 12:52:53 +0900 Subject: [PATCH] Deprecate Django launch instance form As discussed in the horizon meeting, we think that feature gaps between the two implementations have been closed. Let's mark the Django version as deprecated and gather more attentions from operators. Change-Id: I55379c0897bad46decfabb443afe9439a31a3164 --- doc/source/configuration/settings.rst | 5 +++++ .../dashboards/project/instances/views.py | 8 ++++++++ .../management/commands/upgrade_check.py | 13 +++++++++++++ ...jango-launch-instance-form-cc176ad708e2f1f7.yaml | 11 +++++++++++ 4 files changed, 37 insertions(+) create mode 100644 releasenotes/notes/deprecate-django-launch-instance-form-cc176ad708e2f1f7.yaml diff --git a/doc/source/configuration/settings.rst b/doc/source/configuration/settings.rst index 466347d44b..935ba566e7 100644 --- a/doc/source/configuration/settings.rst +++ b/doc/source/configuration/settings.rst @@ -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. diff --git a/openstack_dashboard/dashboards/project/instances/views.py b/openstack_dashboard/dashboards/project/instances/views.py index 8217c540fd..f767c538fa 100644 --- a/openstack_dashboard/dashboards/project/instances/views.py +++ b/openstack_dashboard/dashboards/project/instances/views.py @@ -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 diff --git a/openstack_dashboard/management/commands/upgrade_check.py b/openstack_dashboard/management/commands/upgrade_check.py index 2f0c07a946..4b6a35ae2a 100644 --- a/openstack_dashboard/management/commands/upgrade_check.py +++ b/openstack_dashboard/management/commands/upgrade_check.py @@ -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 diff --git a/releasenotes/notes/deprecate-django-launch-instance-form-cc176ad708e2f1f7.yaml b/releasenotes/notes/deprecate-django-launch-instance-form-cc176ad708e2f1f7.yaml new file mode 100644 index 0000000000..b73f18d61b --- /dev/null +++ b/releasenotes/notes/deprecate-django-launch-instance-form-cc176ad708e2f1f7.yaml @@ -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.