diff --git a/pungi/errors.py b/pungi/errors.py new file mode 100644 index 00000000..093c2c83 --- /dev/null +++ b/pungi/errors.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Library General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . + + +class UnsignedPackagesError(RuntimeError): + """Raised when package set fails to find a properly signed copy of an + RPM.""" + + pass diff --git a/pungi/phases/pkgset/pkgsets.py b/pungi/phases/pkgset/pkgsets.py index 7d39d8c3..d4320865 100644 --- a/pungi/phases/pkgset/pkgsets.py +++ b/pungi/phases/pkgset/pkgsets.py @@ -33,10 +33,7 @@ from kobo.threads import WorkerThread, ThreadPool import pungi.wrappers.kojiwrapper from pungi.util import pkg_is_srpm, copy_all from pungi.arch import get_valid_arches, is_excluded - - -class UnsignedPackagesError(RuntimeError): - pass +from pungi.errors import UnsignedPackagesError class ExtendedRpmWrapper(kobo.pkgset.SimpleRpmWrapper): diff --git a/pungi/scripts/pungi_koji.py b/pungi/scripts/pungi_koji.py index 2a08840f..1e631718 100644 --- a/pungi/scripts/pungi_koji.py +++ b/pungi/scripts/pungi_koji.py @@ -21,6 +21,7 @@ from six.moves import shlex_quote from pungi.phases import PHASES_NAMES from pungi import get_full_version, util +from pungi.errors import UnsignedPackagesError # force C locales @@ -335,7 +336,7 @@ def main(): latest_link_status=latest_link_status, latest_link_components=latest_link_components, ) - except pungi.phases.pkgset.pkgsets.UnsignedPackagesError: + except UnsignedPackagesError: # There was an unsigned package somewhere. It is not safe to reuse any # package set from this compose (since we could leak the unsigned # package). Let's make sure all reuse files are deleted.