Move UnsignedPackagesError to a separate file

This file can contain all Pungi specific exceptions.

It should also fix an issue encountered on Python 2.7:

    AttributeError: 'module' object has no attribute 'pkgsets'

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2021-02-02 10:59:08 +01:00 committed by lsedlar
parent daa0ca6106
commit 44f7eff1b7
3 changed files with 23 additions and 5 deletions

View file

@ -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.