From c4c28814e06fc0f90f7679ef9b1831cd3d89f692 Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Tue, 20 Oct 2020 10:54:17 +0200 Subject: build: unbreak JSON serializer on failed builds Commit 3fa5a236b4d8a31a57e14cbb482e664d5cc0111c converted status consts into Enum. But not completely - this fix gets it done properly. Also fixed tests. Change-Id: Ifdacf62cd4b99c452bd09de7c6cde6fbee75560d --- kolla/tests/test_build.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'kolla/tests') diff --git a/kolla/tests/test_build.py b/kolla/tests/test_build.py index 2812e115e..00bdd6d32 100644 --- a/kolla/tests/test_build.py +++ b/kolla/tests/test_build.py @@ -646,11 +646,11 @@ class KollaWorkerTest(base.TestCase): def test_summary(self): kolla = build.KollaWorker(self.conf) kolla.images = self.images - kolla.image_statuses_good['good'] = None - kolla.image_statuses_bad['bad'] = None - kolla.image_statuses_unmatched['unmatched'] = None + kolla.image_statuses_good['good'] = build.Status.BUILT + kolla.image_statuses_bad['bad'] = build.Status.ERROR + kolla.image_statuses_unmatched['unmatched'] = build.Status.UNMATCHED results = kolla.summary() - self.assertIsNone(results['failed'][0]['status']) + self.assertEqual('error', results['failed'][0]['status']) @mock.patch('shutil.copytree') def test_work_dir(self, copytree_mock): -- cgit v1.2.3