From cb740f063e1bc0eab1616418604fe5cc2f3d8ec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Thu, 2 Nov 2017 16:08:41 +0100 Subject: [PATCH] Report missing module dependencies earlier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: https://pagure.io/pungi/issue/768 Signed-off-by: Lubomír Sedlář --- pungi/phases/gather/__init__.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pungi/phases/gather/__init__.py b/pungi/phases/gather/__init__.py index 3b96abcb..81cd9742 100644 --- a/pungi/phases/gather/__init__.py +++ b/pungi/phases/gather/__init__.py @@ -61,6 +61,21 @@ class GatherPhase(PhaseBase): self.manifest.compose.date = self.compose.compose_date self.manifest.compose.respin = self.compose.compose_respin + def validate(self): + errors = [] + try: + super(GatherPhase, self).validate() + except ValueError as exc: + errors = exc.message.split('\n') + + if self.compose.conf['gather_source'] == 'module': + from pungi.phases.pkgset.sources import source_koji + if not source_koji.WITH_MODULES: + errors.append('Modular compose requires pdc_client and modulemd packages.') + + if errors: + raise ValueError('\n'.join(errors)) + def _write_manifest(self): self.compose.log_info("Writing RPM manifest: %s" % self.manifest_file) self.manifest.dump(self.manifest_file)