From b430d5aa438babc0779cd732ab8d2fa9f097be2a Mon Sep 17 00:00:00 2001 From: manchandavishal Date: Tue, 25 Jan 2022 15:40:52 +0530 Subject: [PATCH] Follow-up: Drop Django based implementation of launch instance This patch is a follow-up patch addressing the below comments given on the commit 6ac31e0 : * delete unused template files. * Drop "config_drive" option and related code from resize instance step because it need to show only for Launch Instance. * grammer correction in the release note Change-Id: I9ab52927fc6be31d491f010e5e3d9323ddd34e9e --- .../instances/_launch_advanced_help.html | 2 -- .../instances/_launch_details_help.html | 7 ---- .../instances/_launch_network_help.html | 3 -- .../instances/_launch_network_ports_help.html | 7 ---- .../instances/_launch_volumes_help.html | 3 -- .../templates/instances/_update_networks.html | 36 ------------------- .../instances/workflows/resize_instance.py | 36 ++----------------- ...launch-instance-form-c6543e1d52786b79.yaml | 4 +-- 8 files changed, 5 insertions(+), 93 deletions(-) delete mode 100644 openstack_dashboard/dashboards/project/instances/templates/instances/_launch_advanced_help.html delete mode 100644 openstack_dashboard/dashboards/project/instances/templates/instances/_launch_details_help.html delete mode 100644 openstack_dashboard/dashboards/project/instances/templates/instances/_launch_network_help.html delete mode 100644 openstack_dashboard/dashboards/project/instances/templates/instances/_launch_network_ports_help.html delete mode 100644 openstack_dashboard/dashboards/project/instances/templates/instances/_launch_volumes_help.html delete mode 100644 openstack_dashboard/dashboards/project/instances/templates/instances/_update_networks.html diff --git a/openstack_dashboard/dashboards/project/instances/templates/instances/_launch_advanced_help.html b/openstack_dashboard/dashboards/project/instances/templates/instances/_launch_advanced_help.html deleted file mode 100644 index 0b43a16c2c..0000000000 --- a/openstack_dashboard/dashboards/project/instances/templates/instances/_launch_advanced_help.html +++ /dev/null @@ -1,2 +0,0 @@ -{% load i18n %} -

{% blocktrans %}Specify advanced options to use when launching an instance.{% endblocktrans %}

diff --git a/openstack_dashboard/dashboards/project/instances/templates/instances/_launch_details_help.html b/openstack_dashboard/dashboards/project/instances/templates/instances/_launch_details_help.html deleted file mode 100644 index b05b017fce..0000000000 --- a/openstack_dashboard/dashboards/project/instances/templates/instances/_launch_details_help.html +++ /dev/null @@ -1,7 +0,0 @@ -{% extends 'project/instances/_flavors_and_quotas.html' %} -{% load i18n %} - -{% block help_message %} -

{% blocktrans %}Specify the details for launching an instance.{% endblocktrans %}

-

{% blocktrans %}The chart below shows the resources used by this project in relation to the project's quotas.{% endblocktrans %}

-{% endblock %} diff --git a/openstack_dashboard/dashboards/project/instances/templates/instances/_launch_network_help.html b/openstack_dashboard/dashboards/project/instances/templates/instances/_launch_network_help.html deleted file mode 100644 index 5860a43f31..0000000000 --- a/openstack_dashboard/dashboards/project/instances/templates/instances/_launch_network_help.html +++ /dev/null @@ -1,3 +0,0 @@ -{% load i18n horizon %} - -

{% blocktrans %}Choose network from Available networks to Selected networks by push button or drag and drop, you may change NIC order by drag and drop as well. {% endblocktrans %}

diff --git a/openstack_dashboard/dashboards/project/instances/templates/instances/_launch_network_ports_help.html b/openstack_dashboard/dashboards/project/instances/templates/instances/_launch_network_ports_help.html deleted file mode 100644 index 7f91c20547..0000000000 --- a/openstack_dashboard/dashboards/project/instances/templates/instances/_launch_network_ports_help.html +++ /dev/null @@ -1,7 +0,0 @@ -{% load i18n %} - -{% block help_message %} -

{% blocktrans %}A port is a connection point for attaching a single device, such as the NIC of a virtual server, to a virtual network.{% endblocktrans %}

-

{% blocktrans %}The port also describes the associated network configuration, such as the MAC and IP addresses to be used on that port.{% endblocktrans %}

-

