Patch to add kernel(1M) and boot(1M) options to horizon.

There are no plans to push this upstream.

--- horizon-2015.1.2/openstack_dashboard/dashboards/project/instances/views.py.orig	2016-01-12 15:39:19.871734393 -0700
+++ horizon-2015.1.2/openstack_dashboard/dashboards/project/instances/views.py	2016-01-14 13:36:28.185989955 -0700
@@ -21,6 +21,7 @@ Views for managing instances.
 """
 import logging

+from django.conf import settings
 from django.core.urlresolvers import reverse
 from django.core.urlresolvers import reverse_lazy
 from django import http
@@ -251,6 +252,14 @@ class UpdateView(workflows.WorkflowView)
         initial = super(UpdateView, self).get_initial()
         initial.update({'instance_id': self.kwargs['instance_id'],
                         'name': getattr(self.get_object(), 'name', '')})
+        if getattr(settings, 'SOLARIS_BOOTARGS', True):
+            metadata = getattr(self.get_object(), 'metadata', '')
+            bootargs = metadata.get('bootargs')
+            bootargs_persist = metadata.get(
+                'bootargs_persist', 'False').lower() == 'true'
+
+            initial.update({'bootargs': bootargs,
+                            'bootargs_persist': bootargs_persist})
         return initial


--- horizon-2015.1.2/openstack_dashboard/dashboards/project/instances/workflows/create_instance.py.orig	2016-02-08 15:35:17.142181350 -0600
+++ horizon-2015.1.2/openstack_dashboard/dashboards/project/instances/workflows/create_instance.py	2016-02-08 15:35:29.148388395 -0600
@@ -22,6 +22,7 @@ import operator

 from oslo_utils import units

+from django.conf import settings
 from django.template.defaultfilters import filesizeformat  # noqa
 from django.utils.text import normalize_newlines  # noqa
 from django.utils.translation import ugettext_lazy as _
@@ -872,6 +873,14 @@ class LaunchInstance(workflows.Workflow)
             nics = self.set_network_port_profiles(request,
                                                   context['network_id'],
                                                   context['profile_id'])
+        metadata = {}
+        if getattr(settings, 'SOLARIS_BOOTARGS', True):
+            bopts = context.get('boot_options').strip()
+            if bopts:
+                metadata = {
+                    "bootargs": bopts,
+                    "bootargs_persist": str(context.get('bootargs_persist'))
+                }

         try:
             api.nova.server_create(request,
@@ -888,7 +897,8 @@ class LaunchInstance(workflows.Workflow)
                                    instance_count=int(context['count']),
                                    admin_pass=context['admin_pass'],
                                    disk_config=context.get('disk_config'),
-                                   config_drive=context.get('config_drive'))
+                                   config_drive=context.get('config_drive'),
+                                   meta=metadata)
             return True
         except Exception:
             if port_profiles_supported:
--- horizon-2015.1.2/openstack_dashboard/api/nova.py.orig	2015-12-08 16:05:40.611921571 -0700
+++ horizon-2015.1.2/openstack_dashboard/api/nova.py	2015-12-08 16:06:20.242257576 -0700
@@ -661,6 +661,10 @@ def server_update(request, instance_id,
     return novaclient(request).servers.update(instance_id, name=name)
 
 
+def server_set_meta(request, instance_id, metadata):
+    return novaclient(request).servers.set_meta(instance_id, metadata=metadata)
+
+
 def server_migrate(request, instance_id):
     novaclient(request).servers.migrate(instance_id)

--- horizon-2015.1.2/openstack_dashboard/dashboards/project/instances/tables.py.orig	2016-02-17 09:04:25.877390975 -0600
+++ horizon-2015.1.2/openstack_dashboard/dashboards/project/instances/tables.py	2016-02-17 09:06:41.425616719 -0600
@@ -390,6 +390,14 @@ class EditInstance(policy.PolicyTargetMi
         return not is_deleting(instance)
 
 
+class EditBootargs(EditInstance):
+    name = "edit_bootargs"
+    verbose_name = _("Edit Instance Boot Options")
+
+    def get_link_url(self, project):
+        return self._get_link_url(project, 'instance_bootargs')
+
+
 class EditInstanceSecurityGroups(EditInstance):
     name = "edit_secgroups"
     verbose_name = _("Edit Security Groups")
@@ -1065,3 +1073,7 @@ class InstancesTable(tables.DataTable):
                        ResizeLink, LockInstance, UnlockInstance,
                        SoftRebootInstance, RebootInstance,
                        StopInstance, RebuildInstance, TerminateInstance)
+        pos = row_actions.index(ConsoleLink)
+        if getattr(settings, 'SOLARIS_BOOTARGS', True):
+            row_actions = (row_actions[:pos] + (EditBootargs,) +
+                           row_actions[pos:])
