From b948f8555884b1999e1e5ac279b4f58199d8c73f Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Thu, 31 Jul 2014 22:43:03 +0800 Subject: [PATCH] Refreshed patches. Rewritten-From: ff9e29a3deb47ddad54936811f9fcc1ffd122ffb --- ...d-iptables-rules-to-protect-dnsmasq-.patch | 26 ++- .../patches/better-config-default.patch | 113 +++++---- .../fix-alembic-migration-with-sqlite3.patch | 219 +++++++++--------- trusty/debian/patches/series | 6 +- 4 files changed, 198 insertions(+), 166 deletions(-) diff --git a/trusty/debian/patches/0001-Add-parameter-and-iptables-rules-to-protect-dnsmasq-.patch b/trusty/debian/patches/0001-Add-parameter-and-iptables-rules-to-protect-dnsmasq-.patch index aa66a23b0..b621a3c77 100644 --- a/trusty/debian/patches/0001-Add-parameter-and-iptables-rules-to-protect-dnsmasq-.patch +++ b/trusty/debian/patches/0001-Add-parameter-and-iptables-rules-to-protect-dnsmasq-.patch @@ -17,8 +17,10 @@ Last-Update: 2014-06-30 neutron/tests/unit/test_linux_dhcp.py | 259 ++++++++++++++++++++++++++++++++- 3 files changed, 421 insertions(+), 2 deletions(-) ---- a/etc/dhcp_agent.ini -+++ b/etc/dhcp_agent.ini +Index: neutron/etc/dhcp_agent.ini +=================================================================== +--- neutron.orig/etc/dhcp_agent.ini 2014-07-18 10:32:38.000000000 +0800 ++++ neutron/etc/dhcp_agent.ini 2014-07-31 22:31:22.000000000 +0800 @@ -86,3 +86,8 @@ # Timeout for ovs-vsctl commands. # If the timeout expires, ovs commands will fail with ALARMCLOCK error. @@ -28,9 +30,11 @@ Last-Update: 2014-06-30 +# Useful when a subnet is routed to another one or in the case of an +# external network. +# isolate_dns_requests = False ---- a/neutron/agent/linux/dhcp.py -+++ b/neutron/agent/linux/dhcp.py -@@ -28,6 +28,7 @@ +Index: neutron/neutron/agent/linux/dhcp.py +=================================================================== +--- neutron.orig/neutron/agent/linux/dhcp.py 2014-07-31 22:28:57.000000000 +0800 ++++ neutron/neutron/agent/linux/dhcp.py 2014-07-31 22:31:22.000000000 +0800 +@@ -26,6 +26,7 @@ import six from neutron.agent.linux import ip_lib @@ -38,7 +42,7 @@ Last-Update: 2014-06-30 from neutron.agent.linux import utils from neutron.common import constants from neutron.common import exceptions -@@ -59,6 +60,9 @@ +@@ -57,6 +58,9 @@ 'dnsmasq_lease_max', default=(2 ** 24), help=_('Limit number of leases to prevent a denial-of-service.')), @@ -48,7 +52,7 @@ Last-Update: 2014-06-30 ] IPV4 = 4 -@@ -75,6 +79,7 @@ +@@ -73,6 +77,7 @@ METADATA_PORT = 80 WIN2k3_STATIC_DNS = 249 NS_PREFIX = 'qdhcp-' @@ -56,7 +60,7 @@ Last-Update: 2014-06-30 class DictModel(dict): -@@ -706,7 +711,67 @@ +@@ -730,7 +735,67 @@ sock.close() @@ -124,7 +128,7 @@ Last-Update: 2014-06-30 def __init__(self, conf, root_helper, plugin): self.conf = conf -@@ -855,6 +920,87 @@ +@@ -879,6 +944,87 @@ return dhcp_port @@ -212,7 +216,7 @@ Last-Update: 2014-06-30 def setup(self, network): """Create and initialize a device for network's DHCP on this host.""" port = self.setup_dhcp_port(network) -@@ -893,6 +1039,9 @@ +@@ -917,6 +1063,9 @@ if self.conf.use_namespaces: self._set_default_route(network, interface_name) @@ -222,7 +226,7 @@ Last-Update: 2014-06-30 return interface_name def update(self, network, device_name): -@@ -900,9 +1049,17 @@ +@@ -924,9 +1073,17 @@ if self.conf.use_namespaces: self._set_default_route(network, device_name) diff --git a/trusty/debian/patches/better-config-default.patch b/trusty/debian/patches/better-config-default.patch index 7f4adf163..777623f69 100644 --- a/trusty/debian/patches/better-config-default.patch +++ b/trusty/debian/patches/better-config-default.patch @@ -1,12 +1,36 @@ -Description: Better config default - The default of Neutron make it so that it's not usable by default, and hard to - parse with maintainer scripts. This patch fixes that. -Author: Thomas Goirand -Forwarded: no -Last-Update: 2014-06-30 +Description: + TODO: Put a short summary on the line above and replace this paragraph + with a longer explanation of this change. Complete the meta-information + with other relevant fields (see below for details). To make it easier, the + information below has been extracted from the changelog. Adjust it or drop + it. + . + neutron (2014.2~b2-1) experimental; urgency=medium + . + [ Thomas Goirand ] + * Disabled ml2 config patch. + * Fixed (build-)depends for this release. + . + [ gustavo panizzo ] + * New upstream release. + * Support to run neutron under systemd. +Author: gustavo panizzo ---- a/etc/l3_agent.ini -+++ b/etc/l3_agent.ini +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: http://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: + +--- neutron-2014.2~b2.orig/etc/l3_agent.ini ++++ neutron-2014.2~b2/etc/l3_agent.ini @@ -4,11 +4,10 @@ # L3 requires that an interface driver be set. Choose the one that best @@ -20,19 +44,19 @@ Last-Update: 2014-06-30 # Use veth for an OVS interface or not. # Support kernels with limited namespace support ---- a/etc/neutron.conf -+++ b/etc/neutron.conf -@@ -50,8 +50,7 @@ +--- neutron-2014.2~b2.orig/etc/neutron.conf ++++ neutron-2014.2~b2/etc/neutron.conf +@@ -60,8 +60,8 @@ lock_path = $state_path/lock # previous versions, the class name of a plugin can be specified instead of its # entrypoint name. # -# core_plugin = --# Example: core_plugin = ml2 + # Example: core_plugin = ml2 +core_plugin = neutron.plugins.ml2.plugin.Ml2Plugin # (ListOpt) List of service plugin entrypoints to be loaded from the # neutron.service_plugins namespace. See setup.cfg for the entrypoint names of -@@ -59,8 +58,8 @@ +@@ -69,8 +69,8 @@ lock_path = $state_path/lock # with previous versions, the class name of a plugin can be specified instead # of its entrypoint name. # @@ -42,27 +66,29 @@ Last-Update: 2014-06-30 # Paste configuration file # api_paste_config = api-paste.ini -@@ -132,16 +131,16 @@ - # SSL certification authority file (valid only if SSL enabled) - # kombu_ssl_ca_certs = - # IP address of the RabbitMQ installation --# rabbit_host = localhost -+rabbit_host = localhost - # Password of the RabbitMQ server --# rabbit_password = guest -+rabbit_password = guest - # Port where RabbitMQ server is running/listening - # rabbit_port = 5672 - # RabbitMQ single or HA cluster (host:port pairs i.e: host1:5672, host2:5672) - # rabbit_hosts is defaulted to '$rabbit_host:$rabbit_port' - # rabbit_hosts = localhost:5672 - # User ID used for RabbitMQ connections --# rabbit_userid = guest -+rabbit_userid = guest - # Location of a virtual RabbitMQ installation. - # rabbit_virtual_host = / - # Maximum retries with trying to connect to RabbitMQ -@@ -389,7 +388,7 @@ +@@ -315,7 +315,7 @@ lock_path = $state_path/lock + + # The RabbitMQ broker address where a single node is used. + # (string value) +-#rabbit_host=localhost ++rabbit_host=localhost + + # The RabbitMQ broker port where a single node is used. + # (integer value) +@@ -328,10 +328,10 @@ lock_path = $state_path/lock + #rabbit_use_ssl=false + + # The RabbitMQ userid. (string value) +-#rabbit_userid=guest ++rabbit_userid=guest + + # The RabbitMQ password. (string value) +-#rabbit_password=guest ++rabbit_password=guest + + # the RabbitMQ login method (string value) + #rabbit_login_method=AMQPLAIN +@@ -507,7 +507,7 @@ lock_path = $state_path/lock # Use "sudo neutron-rootwrap /etc/neutron/rootwrap.conf" to use the real # root filter facility. # Change to "sudo" to skip the filtering and just run the comand directly @@ -71,21 +97,24 @@ Last-Update: 2014-06-30 # =========== items for agent management extension ============= # seconds between nodes reporting state to server; should be less than -@@ -408,11 +407,9 @@ - +@@ -527,14 +527,13 @@ admin_password = %SERVICE_PASSWORD% [database] # This line MUST be changed to actually run the plugin. --# Example: + # Example: -# connection = mysql://root:pass@127.0.0.1:3306/neutron # Replace 127.0.0.1 above with the IP address of the database used by the # main neutron server. (Leave it as is if the database runs on this host.) -# connection = sqlite:// + # NOTE: In deployment the [database] section and its connection attribute may + # be set in the corresponding core plugin '.ini' file. However, it is suggested + # to put the [database] section and its connection attribute in this + # configuration file. +connection = sqlite:///var/lib/neutron/neutrondb # Database engine for which script will be generated when using offline # migration ---- a/etc/lbaas_agent.ini -+++ b/etc/lbaas_agent.ini +--- neutron-2014.2~b2.orig/etc/lbaas_agent.ini ++++ neutron-2014.2~b2/etc/lbaas_agent.ini @@ -9,11 +9,10 @@ # LBaas requires an interface driver be set. Choose the one that best @@ -99,8 +128,8 @@ Last-Update: 2014-06-30 # Use veth for an OVS interface or not. # Support kernels with limited namespace support ---- a/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini -+++ b/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini +--- neutron-2014.2~b2.orig/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini ++++ neutron-2014.2~b2/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini @@ -30,22 +30,22 @@ # point setting tunnel_type below will be required to enable # tunneling. @@ -136,7 +165,7 @@ Last-Update: 2014-06-30 # (ListOpt) Comma-separated list of : tuples # mapping physical network names to the agent's node-specific OVS -@@ -140,40 +140,10 @@ +@@ -151,40 +151,10 @@ [securitygroup] # Firewall driver for realizing neutron security group function. diff --git a/trusty/debian/patches/fix-alembic-migration-with-sqlite3.patch b/trusty/debian/patches/fix-alembic-migration-with-sqlite3.patch index 0ed3c6882..e24c32f9c 100644 --- a/trusty/debian/patches/fix-alembic-migration-with-sqlite3.patch +++ b/trusty/debian/patches/fix-alembic-migration-with-sqlite3.patch @@ -6,106 +6,11 @@ Author: Thomas Goirand Bug-Debian: http://bugs.debian.org/726719 Bug-Ubuntu: https://launchpad.net/bugs/1241952 Forwarded: https://review.openstack.org/#/c/52636 -Last-Update: 2014-06-30 +Last-Update: 2014-07-31 ---- a/neutron/db/migration/alembic_migrations/versions/128e042a2b68_ext_gw_mode.py -+++ b/neutron/db/migration/alembic_migrations/versions/128e042a2b68_ext_gw_mode.py -@@ -59,9 +59,9 @@ - return - - op.add_column('routers', sa.Column('enable_snat', sa.Boolean(), -- nullable=False, default=True)) -+ nullable=False, server_default='1')) - # Set enable_snat to True for existing routers -- op.execute("UPDATE routers SET enable_snat=True") -+ op.execute("UPDATE routers SET enable_snat='True'") - - - def downgrade(active_plugins=None, options=None): ---- a/neutron/db/migration/alembic_migrations/versions/63afba73813_ovs_tunnelendpoints_id_unique.py -+++ b/neutron/db/migration/alembic_migrations/versions/63afba73813_ovs_tunnelendpoints_id_unique.py -@@ -46,11 +46,27 @@ - if not migration.should_run(active_plugins, migration_for_plugins): - return - -- op.create_unique_constraint( -- name=CONSTRAINT_NAME, -- source=TABLE_NAME, -- local_cols=['id'] -- ) -+ bind = op.get_bind() -+ engine = bind.engine -+ if engine.name == 'sqlite': -+ op.execute("CREATE TEMPORARY TABLE ovs_tunnel_endpoints_backup ( " -+ "ip_address VARCHAR(64) NOT NULL, " -+ "id INTEGER NOT NULL UNIQUE, " -+ "PRIMARY KEY (ip_address) );") -+ op.execute("INSERT INTO ovs_tunnel_endpoints_backup SELECT ip_address,id FROM ovs_tunnel_endpoints;") -+ op.execute("DROP TABLE ovs_tunnel_endpoints;"); -+ op.execute("CREATE TABLE ovs_tunnel_endpoints ( " -+ "ip_address VARCHAR(64) NOT NULL, " -+ "id INTEGER UNIQUE NOT NULL, " -+ "PRIMARY KEY (ip_address) );") -+ op.execute("INSERT INTO ovs_tunnel_endpoints SELECT ip_address,id FROM ovs_tunnel_endpoints_backup;") -+ op.execute("DROP TABLE ovs_tunnel_endpoints_backup;") -+ else: -+ op.create_unique_constraint( -+ name=CONSTRAINT_NAME, -+ source=TABLE_NAME, -+ local_cols=['id'] -+ ) - - - def downgrade(active_plugins=None, options=None): ---- a/neutron/db/migration/alembic_migrations/versions/f9263d6df56_remove_dhcp_lease.py -+++ b/neutron/db/migration/alembic_migrations/versions/f9263d6df56_remove_dhcp_lease.py -@@ -38,7 +38,42 @@ - - - def upgrade(active_plugins=None, options=None): -- op.drop_column('ipallocations', u'expiration') -+ bind = op.get_bind() -+ engine = bind.engine -+ if engine.name == 'sqlite': -+ op.execute("CREATE TEMPORARY TABLE ipallocations_backup (" -+ "port_id VARCHAR(36), " -+ "ip_address VARCHAR(64) NOT NULL, " -+ "subnet_id VARCHAR(36) NOT NULL, " -+ "network_id VARCHAR(36) NOT NULL, " -+ "PRIMARY KEY (ip_address, subnet_id, network_id), " -+ "FOREIGN KEY(network_id) REFERENCES networks (id) " -+ "ON DELETE CASCADE, " -+ "FOREIGN KEY(port_id) REFERENCES ports (id) " -+ "ON DELETE CASCADE, " -+ "FOREIGN KEY(subnet_id) REFERENCES subnets (id) " -+ "ON DELETE CASCADE " -+ ");") -+ op.execute("INSERT INTO ipallocations_backup " -+ "SELECT port_id,ip_address,subnet_id,network_id " -+ "FROM ipallocations;") -+ op.execute("DROP TABLE ipallocations;") -+ op.execute("CREATE TABLE ipallocations (" -+ "port_id VARCHAR(36), " -+ "ip_address VARCHAR(64) NOT NULL, " -+ "subnet_id VARCHAR(36) NOT NULL, " -+ "network_id VARCHAR(36) NOT NULL, " -+ "PRIMARY KEY (ip_address, subnet_id, network_id), " -+ "FOREIGN KEY(network_id) REFERENCES networks (id) ON DELETE CASCADE, " -+ "FOREIGN KEY(port_id) REFERENCES ports (id) ON DELETE CASCADE, " -+ "FOREIGN KEY(subnet_id) REFERENCES subnets (id) ON DELETE CASCADE " -+ ");") -+ op.execute("INSERT INTO ipallocations " -+ "SELECT port_id,ip_address,subnet_id,network_id " -+ "FROM ipallocations_backup;") -+ op.execute("DROP TABLE ipallocations_backup;") -+ else: -+ op.drop_column('ipallocations', u'expiration') - - - def downgrade(active_plugins=None, options=None): ---- a/neutron/db/migration/alembic_migrations/versions/35c7c198ddea_lbaas_healthmon_del_status.py -+++ b/neutron/db/migration/alembic_migrations/versions/35c7c198ddea_lbaas_healthmon_del_status.py -@@ -43,8 +43,48 @@ +--- neutron-2014.2~b2.orig/neutron/db/migration/alembic_migrations/versions/35c7c198ddea_lbaas_healthmon_del_status.py ++++ neutron-2014.2~b2/neutron/db/migration/alembic_migrations/versions/35c7c198ddea_lbaas_healthmon_del_status.py +@@ -41,8 +41,48 @@ from neutron.db import migration def upgrade(active_plugins=None, options=None): if not migration.should_run(active_plugins, migration_for_plugins): return @@ -156,9 +61,9 @@ Last-Update: 2014-06-30 def downgrade(active_plugins=None, options=None): ---- a/neutron/db/migration/alembic_migrations/versions/50d5ba354c23_ml2_binding_vif_details.py -+++ b/neutron/db/migration/alembic_migrations/versions/50d5ba354c23_ml2_binding_vif_details.py -@@ -55,19 +55,63 @@ +--- neutron-2014.2~b2.orig/neutron/db/migration/alembic_migrations/versions/50d5ba354c23_ml2_binding_vif_details.py ++++ neutron-2014.2~b2/neutron/db/migration/alembic_migrations/versions/50d5ba354c23_ml2_binding_vif_details.py +@@ -53,19 +53,63 @@ def upgrade(active_plugins=None, options "UPDATE ml2_port_bindings SET" " vif_details = '{\"port_filter\": false}'" " WHERE cap_port_filter = 0") @@ -231,9 +136,55 @@ Last-Update: 2014-06-30 def downgrade(active_plugins=None, options=None): if not migration.should_run(active_plugins, migration_for_plugins): ---- a/neutron/db/migration/alembic_migrations/versions/e197124d4b9_add_unique_constrain.py -+++ b/neutron/db/migration/alembic_migrations/versions/e197124d4b9_add_unique_constrain.py -@@ -47,11 +47,17 @@ +--- neutron-2014.2~b2.orig/neutron/db/migration/alembic_migrations/versions/128e042a2b68_ext_gw_mode.py ++++ neutron-2014.2~b2/neutron/db/migration/alembic_migrations/versions/128e042a2b68_ext_gw_mode.py +@@ -59,7 +59,7 @@ def upgrade(active_plugins=None, options + op.add_column('routers', sa.Column('enable_snat', sa.Boolean(), + nullable=False, server_default="1")) + # Set enable_snat to True for existing routers +- op.execute("UPDATE routers SET enable_snat=True") ++ op.execute("UPDATE routers SET enable_snat='True'") + + + def downgrade(active_plugins=None, options=None): +--- neutron-2014.2~b2.orig/neutron/db/migration/alembic_migrations/versions/63afba73813_ovs_tunnelendpoints_id_unique.py ++++ neutron-2014.2~b2/neutron/db/migration/alembic_migrations/versions/63afba73813_ovs_tunnelendpoints_id_unique.py +@@ -44,11 +44,27 @@ def upgrade(active_plugins=None, options + if not migration.should_run(active_plugins, migration_for_plugins): + return + +- op.create_unique_constraint( +- name=CONSTRAINT_NAME, +- source=TABLE_NAME, +- local_cols=['id'] +- ) ++ bind = op.get_bind() ++ engine = bind.engine ++ if engine.name == 'sqlite': ++ op.execute("CREATE TEMPORARY TABLE ovs_tunnel_endpoints_backup ( " ++ "ip_address VARCHAR(64) NOT NULL, " ++ "id INTEGER NOT NULL UNIQUE, " ++ "PRIMARY KEY (ip_address) );") ++ op.execute("INSERT INTO ovs_tunnel_endpoints_backup SELECT ip_address,id FROM ovs_tunnel_endpoints;") ++ op.execute("DROP TABLE ovs_tunnel_endpoints;"); ++ op.execute("CREATE TABLE ovs_tunnel_endpoints ( " ++ "ip_address VARCHAR(64) NOT NULL, " ++ "id INTEGER UNIQUE NOT NULL, " ++ "PRIMARY KEY (ip_address) );") ++ op.execute("INSERT INTO ovs_tunnel_endpoints SELECT ip_address,id FROM ovs_tunnel_endpoints_backup;") ++ op.execute("DROP TABLE ovs_tunnel_endpoints_backup;") ++ else: ++ op.create_unique_constraint( ++ name=CONSTRAINT_NAME, ++ source=TABLE_NAME, ++ local_cols=['id'] ++ ) + + + def downgrade(active_plugins=None, options=None): +--- neutron-2014.2~b2.orig/neutron/db/migration/alembic_migrations/versions/e197124d4b9_add_unique_constrain.py ++++ neutron-2014.2~b2/neutron/db/migration/alembic_migrations/versions/e197124d4b9_add_unique_constrain.py +@@ -45,11 +45,17 @@ def upgrade(active_plugins=None, options if not migration.should_run(active_plugins, migration_for_plugins): return @@ -256,9 +207,9 @@ Last-Update: 2014-06-30 def downgrade(active_plugins=None, options=None): ---- a/neutron/db/migration/alembic_migrations/versions/abc88c33f74f_lb_stats_needs_bigint.py -+++ b/neutron/db/migration/alembic_migrations/versions/abc88c33f74f_lb_stats_needs_bigint.py -@@ -43,14 +43,19 @@ +--- neutron-2014.2~b2.orig/neutron/db/migration/alembic_migrations/versions/abc88c33f74f_lb_stats_needs_bigint.py ++++ neutron-2014.2~b2/neutron/db/migration/alembic_migrations/versions/abc88c33f74f_lb_stats_needs_bigint.py +@@ -41,14 +41,19 @@ def upgrade(active_plugins=None, options if not migration.should_run(active_plugins, migration_for_plugins): return @@ -286,9 +237,9 @@ Last-Update: 2014-06-30 def downgrade(active_plugins=None, options=None): ---- a/neutron/db/migration/alembic_migrations/versions/1fcfc149aca4_agents_unique_by_type_and_host.py -+++ b/neutron/db/migration/alembic_migrations/versions/1fcfc149aca4_agents_unique_by_type_and_host.py -@@ -55,11 +55,17 @@ +--- neutron-2014.2~b2.orig/neutron/db/migration/alembic_migrations/versions/1fcfc149aca4_agents_unique_by_type_and_host.py ++++ neutron-2014.2~b2/neutron/db/migration/alembic_migrations/versions/1fcfc149aca4_agents_unique_by_type_and_host.py +@@ -53,11 +53,17 @@ def upgrade(active_plugins=None, options if not migration.should_run(active_plugins, migration_for_plugins): return @@ -310,4 +261,50 @@ Last-Update: 2014-06-30 + ) + def downgrade(active_plugins=None, options=None): +--- neutron-2014.2~b2.orig/neutron/db/migration/alembic_migrations/versions/f9263d6df56_remove_dhcp_lease.py ++++ neutron-2014.2~b2/neutron/db/migration/alembic_migrations/versions/f9263d6df56_remove_dhcp_lease.py +@@ -36,7 +36,42 @@ import sqlalchemy as sa + + + def upgrade(active_plugins=None, options=None): +- op.drop_column('ipallocations', u'expiration') ++ bind = op.get_bind() ++ engine = bind.engine ++ if engine.name == 'sqlite': ++ op.execute("CREATE TEMPORARY TABLE ipallocations_backup (" ++ "port_id VARCHAR(36), " ++ "ip_address VARCHAR(64) NOT NULL, " ++ "subnet_id VARCHAR(36) NOT NULL, " ++ "network_id VARCHAR(36) NOT NULL, " ++ "PRIMARY KEY (ip_address, subnet_id, network_id), " ++ "FOREIGN KEY(network_id) REFERENCES networks (id) " ++ "ON DELETE CASCADE, " ++ "FOREIGN KEY(port_id) REFERENCES ports (id) " ++ "ON DELETE CASCADE, " ++ "FOREIGN KEY(subnet_id) REFERENCES subnets (id) " ++ "ON DELETE CASCADE " ++ ");") ++ op.execute("INSERT INTO ipallocations_backup " ++ "SELECT port_id,ip_address,subnet_id,network_id " ++ "FROM ipallocations;") ++ op.execute("DROP TABLE ipallocations;") ++ op.execute("CREATE TABLE ipallocations (" ++ "port_id VARCHAR(36), " ++ "ip_address VARCHAR(64) NOT NULL, " ++ "subnet_id VARCHAR(36) NOT NULL, " ++ "network_id VARCHAR(36) NOT NULL, " ++ "PRIMARY KEY (ip_address, subnet_id, network_id), " ++ "FOREIGN KEY(network_id) REFERENCES networks (id) ON DELETE CASCADE, " ++ "FOREIGN KEY(port_id) REFERENCES ports (id) ON DELETE CASCADE, " ++ "FOREIGN KEY(subnet_id) REFERENCES subnets (id) ON DELETE CASCADE " ++ ");") ++ op.execute("INSERT INTO ipallocations " ++ "SELECT port_id,ip_address,subnet_id,network_id " ++ "FROM ipallocations_backup;") ++ op.execute("DROP TABLE ipallocations_backup;") ++ else: ++ op.drop_column('ipallocations', u'expiration') + + def downgrade(active_plugins=None, options=None): diff --git a/trusty/debian/patches/series b/trusty/debian/patches/series index 2813201d5..ccc59088b 100644 --- a/trusty/debian/patches/series +++ b/trusty/debian/patches/series @@ -1,7 +1,9 @@ -fix-alembic-migration-with-sqlite3.patch -better-config-default.patch +#fix-alembic-migration-with-sqlite3.patch +#better-config-default.patch 0001-Add-parameter-and-iptables-rules-to-protect-dnsmasq-.patch #0004-Fix-Metering-doesn-t-respect-the-l3-agent-binding.patch #Properly_apply_column_default_in_migration_pool_monitor_status.patch #sane-defaults-for-ml2_conf.ini.patch #sane-defaults-for-dhcp_agent.ini.patch +fix-alembic-migration-with-sqlite3.patch +better-config-default.patch -- 2.45.2