{% blocktrans %}Ports are optional and can be used with networks to add extra IP addresses to your instances or select specific types of ports.{% endblocktrans %}

-{% endblock %} diff --git a/openstack_dashboard/dashboards/project/instances/templates/instances/_launch_volumes_help.html b/openstack_dashboard/dashboards/project/instances/templates/instances/_launch_volumes_help.html deleted file mode 100644 index 26f4429cbb..0000000000 --- a/openstack_dashboard/dashboards/project/instances/templates/instances/_launch_volumes_help.html +++ /dev/null @@ -1,3 +0,0 @@ -{% load i18n horizon %} - -

{% blocktrans %}An instance can be launched with varying types of attached storage. You may select from those options here.{% endblocktrans %}

diff --git a/openstack_dashboard/dashboards/project/instances/templates/instances/_update_networks.html b/openstack_dashboard/dashboards/project/instances/templates/instances/_update_networks.html deleted file mode 100644 index cf84caf396..0000000000 --- a/openstack_dashboard/dashboards/project/instances/templates/instances/_update_networks.html +++ /dev/null @@ -1,36 +0,0 @@ -{% load i18n %} - - -
-
- -
    - -
      -
      -
      - {% include "project/instances/_launch_network_help.html" %} -
      -
      - -
      -
      -
      - {% include "horizon/common/_form_fields.html" %} -
      -
      -
      - {{ step.get_help_text }} -
      -
      - - - diff --git a/openstack_dashboard/dashboards/project/instances/workflows/resize_instance.py b/openstack_dashboard/dashboards/project/instances/workflows/resize_instance.py index 00d25938fa..fd9bf7adc9 100644 --- a/openstack_dashboard/dashboards/project/instances/workflows/resize_instance.py +++ b/openstack_dashboard/dashboards/project/instances/workflows/resize_instance.py @@ -32,46 +32,16 @@ class SetAdvancedAction(workflows.Action): label=_("Disk Partition"), required=False, help_text=_("Automatic: The entire disk is a single partition and " "automatically resizes. Manual: Results in faster build " - "times but requires manual partitioning.")) - config_drive = forms.BooleanField( - label=_("Configuration Drive"), - required=False, help_text=_("Configure OpenStack to write metadata to " - "a special configuration drive that " - "attaches to the instance when it boots.")) - - def __init__(self, request, context, *args, **kwargs): - super().__init__(request, context, *args, **kwargs) - try: - config_choices = [("AUTO", _("Automatic")), - ("MANUAL", _("Manual"))] - self.fields['disk_config'].choices = config_choices - - # Only show the Config Drive option for the Launch Instance - # is supported. - if context.get('workflow_slug') != 'launch_instance': - del self.fields['config_drive'] - - except Exception: - exceptions.handle(request, _('Unable to retrieve extensions ' - 'information.')) + "times but requires manual partitioning."), + choices=[("AUTO", _("Automatic")), ("MANUAL", _("Manual"))]) class Meta(object): name = _("Advanced Options") - help_text_template = ("project/instances/" - "_launch_advanced_help.html") class SetAdvanced(workflows.Step): action_class = SetAdvancedAction - contributes = ("disk_config", "config_drive",) - - def prepare_action_context(self, request, context): - context = super().prepare_action_context(request, context) - # Add the workflow slug to the context so that we can tell which - # workflow is being used when creating the action. This step is - # used by both the Launch Instance and Resize Instance workflows. - context['workflow_slug'] = self.workflow.slug - return context + contributes = ("disk_config",) class SetFlavorChoiceAction(workflows.Action): diff --git a/releasenotes/notes/drop-django-launch-instance-form-c6543e1d52786b79.yaml b/releasenotes/notes/drop-django-launch-instance-form-c6543e1d52786b79.yaml index eaa9c78af4..256fbc0d40 100644 --- a/releasenotes/notes/drop-django-launch-instance-form-c6543e1d52786b79.yaml +++ b/releasenotes/notes/drop-django-launch-instance-form-c6543e1d52786b79.yaml @@ -4,6 +4,6 @@ upgrade: The Django version of the launch instance form was dropped. It was deprecated since Wallaby release. ``LAUNCH_INSTANCE_LEGACY_ENABLED`` and ``LAUNCH_INSTANCE_NG_ENABLED`` - setting were dropped as horizon uses angular version of launch instance - by default. + settings were dropped as horizon always uses the Angular version of + the launch instance form.