From: Thomas Goirand Date: Thu, 13 Mar 2014 16:35:46 +0000 (+0800) Subject: Added SQLA 0.9 patch. X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=763bd738d267834824d59579371fcaa918c7e8e8;p=openstack-build%2Fceilometer-build.git Added SQLA 0.9 patch. Change-Id: If03b99ed2cf0422298f8e318abe1860285b6a3df Rewritten-From: 5b6c693dc6e4a634f8a1a2cbc55a4e64ade3d0a3 --- diff --git a/xenial/debian/patches/Make_ceilometer_work_with_sqla_0.9.x.patch b/xenial/debian/patches/Make_ceilometer_work_with_sqla_0.9.x.patch new file mode 100644 index 0000000..4f115f2 --- /dev/null +++ b/xenial/debian/patches/Make_ceilometer_work_with_sqla_0.9.x.patch @@ -0,0 +1,44 @@ +Description: Make ceilometer work with sqla 0.9.x + Ceilometer's migration 028 makes some very specific assumptions about sqla + data structures and exception paths, which are not true in sqla 0.9.x. In 0.8 + you were shielded from errors on drop by sqla, but in 0.9 you get raw + exceptions from the db layer thrown all the way up, which causes a failure + condition when trying to delete the non existent alembic table. + . + We can get basically the same behavior as before by using the checkfirst=True + parameter on table definitions. This will actually ensure that we get the + table in question, and get the NoSuchTableError when we expect it. +Author: Sean Dague +Date: Mon, 10 Mar 2014 22:06:32 +0000 (-0400) +X-Git-Url: https://review.openstack.org/gitweb?p=openstack%2Fceilometer.git;a=commitdiff_plain;h=63f6d6af77d5fe7227b074ddc3e1594a424873e6 +Origin: upstream, https://review.openstack.org/#/c/79482/ +Change-Id: Ida33a3030fb03c2f3eeed9f129fcc0063a7b7c4b + +diff --git a/ceilometer/storage/sqlalchemy/migrate_repo/versions/028_alembic_migrations.py b/ceilometer/storage/sqlalchemy/migrate_repo/versions/028_alembic_migrations.py +index b527692..567620c 100644 +--- a/ceilometer/storage/sqlalchemy/migrate_repo/versions/028_alembic_migrations.py ++++ b/ceilometer/storage/sqlalchemy/migrate_repo/versions/028_alembic_migrations.py +@@ -21,7 +21,10 @@ import sqlalchemy as sa + def get_alembic_version(meta): + """Return Alembic version or None if no Alembic table exists.""" + try: +- a_ver = sa.Table('alembic_version', meta, autoload=True) ++ a_ver = sa.Table( ++ 'alembic_version', ++ meta, ++ autoload=True) + return sa.select([a_ver.c.version_num]).scalar() + except sa.exc.NoSuchTableError: + return None +@@ -29,7 +32,10 @@ def get_alembic_version(meta): + + def delete_alembic(meta): + try: +- sa.Table('alembic_version', meta, autoload=True).drop() ++ sa.Table( ++ 'alembic_version', ++ meta, ++ autoload=True).drop(checkfirst=True) + except sa.exc.NoSuchTableError: + pass + diff --git a/xenial/debian/patches/series b/xenial/debian/patches/series index 970683f..37f3197 100644 --- a/xenial/debian/patches/series +++ b/xenial/debian/patches/series @@ -1 +1,2 @@ removes-sqla0.8-restrictions.patch +Make_ceilometer_work_with_sqla_0.9.x.patch