Merge "Follow-up: Drop Django based implementation of launch instance"

This commit is contained in:
Zuul 2022-02-02 11:33:50 +00:00 committed by Gerrit Code Review
commit 664d40a748
8 changed files with 5 additions and 93 deletions

View File

@ -1,2 +0,0 @@
{% load i18n %}
<p>{% blocktrans %}Specify advanced options to use when launching an instance.{% endblocktrans %}</p>

View File

@ -1,7 +0,0 @@
{% extends 'project/instances/_flavors_and_quotas.html' %}
{% load i18n %}
{% block help_message %}
<p>{% blocktrans %}Specify the details for launching an instance.{% endblocktrans %}</p>
<p>{% blocktrans %}The chart below shows the resources used by this project in relation to the project's quotas.{% endblocktrans %}</p>
{% endblock %}

View File

@ -1,3 +0,0 @@
{% load i18n horizon %}
<p>{% 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 %}</p>

View File

@ -1,7 +0,0 @@
{% load i18n %}
{% block help_message %}
<p>{% 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 %}</p>
<p>{% blocktrans %}The port also describes the associated network configuration, such as the MAC and IP addresses to be used on that port.{% endblocktrans %}</p>
<p>{% 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 %}</p>
{% endblock %}

View File

@ -1,3 +0,0 @@
{% load i18n horizon %}
<p>{% blocktrans %}An instance can be launched with varying types of attached storage. You may select from those options here.{% endblocktrans %}</p>

View File

@ -1,36 +0,0 @@
{% load i18n %}
<noscript><h3>{{ step }}</h3></noscript>
<div id="networkListSortContainer" class="sort-container">
<div class="col-sm-6">
<label id="selected_network_label">{% trans "Selected networks" %}</label>
<ul id="selected_network" class="networklist box-list"></ul>
<label>{% trans "Available networks" %}</label>
<ul id="available_network" class="networklist box-list"></ul>
</div>
<div class="col-sm-6">
{% include "project/instances/_launch_network_help.html" %}
</div>
</div>
<div id="networkListIdContainer">
<div class="actions">
<div id="networkListId">
{% include "horizon/common/_form_fields.html" %}
</div>
</div>
<div class="help_text">
{{ step.get_help_text }}
</div>
</div>
<script>
if (typeof $ !== 'undefined') {
horizon.instances.workflow_init($(".workflow"));
} else {
addHorizonLoadEvent(function() {
horizon.instances.workflow_init($(".workflow"));
});
}
</script>

View File

@ -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):

View File

@ -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.