Merge lp:~zulcss/nova/sqlalchemy-fixes-0.8 into lp:~ubuntu-server-dev/nova/havana
- sqlalchemy-fixes-0.8
- Merge into havana
Proposed by
Chuck Short
Status: | Merged |
---|---|
Approved by: | Adam Gandelman |
Approved revision: | 600 |
Merged at revision: | 600 |
Proposed branch: | lp:~zulcss/nova/sqlalchemy-fixes-0.8 |
Merge into: | lp:~ubuntu-server-dev/nova/havana |
Diff against target: |
298 lines (+82/-162) 6 files modified
debian/changelog (+11/-0) debian/patches/avoid_requirements_cheetah.patch (+0/-21) debian/patches/fix-requirements.patch (+7/-6) debian/patches/fix-sqlalchemy-0.7.9-usage.patch (+0/-133) debian/patches/remove-deprecated-sqlalchemy-option.patch (+63/-0) debian/patches/series (+1/-2) |
To merge this branch: | bzr merge lp:~zulcss/nova/sqlalchemy-fixes-0.8 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Server Developers | Pending | ||
Review via email: mp+177615@code.launchpad.net |
Commit message
Description of the change
sqlalchemy 0.8 fixes.
To post a comment you must log in.
- 600. By Chuck Short
-
Update patch
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'debian/changelog' |
2 | --- debian/changelog 2013-07-19 19:03:40 +0000 |
3 | +++ debian/changelog 2013-07-30 18:36:36 +0000 |
4 | @@ -1,3 +1,14 @@ |
5 | +nova (1:2013.2.a2367.gb404bfd-0ubuntu1) UNRELEASED; urgency=low |
6 | + |
7 | + * New usptream release. |
8 | + * debian/patches/avoid_requirements_cheetah.patch: Dropped |
9 | + * debian/patches/fix-sqlalchemy-0.7.9-usage.patch: Dropped |
10 | + * debian/patches/fix-requirements.patch: Refreshed. |
11 | + * debian/patches/remove-deprecated-sqlalchemy-option.patch: Remove |
12 | + deprecated option with sqlalchemy. |
13 | + |
14 | + -- Chuck Short <zulcss@ubuntu.com> Tue, 30 Jul 2013 13:05:37 +0000 |
15 | + |
16 | nova (1:2013.2~b2-0ubuntu2) saucy; urgency=low |
17 | |
18 | * debian/control: Fix python-sqlalchemy dependency. |
19 | |
20 | === removed file 'debian/patches/avoid_requirements_cheetah.patch' |
21 | --- debian/patches/avoid_requirements_cheetah.patch 2013-06-20 01:03:56 +0000 |
22 | +++ debian/patches/avoid_requirements_cheetah.patch 1970-01-01 00:00:00 +0000 |
23 | @@ -1,21 +0,0 @@ |
24 | -From: Adam Gandelman <adamg@ubuntu.com> |
25 | -Date: Wed May 29 12:13:38 PDT 2013 |
26 | -Subject: Avoid Cheetah dependency. |
27 | -Ubuntu-bug: https://bugs.launchpad.net/ubuntu/+source/cheetah/+bug/1183634 |
28 | -Until Cheetah's dependencies have been MIR'd into Main, avoid it |
29 | -being listed in requirements.txt and requiring it as a runtime |
30 | -dependency. |
31 | - |
32 | - |
33 | -Index: nova-src/requirements.txt |
34 | -=================================================================== |
35 | ---- nova-src.orig/requirements.txt 2013-06-19 18:03:08.469447733 -0700 |
36 | -+++ nova-src/requirements.txt 2013-06-19 18:03:08.465447733 -0700 |
37 | -@@ -1,7 +1,6 @@ |
38 | - d2to1>=0.2.10,<0.3 |
39 | - pbr>=0.5.16,<0.6 |
40 | - SQLAlchemy>=0.7.8,<0.7.99 |
41 | --Cheetah>=2.4.4 |
42 | - amqplib>=0.6.1 |
43 | - anyjson>=0.2.4 |
44 | - argparse |
45 | |
46 | === modified file 'debian/patches/fix-requirements.patch' |
47 | --- debian/patches/fix-requirements.patch 2013-07-16 23:03:19 +0000 |
48 | +++ debian/patches/fix-requirements.patch 2013-07-30 18:36:36 +0000 |
49 | @@ -1,15 +1,16 @@ |
50 | -diff -Naurp nova-2013.2.a2069.gf8d3ff8.orig/requirements.txt nova-2013.2.a2069.gf8d3ff8/requirements.txt |
51 | ---- nova-2013.2.a2069.gf8d3ff8.orig/requirements.txt 2013-07-16 19:00:34.034600924 -0400 |
52 | -+++ nova-2013.2.a2069.gf8d3ff8/requirements.txt 2013-07-16 19:01:26.494602175 -0400 |
53 | -@@ -1,6 +1,6 @@ |
54 | +diff -Naurp nova-2013.2.a2367.gb404bfd.orig/requirements.txt nova-2013.2.a2367.gb404bfd/requirements.txt |
55 | +--- nova-2013.2.a2367.gb404bfd.orig/requirements.txt 2013-07-30 13:01:25.000000000 +0000 |
56 | ++++ nova-2013.2.a2367.gb404bfd/requirements.txt 2013-07-30 13:51:46.198948311 +0000 |
57 | +@@ -1,7 +1,6 @@ |
58 | d2to1>=0.2.10,<0.3 |
59 | pbr>=0.5.16,<0.6 |
60 | -SQLAlchemy>=0.7.8,<0.7.99 |
61 | +-Cheetah>=2.4.4 |
62 | +SQLAlchemy>=0.7.8,<0.8.99 |
63 | amqplib>=0.6.1 |
64 | anyjson>=0.2.4 |
65 | argparse |
66 | -@@ -20,14 +20,13 @@ paramiko |
67 | +@@ -21,14 +20,13 @@ paramiko |
68 | pyasn1 |
69 | Babel>=0.9.6 |
70 | iso8601>=0.1.4 |
71 | @@ -20,7 +21,7 @@ |
72 | python-glanceclient>=0.9.0 |
73 | python-keystoneclient>=0.2.0 |
74 | six |
75 | - stevedore>=0.9 |
76 | + stevedore>=0.10 |
77 | -websockify<0.4 |
78 | pyparsing>=1.5.7,<2.0 # order-dependent python-quantumclient req, bug 1191866 |
79 | |
80 | |
81 | === removed file 'debian/patches/fix-sqlalchemy-0.7.9-usage.patch' |
82 | --- debian/patches/fix-sqlalchemy-0.7.9-usage.patch 2013-07-16 15:16:30 +0000 |
83 | +++ debian/patches/fix-sqlalchemy-0.7.9-usage.patch 1970-01-01 00:00:00 +0000 |
84 | @@ -1,133 +0,0 @@ |
85 | -Description: Fix tests failing with sqlalachemy 0.7.9 |
86 | -Author: Chuck Short <zulcss@ubuntu.com> |
87 | -Fowarded: No |
88 | -diff -Naurp nova-2013.2.a2028.gd612ed9.orig/nova/db/sqlalchemy/migrate_repo/versions/186_new_bdm_format.py nova-2013.2.a2028.gd612ed9/nova/db/sqlalchemy/migrate_repo/versions/186_new_bdm_format.py |
89 | ---- nova-2013.2.a2028.gd612ed9.orig/nova/db/sqlalchemy/migrate_repo/versions/186_new_bdm_format.py 2013-07-16 09:01:23.000000000 -0400 |
90 | -+++ nova-2013.2.a2028.gd612ed9/nova/db/sqlalchemy/migrate_repo/versions/186_new_bdm_format.py 2013-07-16 10:49:47.661898868 -0400 |
91 | -@@ -249,12 +249,9 @@ def _downgrade_bdm_v2(meta, bdm_table): |
92 | - (bdm_table.c.source_type == 'blank') |
93 | - ).order_by(bdm_table.c.id.asc()) |
94 | - |
95 | -- blanks = [ |
96 | -- dict(zip(('id', 'source', 'format'), row)) |
97 | -- for row in bdm_q.execute().fetchall() |
98 | -- ] |
99 | -+ blanks = [dict(row) for row in bdm_q.execute().fetchall()] |
100 | - |
101 | -- swap = [dev for dev in blanks if dev['format'] == 'swap'] |
102 | -+ swap = [dev for dev in blanks if dev['guest_format'] == 'swap'] |
103 | - assert len(swap) < 2 |
104 | - ephemerals = [dev for dev in blanks if dev not in swap] |
105 | - |
106 | -diff -Naurp nova-2013.2.a2028.gd612ed9.orig/nova/db/sqlalchemy/types.py nova-2013.2.a2028.gd612ed9/nova/db/sqlalchemy/types.py |
107 | ---- nova-2013.2.a2028.gd612ed9.orig/nova/db/sqlalchemy/types.py 2013-07-16 09:01:23.000000000 -0400 |
108 | -+++ nova-2013.2.a2028.gd612ed9/nova/db/sqlalchemy/types.py 2013-07-16 10:49:40.465898696 -0400 |
109 | -@@ -25,7 +25,14 @@ from nova import utils |
110 | - |
111 | - class IPAddress(types.TypeDecorator): |
112 | - """An SQLAlchemy type representing an IP-address.""" |
113 | -- impl = types.String(39).with_variant(postgresql.INET(), 'postgresql') |
114 | -+ |
115 | -+ impl = types.String |
116 | -+ |
117 | -+ def load_dialect_impl(self, dialect): |
118 | -+ if dialect.name == 'postgresql': |
119 | -+ return dialect.type_descriptor(postgresql.INET()) |
120 | -+ else: |
121 | -+ return dialect.type_descriptor(types.String(39)) |
122 | - |
123 | - def process_bind_param(self, value, dialect): |
124 | - """Process/Formats the value before insert it into the db.""" |
125 | -@@ -40,7 +47,14 @@ class IPAddress(types.TypeDecorator): |
126 | - |
127 | - class CIDR(types.TypeDecorator): |
128 | - """An SQLAlchemy type representing a CIDR definition.""" |
129 | -- impl = types.String(43).with_variant(postgresql.INET(), 'postgresql') |
130 | -+ |
131 | -+ impl = types.String |
132 | -+ |
133 | -+ def load_dialect_impl(self, dialect): |
134 | -+ if dialect.name == 'postgresql': |
135 | -+ return dialect.type_descriptor(postgresql.INET()) |
136 | -+ else: |
137 | -+ return dialect.type_descriptor(types.String(43)) |
138 | - |
139 | - def process_bind_param(self, value, dialect): |
140 | - """Process/Formats the value before insert it into the db.""" |
141 | -diff -Naurp nova-2013.2.a2028.gd612ed9.orig/nova/tests/db/test_migrations.py nova-2013.2.a2028.gd612ed9/nova/tests/db/test_migrations.py |
142 | ---- nova-2013.2.a2028.gd612ed9.orig/nova/tests/db/test_migrations.py 2013-07-16 09:01:23.000000000 -0400 |
143 | -+++ nova-2013.2.a2028.gd612ed9/nova/tests/db/test_migrations.py 2013-07-16 10:49:47.661898868 -0400 |
144 | -@@ -46,6 +46,7 @@ import commands |
145 | - import ConfigParser |
146 | - import datetime |
147 | - import glob |
148 | -+import operator |
149 | - import os |
150 | - import urlparse |
151 | - import uuid |
152 | -@@ -64,6 +65,7 @@ from nova.openstack.common import log as |
153 | - from nova.openstack.common import timeutils |
154 | - from nova.openstack.common import uuidutils |
155 | - from nova import test |
156 | -+from nova.tests import matchers |
157 | - from nova import utils |
158 | - import nova.virt.baremetal.db.sqlalchemy.migrate_repo |
159 | - |
160 | -@@ -1466,7 +1468,7 @@ class TestNovaMigrations(BaseMigrationTe |
161 | - self._unique_constraint_check_migrate_185(engine) |
162 | - |
163 | - def _pre_upgrade_186(self, engine): |
164 | -- fake_instances = [ |
165 | -+ self.mig186_fake_instances = [ |
166 | - dict(uuid='mig186_uuid-1', image_ref='fake_image_1', |
167 | - root_device_name='/dev/vda'), |
168 | - dict(uuid='mig186_uuid-2', image_ref='', |
169 | -@@ -1475,7 +1477,7 @@ class TestNovaMigrations(BaseMigrationTe |
170 | - root_device_name='/dev/vda'), |
171 | - ] |
172 | - |
173 | -- fake_bdms = [ |
174 | -+ self.mig186_fake_bdms = [ |
175 | - # Instance 1 - image, volume and swap |
176 | - dict(instance_uuid='mig186_uuid-1', device_name='/dev/vdc', |
177 | - volume_id='fake_volume_1'), |
178 | -@@ -1497,11 +1499,11 @@ class TestNovaMigrations(BaseMigrationTe |
179 | - |
180 | - instances = db_utils.get_table(engine, 'instances') |
181 | - block_device = db_utils.get_table(engine, 'block_device_mapping') |
182 | -- engine.execute(instances.insert(), fake_instances) |
183 | -- for fake_bdm in fake_bdms: |
184 | -+ engine.execute(instances.insert(), self.mig186_fake_instances) |
185 | -+ for fake_bdm in self.mig186_fake_bdms: |
186 | - engine.execute(block_device.insert(), fake_bdm) |
187 | - |
188 | -- return fake_instances, fake_bdms |
189 | -+ return self.mig186_fake_instances, self.mig186_fake_bdms |
190 | - |
191 | - def _check_186(self, engine, data): |
192 | - block_device = db_utils.get_table(engine, 'block_device_mapping') |
193 | -@@ -1587,6 +1589,24 @@ class TestNovaMigrations(BaseMigrationTe |
194 | - self.assertEqual(bdm_3s[3].image_id, 'fake_image_2') |
195 | - self.assertEqual(bdm_3s[3].boot_index, 0) |
196 | - |
197 | -+ def _post_downgrade_186(self, engine): |
198 | -+ block_device = db_utils.get_table(engine, 'block_device_mapping') |
199 | -+ |
200 | -+ q = block_device.select().where( |
201 | -+ sqlalchemy.or_( |
202 | -+ block_device.c.instance_uuid == 'mig186_uuid-1', |
203 | -+ block_device.c.instance_uuid == 'mig186_uuid-2', |
204 | -+ block_device.c.instance_uuid == 'mig186_uuid-3'))\ |
205 | -+ .order_by(block_device.c.device_name.asc()) |
206 | -+ |
207 | -+ expected_bdms = sorted(self.mig186_fake_bdms, |
208 | -+ key=operator.itemgetter('device_name')) |
209 | -+ got_bdms = [bdm for bdm in q.execute()] |
210 | -+ |
211 | -+ self.assertEquals(len(expected_bdms), len(got_bdms)) |
212 | -+ for expected, got in zip(expected_bdms, got_bdms): |
213 | -+ self.assertThat(expected, matchers.IsSubDictOf(dict(got))) |
214 | -+ |
215 | - # addition of the vm instance groups |
216 | - def _check_no_group_instance_tables(self, engine): |
217 | - self.assertRaises(sqlalchemy.exc.NoSuchTableError, |
218 | |
219 | === added file 'debian/patches/remove-deprecated-sqlalchemy-option.patch' |
220 | --- debian/patches/remove-deprecated-sqlalchemy-option.patch 1970-01-01 00:00:00 +0000 |
221 | +++ debian/patches/remove-deprecated-sqlalchemy-option.patch 2013-07-30 18:36:36 +0000 |
222 | @@ -0,0 +1,63 @@ |
223 | +Description: Remove deprecated sqlalchemy assert_unicode. |
224 | +Author: Chuck Short <zulcss@ubuntu.com> |
225 | +Forwarded: Yes (https://review.openstack.org/#/c/39296/) |
226 | +diff -Naurp nova-2013.2.a2367.gb404bfd.orig/nova/db/sqlalchemy/migrate_repo/versions/203_make_user_quotas_key_and_value.py nova-2013.2.a2367.gb404bfd/nova/db/sqlalchemy/migrate_repo/versions/203_make_user_quotas_key_and_value.py |
227 | +--- nova-2013.2.a2367.gb404bfd.orig/nova/db/sqlalchemy/migrate_repo/versions/203_make_user_quotas_key_and_value.py 2013-07-30 13:01:25.000000000 +0000 |
228 | ++++ nova-2013.2.a2367.gb404bfd/nova/db/sqlalchemy/migrate_repo/versions/203_make_user_quotas_key_and_value.py 2013-07-30 13:44:02.410948311 +0000 |
229 | +@@ -35,7 +35,7 @@ def upgrade(migrate_engine): |
230 | + quota_usages = utils.get_table(migrate_engine, 'quota_usages') |
231 | + user_id = Column('user_id', |
232 | + String(length=255, convert_unicode=False, |
233 | +- assert_unicode=None, unicode_error=None, |
234 | ++ unicode_error=None, |
235 | + _warn_on_bytestring=False)) |
236 | + quota_usages.create_column(user_id) |
237 | + |
238 | +@@ -43,7 +43,7 @@ def upgrade(migrate_engine): |
239 | + db._SHADOW_TABLE_PREFIX + 'quota_usages') |
240 | + user_id = Column('user_id', |
241 | + String(length=255, convert_unicode=False, |
242 | +- assert_unicode=None, unicode_error=None, |
243 | ++ unicode_error=None, |
244 | + _warn_on_bytestring=False)) |
245 | + shadow_quota_usages.create_column(user_id) |
246 | + |
247 | +@@ -51,7 +51,7 @@ def upgrade(migrate_engine): |
248 | + reservations = utils.get_table(migrate_engine, 'reservations') |
249 | + user_id = Column('user_id', |
250 | + String(length=255, convert_unicode=False, |
251 | +- assert_unicode=None, unicode_error=None, |
252 | ++ unicode_error=None, |
253 | + _warn_on_bytestring=False)) |
254 | + reservations.create_column(user_id) |
255 | + |
256 | +@@ -59,7 +59,7 @@ def upgrade(migrate_engine): |
257 | + db._SHADOW_TABLE_PREFIX + 'reservations') |
258 | + user_id = Column('user_id', |
259 | + String(length=255, convert_unicode=False, |
260 | +- assert_unicode=None, unicode_error=None, |
261 | ++ unicode_error=None, |
262 | + _warn_on_bytestring=False)) |
263 | + shadow_reservations.create_column(user_id) |
264 | + |
265 | +@@ -83,17 +83,17 @@ def upgrade(migrate_engine): |
266 | + Column('deleted', Integer), |
267 | + Column('user_id', |
268 | + String(length=255, convert_unicode=False, |
269 | +- assert_unicode=None, unicode_error=None, |
270 | ++ unicode_error=None, |
271 | + _warn_on_bytestring=False), |
272 | + nullable=False), |
273 | + Column('project_id', |
274 | + String(length=255, convert_unicode=False, |
275 | +- assert_unicode=None, unicode_error=None, |
276 | ++ unicode_error=None, |
277 | + _warn_on_bytestring=False), |
278 | + nullable=False), |
279 | + Column('resource', |
280 | + String(length=255, convert_unicode=False, |
281 | +- assert_unicode=None, unicode_error=None, |
282 | ++ unicode_error=None, |
283 | + _warn_on_bytestring=False), |
284 | + nullable=False), |
285 | + Column('hard_limit', Integer, nullable=True), |
286 | |
287 | === modified file 'debian/patches/series' |
288 | --- debian/patches/series 2013-07-16 15:16:30 +0000 |
289 | +++ debian/patches/series 2013-07-30 18:36:36 +0000 |
290 | @@ -1,7 +1,6 @@ |
291 | # Ubuntu specific patches below here. Note these can be dropped eventually. |
292 | -avoid_requirements_cheetah.patch |
293 | path-to-the-xenhost.conf-fixup.patch |
294 | fix-docs-build-without-network.patch |
295 | fix-requirements.patch |
296 | -fix-sqlalchemy-0.7.9-usage.patch |
297 | avoid-failing-test.patch |
298 | +remove-deprecated-sqlalchemy-option.patch |