From a0429a94ee5c9720dc363b2620c5f8b1d1ac2357 Mon Sep 17 00:00:00 2001 From: Rick Harris Date: Thu, 21 Feb 2013 23:30:39 +0000 Subject: [PATCH] Migration 146: Execute delete call. The original code constructed but did not execute the call to delete the availability zone metadata records. The fix is to call `execute`. Change-Id: I3a5e2e7fd6e96b66b2073a35b55eec2002c6ae58 --- nova/tests/test_migrations.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nova/tests/test_migrations.py b/nova/tests/test_migrations.py index 2a963290..7c75a64e 100644 --- a/nova/tests/test_migrations.py +++ b/nova/tests/test_migrations.py @@ -561,6 +561,13 @@ class TestNovaMigrations(BaseMigrationTestCase, CommonTestsMixIn): aggregate_md.c.aggregate_id == data['id']).execute().first() self.assertEqual(data['availability_zone'], md['value']) + def _post_downgrade_146(self, engine): + # Downgrade should delete availability_zone aggregate_metadata entries + aggregate_md = get_table(engine, 'aggregate_metadata') + num_azs = aggregate_md.count().where( + aggregate_md.c.key == 'availability_zone').execute().scalar() + self.assertEqual(0, num_azs) + # migration 147, availability zone transition for services def _pre_upgrade_147(self, engine): az = 'test_zone'