From 24e35ce738e242a9e97790900afc2dbd85adddbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Kobli=C5=BEek?= Date: Mon, 19 Dec 2016 10:26:35 +0100 Subject: [PATCH] Team upload. * Team upload. * Patch-out upper constraints of SQLAlchemy * Fixed SqlAlchemy worker model (Closes: #846749) Change-Id: I8e643a475836ef2cecb77276005084de9bdbf906 --- debian/changelog | 11 ++++++-- debian/patches/allow_newer_sqlalchemy.patch | 15 +++++++++++ debian/patches/fix-worker-model.patch | 29 +++++++++++++++++++++ debian/patches/series | 2 ++ 4 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 debian/patches/allow_newer_sqlalchemy.patch create mode 100644 debian/patches/fix-worker-model.patch diff --git a/debian/changelog b/debian/changelog index b2f0cee50..ed9f4bb40 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,15 @@ -cinder (2:9.0.0-3) UNRELEASED; urgency=medium +cinder (2:9.0.0-3) unstable; urgency=medium + * Team upload. + + [ Ondřej Nový ] * Bumped debhelper compat version to 10 - -- Ondřej Nový Wed, 23 Nov 2016 23:48:23 +0100 + [ Ondřej Kobližek ] + * Patch-out upper constraints of SQLAlchemy + * Fixed SqlAlchemy worker model (Closes: #846749) + + -- Ondřej Kobližek Mon, 19 Dec 2016 10:23:09 +0100 cinder (2:9.0.0-2) unstable; urgency=medium diff --git a/debian/patches/allow_newer_sqlalchemy.patch b/debian/patches/allow_newer_sqlalchemy.patch new file mode 100644 index 000000000..5d6a35dca --- /dev/null +++ b/debian/patches/allow_newer_sqlalchemy.patch @@ -0,0 +1,15 @@ +Description: allow newer sqlalchemy +Forwarded: not-needed +Author: Ondřej Kobližek + +--- a/requirements.txt ++++ b/requirements.txt +@@ -50,7 +50,7 @@ + rtslib-fb>=2.1.41 # Apache-2.0 + simplejson>=2.2.0 # MIT + six>=1.9.0 # MIT +-SQLAlchemy<1.1.0,>=1.0.10 # MIT ++SQLAlchemy>=1.0.10 # MIT + sqlalchemy-migrate>=0.9.6 # Apache-2.0 + stevedore>=1.16.0 # Apache-2.0 + suds-jurko>=0.6 # LGPLv3+ diff --git a/debian/patches/fix-worker-model.patch b/debian/patches/fix-worker-model.patch new file mode 100644 index 000000000..93112184e --- /dev/null +++ b/debian/patches/fix-worker-model.patch @@ -0,0 +1,29 @@ +Description: Make workers ORM compatible with SQLAlchemy 1.1.4 + We don't currently support SQLAlchemy 1.1.4, but in preparation of the + day we do we can start making simple changes that will facilitate the + transition. + . + In SQLAlchemy 1.1 the .autoincrement directive is no longer implicitly + enabled for a composite primary key column, so the id field in the + workers ORM class will no longer be set as autoincrement, which means + that when creating a worker we will not be updating the id field of the + instance and it will left as None in memory while it is properly set in + the DB. + . + This patch resolves this issue by defining the id field as an auto + increment field explicitly instead of relying on the implicit definition + exiting in SQLAlchemy 1.0. +Origin: https://review.openstack.org/#/c/413132/ +Author: Gorka Eguileor + +--- a/cinder/db/sqlalchemy/models.py ++++ b/cinder/db/sqlalchemy/models.py +@@ -843,7 +843,7 @@ + onupdate=timeutils.utcnow) + + # Id added for convenience and speed on some operations +- id = Column(Integer, primary_key=True) ++ id = Column(Integer, primary_key=True, autoincrement=True) + + # Type of the resource we are working on (Volume, Snapshot, Backup) it must + # match the Versioned Object class name. diff --git a/debian/patches/series b/debian/patches/series index d84441263..930892319 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,5 @@ no-zfssa-tests.patch install-missing-files.patch remove-zfssa-from-opts.py.patch +fix-worker-model.patch +allow_newer_sqlalchemy.patch