18545343 nova-conductor's method shouldn't try to enable mysql
authorDrew Fisher <drew.fisher@oracle.com>
Thu, 10 Apr 2014 08:52:58 -0600
changeset 1820 f3a6bd7bd4a6
parent 1819 36c9d3c4fc50
child 1821 8df87d621cea
18545343 nova-conductor's method shouldn't try to enable mysql 18545393 cinder-volume's method shouldn't try to enable iscsi/target 18545462 Some panels, menus, and options should be removed from Horizon 18545581 upstream bug 1187129 should be patched in
components/openstack/cinder/files/cinder-volume
components/openstack/horizon/Makefile
components/openstack/horizon/files/local_settings.py
components/openstack/horizon/files/overrides.py
components/openstack/horizon/horizon.p5m
components/openstack/horizon/patches/04-lauchpad-1187129.patch
components/openstack/nova/files/nova-conductor
--- a/components/openstack/cinder/files/cinder-volume	Wed Apr 09 14:17:46 2014 -0700
+++ b/components/openstack/cinder/files/cinder-volume	Thu Apr 10 08:52:58 2014 -0600
@@ -14,40 +14,12 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import ConfigParser
 import os
 
 import smf_include
 
-from subprocess import CalledProcessError, Popen, PIPE, check_call
-
 
 def start():
-    """ checks cinder's conf file for the ZFSISCSIDriver.  If it's found, make
-    sure svc:/network/iscsi/target:default is online.
-
-    """
-    parser = ConfigParser.ConfigParser()
-    parser.read("/etc/cinder/cinder.conf")
-    driver = parser.get("DEFAULT", "volume_driver")
-    if driver == "cinder.volume.drivers.solaris.zfs.ZFSISCSIDriver":
-        iscsi_svc = "svc:/network/iscsi/target:default"
-        cmd = ["/usr/bin/svcs", "-H", "-o", "state", iscsi_svc]
-        try:
-            p = Popen(cmd, stdout=PIPE, stderr=PIPE)
-            output, error = p.communicate()
-        except CalledProcessError:
-            print "%s not found.  Is it installed?" % iscsi_svc
-            return smf_include.SMF_EXIT_ERR_CONFIG
-
-        if output.strip() != "online":
-            cmd = ["/usr/sbin/svcadm", "enable", "-rs", iscsi_svc]
-            try:
-                check_call(cmd)
-            except CalledProcessError as err:
-                print "enabling %s failed:  %s" % (iscsi_svc, err)
-                return smf_include.SMF_EXIT_ERR_CONFIG
-
     smf_include.smf_subprocess("/usr/bin/pfexec /usr/lib/cinder/cinder-volume")
 
 if __name__ == "__main__":
