launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #14058
[Merge] lp:~dimitern/maas/1.2-node-view-shows-kernel-params into lp:maas/1.2
Dimiter Naydenov has proposed merging lp:~dimitern/maas/1.2-node-view-shows-kernel-params into lp:maas/1.2 with lp:~jameinel/maas/1.2-node-get-effective-kernel-options as a prerequisite.
Commit message:
Related to bug #1044503: Add UI for kernel parameters in the node, tag and settings pages.
Requested reviews:
MAAS Maintainers (maas-maintainers)
Related bugs:
Bug #1044503 in MAAS: "kernel command line is not easily customizable"
https://bugs.launchpad.net/maas/+bug/1044503
For more details, see:
https://code.launchpad.net/~dimitern/maas/1.2-node-view-shows-kernel-params/+merge/133215
This is a resubmit of the MP here, but targeting the right branch (1.2).
https://code.launchpad.net/~jameinel/maas/1.2-node-get-effective-kernel-options/+merge/133205
--
https://code.launchpad.net/~dimitern/maas/1.2-node-view-shows-kernel-params/+merge/133215
Your team MAAS Maintainers is requested to review the proposed merge of lp:~dimitern/maas/1.2-node-view-shows-kernel-params into lp:maas/1.2.
=== modified file 'src/maasserver/forms.py'
--- src/maasserver/forms.py 2012-10-30 15:15:30 +0000
+++ src/maasserver/forms.py 2012-11-07 11:00:52 +0000
@@ -646,6 +646,13 @@
self._load_initials()
+class GlobalKernelOptsForm(ConfigForm):
+ """Settings page, Global Kernel Parameters section."""
+ global_kernel_opts = forms.CharField(
+ label="Boot parameters to pass to the kernel by default",
+ required=False)
+
+
hostname_error_msg = "Enter a valid hostname (e.g. host.example.com)."
=== modified file 'src/maasserver/static/css/components/blocks.css'
--- src/maasserver/static/css/components/blocks.css 2012-10-03 03:59:53 +0000
+++ src/maasserver/static/css/components/blocks.css 2012-11-07 11:00:52 +0000
@@ -82,3 +82,6 @@
.size12 {
width: 720px;
}
+.size12 input {
+ width: 100%;
+ }
=== modified file 'src/maasserver/templates/maasserver/form_field.html'
--- src/maasserver/templates/maasserver/form_field.html 2012-08-03 16:36:26 +0000
+++ src/maasserver/templates/maasserver/form_field.html 2012-11-07 11:00:52 +0000
@@ -1,5 +1,5 @@
{% load field_type %}
-<li class="{{ field.html_name }}{% if field.errors %} error{% endif %}">
+<li class="{{ field.html_name }}{% if css_class %} {{ css_class }}{% endif %}{% if field.errors %} error{% endif %}">
<label for="id_{{ field.html_name }}">
{% ifequal field|field_type "CheckboxInput" %}
{{ field }}
=== modified file 'src/maasserver/templates/maasserver/node_view.html'
--- src/maasserver/templates/maasserver/node_view.html 2012-10-05 17:42:12 +0000
+++ src/maasserver/templates/maasserver/node_view.html 2012-11-07 11:00:52 +0000
@@ -85,6 +85,18 @@
{% endif %}
</span>
</li>
+ <li class="block size10 first">
+ <h4>Kernel Parameters
+ {% if kernel_opts.is_global %}
+ - from: <a href="{% url 'settings' %}">Global Kernel Parameters</a>
+ {% elif kernel_opts.is_tag %}
+ - from tag: <span><a href="{% url 'tag-view' kernel_opts.tag.name %}">{{ kernel_opts.tag.name }}</a></span>
+ {% endif %}
+ </h4>
+ <span id="node_kernel_opts">
+ {{ kernel_opts.value }}
+ </span>
+ </li>
{% if error_text %}
<li class="block first">
<h4>Error output</h4>
=== modified file 'src/maasserver/templates/maasserver/settings.html'
--- src/maasserver/templates/maasserver/settings.html 2012-10-04 07:50:22 +0000
+++ src/maasserver/templates/maasserver/settings.html 2012-11-07 11:00:52 +0000
@@ -125,6 +125,21 @@
<div class="clear"></div>
</div>
<div class="divider"></div>
+ <div id="global_kernel_opts" class="block size7 first">
+ <h2>Global Kernel Parameters</h2>
+ <form action="{% url "settings" %}" method="post">
+ {% csrf_token %}
+ <ul>
+ {% with field=kernelopts_form.global_kernel_opts %}
+ {% include "maasserver/form_field.html" with css_class="size12" %}
+ {% endwith %}
+ </ul>
+ <input type="hidden" name="kernelopts_submit" value="1" />
+ <input type="submit" class="button right" value="Save" />
+ </form>
+ <div class="clear"></div>
+ </div>
+ <div class="divider"></div>
<div id="maas_and_network" class="block size7 first">
<h2>Network Configuration</h2>
<form action="{% url "settings" %}" method="post">
=== modified file 'src/maasserver/templates/maasserver/tag_view.html'
--- src/maasserver/templates/maasserver/tag_view.html 2012-10-03 03:59:53 +0000
+++ src/maasserver/templates/maasserver/tag_view.html 2012-11-07 11:00:52 +0000
@@ -19,6 +19,12 @@
<h4>Definition</h4>
<span>{{ tag.definition }}</span>
</li>
+ {% if tag.kernel_params %}
+ <li class="block size10">
+ <h4>Kernel Parameters</h4>
+ <span>{{ tag.kernel_params }}</span>
+ </li>
+ {% endif %}
{% if error_text %}
<li class="block first">
<h4>Error output</h4>
=== modified file 'src/maasserver/views/nodes.py'
--- src/maasserver/views/nodes.py 2012-10-17 05:20:13 +0000
+++ src/maasserver/views/nodes.py 2012-11-07 11:00:52 +0000
@@ -56,6 +56,7 @@
from maasserver.models import (
MACAddress,
Node,
+ Tag,
)
from maasserver.models.node import CONSTRAINTS_JUJU_MAP
from maasserver.models.node_constraint_filter import constrain_nodes
@@ -204,6 +205,13 @@
node.error if node.status == NODE_STATUS.FAILED_TESTS else None)
context['status_text'] = (
node.error if node.status != NODE_STATUS.FAILED_TESTS else None)
+ kernel_opts = node.get_effective_kernel_options()
+ context['kernel_opts'] = {
+ 'is_global': kernel_opts[0] is None,
+ 'is_tag': isinstance(kernel_opts[0], Tag),
+ 'tag': kernel_opts[0],
+ 'value': kernel_opts[1]
+ }
return context
def dispatch(self, *args, **kwargs):
=== modified file 'src/maasserver/views/settings.py'
--- src/maasserver/views/settings.py 2012-10-03 15:48:11 +0000
+++ src/maasserver/views/settings.py 2012-11-07 11:00:52 +0000
@@ -46,6 +46,7 @@
MAASAndNetworkForm,
NewUserCreationForm,
UbuntuForm,
+ GlobalKernelOptsForm,
)
from maasserver.models import (
NodeGroup,
@@ -177,6 +178,13 @@
if response is not None:
return response
+ # Process the Global Kernel Opts form.
+ kernelopts_form, response = process_form(
+ request, GlobalKernelOptsForm, reverse('settings'), 'kernelopts',
+ "Configuration updated.")
+ if response is not None:
+ return response
+
# Process accept clusters en masse.
if 'mass_accept_submit' in request.POST:
number = NodeGroup.objects.accept_all_pending()
@@ -207,6 +215,7 @@
'maas_and_network_form': maas_and_network_form,
'commissioning_form': commissioning_form,
'ubuntu_form': ubuntu_form,
+ 'kernelopts_form': kernelopts_form,
},
context_instance=RequestContext(request))
Follow ups