From 2cbd75803a017b89236716d24409c997271a87b3 Mon Sep 17 00:00:00 2001 From: Haibo Lin Date: Thu, 7 Nov 2019 16:11:42 +0800 Subject: [PATCH] gather: Do not write metadata if gather phase skipped Signed-off-by: Haibo Lin --- pungi/phases/gather/__init__.py | 3 ++- tests/test_gather_phase.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pungi/phases/gather/__init__.py b/pungi/phases/gather/__init__.py index fe9d25a7..444a8c2c 100644 --- a/pungi/phases/gather/__init__.py +++ b/pungi/phases/gather/__init__.py @@ -113,8 +113,9 @@ class GatherPhase(PhaseBase): self.pkgset_phase.package_sets, manifest=self.manifest) - def stop(self): self._write_manifest() + + def stop(self): super(GatherPhase, self).stop() diff --git a/tests/test_gather_phase.py b/tests/test_gather_phase.py index c82a8ef5..95d5eef6 100644 --- a/tests/test_gather_phase.py +++ b/tests/test_gather_phase.py @@ -911,7 +911,7 @@ class TestGatherPhase(helpers.PungiTestCase): phase.stop() self.assertEqual(gather_wrapper.call_args_list, []) - self.assertTrue(os.path.isfile(os.path.join(self.topdir, 'compose', 'metadata', 'rpms.json'))) + self.assertFalse(os.path.isfile(os.path.join(self.topdir, 'compose', 'metadata', 'rpms.json'))) def test_validates_wrong_requiring_variant(self): pkgset_phase = mock.Mock()