--- a/components/openstack/horizon/Makefile	Wed Apr 09 14:17:46 2014 -0700
+++ b/components/openstack/horizon/Makefile	Thu Apr 10 08:52:58 2014 -0600
@@ -54,7 +54,9 @@
 	 $(MKDIR) $(PROTO_DIR)/usr/lib/python2.6/vendor-packages/openstack_dashboard/static/solaris/img; \
 	 $(CP) files/branding/img/* $(PROTO_DIR)/usr/lib/python2.6/vendor-packages/openstack_dashboard/static/solaris/img; \
 	 $(MKDIR) $(PROTO_DIR)/usr/lib/python2.6/vendor-packages/openstack_dashboard/static/solaris/theme; \
-	 $(CP) files/branding/theme/_stylesheets.html $(PROTO_DIR)/usr/lib/python2.6/vendor-packages/openstack_dashboard/static/solaris/theme)
+	 $(CP) files/branding/theme/_stylesheets.html $(PROTO_DIR)/usr/lib/python2.6/vendor-packages/openstack_dashboard/static/solaris/theme; \
+	 $(CP) files/overrides.py $(PROTO_DIR)/usr/lib/python2.6/vendor-packages/openstack_dashboard); \
+	 $(PYTHON) -m compileall $(PROTO_DIR)/$(PYTHON_VENDOR_PACKAGES)
 
 # common targets
 build:		$(BUILD_NO_ARCH)
--- a/components/openstack/horizon/files/local_settings.py	Wed Apr 09 14:17:46 2014 -0700
+++ b/components/openstack/horizon/files/local_settings.py	Thu Apr 10 08:52:58 2014 -0600
@@ -46,6 +46,7 @@
     'exceptions': {'recoverable': exceptions.RECOVERABLE,
                    'not_found': exceptions.NOT_FOUND,
                    'unauthorized': exceptions.UNAUTHORIZED},
+    'customization_module': 'openstack_dashboard.overrides',
 }
 
 # Specify a regular expression to validate user passwords.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/openstack/horizon/files/overrides.py	Thu Apr 10 08:52:58 2014 -0600
@@ -0,0 +1,95 @@
+# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+"""
+Solaris-specific customizations for Horizon
+"""
+
+from horizon import tabs
+from openstack_dashboard.dashboards.admin.networks.forms import CreateNetwork
+from openstack_dashboard.dashboards.admin.networks.ports.forms import \
+    CreatePort
+from openstack_dashboard.dashboards.admin.networks.ports.tables import \
+    DeletePort, PortsTable
+from openstack_dashboard.dashboards.admin.networks.subnets.tables import \
+    DeleteSubnet, SubnetsTable
+from openstack_dashboard.dashboards.admin.networks.tables import \
+    DeleteNetwork, NetworksTable
+from openstack_dashboard.dashboards.project.instances.tabs import \
+    InstanceDetailTabs, LogTab, OverviewTab
+from openstack_dashboard.dashboards.project.instances.workflows import \
+    create_instance
+from openstack_dashboard.dashboards.project.networks.ports.tables import \
+    PortsTable as projectPortsTable
+from openstack_dashboard.dashboards.project.networks.subnets.tables import \
+    DeleteSubnet as projectDeleteSubnet
+from openstack_dashboard.dashboards.project.networks.subnets.tables import \
+    SubnetsTable as projectSubnetsTable
+from openstack_dashboard.dashboards.project.networks.tables import \
+    CreateSubnet as projectCreateSubnet
+from openstack_dashboard.dashboards.project.networks.tables import \
+    DeleteNetwork as projectDeleteNetwork
+from openstack_dashboard.dashboards.project.networks.tables import \
+    NetworksTable as projectNetworksTable
+from openstack_dashboard.dashboards.project.networks.workflows import \
+    CreateNetworkInfoAction, CreateSubnetDetailAction, CreateSubnetInfoAction
+
+# remove PostCreationStep from LaunchInstance
+create_instance.LaunchInstance.default_steps = \
+    (create_instance.SelectProjectUser,
+     create_instance.SetInstanceDetails,
+     create_instance.SetAccessControls,
+     create_instance.SetNetwork)
+
+# remove the 'Console' tab from Instance Detail
+InstanceDetailTabs.tabs = (OverviewTab, LogTab)
+
+# Disable 'admin_state' and 'shared' checkboxes on Create Networks
+CreateNetwork.base_fields['admin_state'].widget.attrs['disabled'] = True
+CreateNetwork.base_fields['shared'].widget.attrs['disabled'] = True
+
+# Disable 'admin_state' checkbox on Create Port
+CreatePort.base_fields['admin_state'].widget.attrs['disabled'] = True
+
+# Remove the ability to Update Ports
+PortsTable._meta.row_actions = (DeletePort,)
+
+# Remove the ability to Update Subnets
+SubnetsTable._meta.row_actions = (DeleteSubnet,)
+
+# Remove the ability to Edit Networks
+NetworksTable._meta.row_actions = (DeleteNetwork,)
+
+# Remove the ability to Update project Ports
+projectPortsTable._meta.row_actions = ()
+
+# Remove the ability to Update project Subnets
+projectSubnetsTable._meta.row_actions = (projectDeleteSubnet,)
+
+# Remove the ability to Edit project Networks
+projectNetworksTable._meta.row_actions = (projectCreateSubnet,
+                                          projectDeleteNetwork)
+
+# Disable 'admin_state' checkbox on Create project Networks
+CreateNetworkInfoAction.base_fields['admin_state'].widget.attrs['disabled'] = \
+    True
+
+# Disable 'no_gateway' checkbox on Create project Networks
+CreateSubnetInfoAction.base_fields['no_gateway'].widget.attrs['disabled'] = \
+    True
+
+# change 'allocation_pools' and 'host_routes' to readonly
+base_fields = CreateSubnetDetailAction.base_fields
+base_fields['allocation_pools'].widget.attrs['readonly'] = 'readonly'
+base_fields['host_routes'].widget.attrs['readonly'] = 'readonly'
--- a/components/openstack/horizon/horizon.p5m	Wed Apr 09 14:17:46 2014 -0700
+++ b/components/openstack/horizon/horizon.p5m	Thu Apr 10 08:52:58 2014 -0600
@@ -680,6 +680,7 @@
 file path=usr/lib/python$(PYVER)/vendor-packages/openstack_dashboard/openstack/common/__init__.py
 file path=usr/lib/python$(PYVER)/vendor-packages/openstack_dashboard/openstack/common/setup.py
 file path=usr/lib/python$(PYVER)/vendor-packages/openstack_dashboard/openstack/common/version.py
+file path=usr/lib/python$(PYVER)/vendor-packages/openstack_dashboard/overrides.py
 file path=usr/lib/python$(PYVER)/vendor-packages/openstack_dashboard/settings.py
 dir  path=usr/lib/python$(PYVER)/vendor-packages/openstack_dashboard/static \
     owner=webservd group=webservd
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/openstack/horizon/patches/04-lauchpad-1187129.patch	Thu Apr 10 08:52:58 2014 -0600
@@ -0,0 +1,52 @@
+From d7b8c1eeb6c36800a891584ad948b4b5ab1f52bf Mon Sep 17 00:00:00 2001
+From: armando-migliaccio <[email protected]>
+Date: Mon, 3 Jun 2013 13:57:44 -0700
+Subject: [PATCH] Fix bug in port creation form
+
+'network_name' is not a recognized Quantum attribute, so passing it
+in the request to the Quantum Server causes an error. In the end this
+is not required because the network is identified by its id. So
+this patch removes it (as it's done in other cases as well).
+
+Fixes bug #1187129
+
+Change-Id: Ie18c7bd504f8c241d002d6a050b8bcc59ed9fc03
+
+Fixed in Havana 2013.2
+---
+ .../dashboards/admin/networks/ports/forms.py       |    1 +
+ .../dashboards/admin/networks/tests.py             |    2 --
+ 2 files changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/openstack_dashboard/dashboards/admin/networks/ports/forms.py b/openstack_dashboard/dashboards/admin/networks/ports/forms.py
+index 7a1f45d..939952b 100644
+--- a/openstack_dashboard/dashboards/admin/networks/ports/forms.py
++++ b/openstack_dashboard/dashboards/admin/networks/ports/forms.py
[email protected]@ -57,6 +57,7 @@ class CreatePort(forms.SelfHandlingForm):
+             network = api.quantum.network_get(request, data['network_id'])
+             data['tenant_id'] = network.tenant_id
+             data['admin_state_up'] = data['admin_state']
++            del data['network_name']
+             del data['admin_state']
+ 
+             port = api.quantum.port_create(request, **data)
+diff --git a/openstack_dashboard/dashboards/admin/networks/tests.py b/openstack_dashboard/dashboards/admin/networks/tests.py
+index d6c0123..9c2cd19 100644
+--- a/openstack_dashboard/dashboards/admin/networks/tests.py
++++ b/openstack_dashboard/dashboards/admin/networks/tests.py
[email protected]@ -651,7 +651,6 @@ class NetworkPortTests(test.BaseAdminViewTests):
+         api.quantum.port_create(IsA(http.HttpRequest),
+                                 tenant_id=network.tenant_id,
+                                 network_id=network.id,
+-                                network_name=network.name,
+                                 name=port.name,
+                                 admin_state_up=port.admin_state_up,
+                                 device_id=port.device_id,
[email protected]@ -688,7 +687,6 @@ class NetworkPortTests(test.BaseAdminViewTests):
+         api.quantum.port_create(IsA(http.HttpRequest),
+                                 tenant_id=network.tenant_id,
+                                 network_id=network.id,
+-                                network_name=network.name,
+                                 name=port.name,
+                                 admin_state_up=port.admin_state_up,
+                                 device_id=port.device_id,
--- a/components/openstack/nova/files/nova-conductor	Wed Apr 09 14:17:46 2014 -0700
+++ b/components/openstack/nova/files/nova-conductor	Thu Apr 10 08:52:58 2014 -0600
@@ -14,21 +14,16 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import ConfigParser
 import os
 import sys
 
 import smf_include
 
-from subprocess import CalledProcessError, check_call, PIPE, Popen
-
-from sqlalchemy import create_engine
+from subprocess import CalledProcessError, check_call
 
 
-def db_sync():
-    """ function to create the database schema
-    """
-
+def start():
+    # sync the database to make sure it's ready
     cmd = ["/usr/bin/nova-manage", "db", "sync"]
     try:
         check_call(cmd)
@@ -36,47 +31,6 @@
         print "Unable to create database for Nova:  %s" % err
         sys.exit(smf_include.SMF_EXIT_ERR_CONFIG)
 
-
-def start():
-    # read the options from the config file
-    parser = ConfigParser.ConfigParser()
-    parser.read("/etc/nova/nova.conf")
-
-    # get the database type
-    db_engine = create_engine(parser.get("DEFAULT", "sql_connection"))
-    db_type = db_engine.name
-
-    if db_type == "sqlite":
-        # look to see if file exists or if it's zero length
-        abspath = os.path.abspath(db_engine.url.database)
-        if not os.path.exists(abspath) or os.path.getsize(abspath) == 0:
-            db_sync()
-
-    elif db_type == "mysql":
-        mysql_svc = "svc:/application/database/mysql:version_55"
-        cmd = ["/usr/bin/svcs", "-H", "-o", "state", mysql_svc]
-
-        try:
-            p = Popen(cmd, stdout=PIPE, stderr=PIPE)
-            output, error = p.communicate()
-        except CalledProcessError:
-            print "mysql service not found.  Is it installed?"
-            return smf_include.SMF_EXIT_ERR_CONFIG
-
-        if output.strip() != "online":
-            # attempt to start mysql
-            cmd = ["/usr/sbin/svcadm", "enable", "-rs", mysql_svc]
-
-            try:
-                check_call(cmd)
-            except CalledProcessError as err:
-                print "starting mysql service failed:  %s" % err
-                return smf_include.SMF_EXIT_ERR_CONFIG
-
-        # not sure how to check if the database is valid, so just create
-        # the database every time for now
-        db_sync()
-
     smf_include.smf_subprocess("/usr/lib/nova/nova-conductor")
 
 if __name__ == "__main__":