Skip to content
Snippets Groups Projects
Commit 672d5924 authored by Emanuele Aina's avatar Emanuele Aina
Browse files

packaging-check-invariants: Avoid crashing on OBS-only packages


If a package only appears on OBS the dashboard fails with an exception:

    Traceback (most recent call last):
      File "/builds/-RogsxNE/0/infrastructure/dashboard/./bin/packaging-check-invariants", line 854, in <module>
        checker.check_git_and_obs_versions(package)
      File "/builds/-RogsxNE/0/infrastructure/dashboard/./bin/packaging-check-invariants", line 238, in check_git_and_obs_versions
        if package.git.default_branch:
           ^^^^^^^^^^^
      File "/builds/-RogsxNE/0/infrastructure/dashboard/./bin/packaging-check-invariants", line 79, in __getattr__
        item = super(DictWrapper, self).__getitem__(attr)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    KeyError: 'git'

Signed-off-by: Emanuele Aina's avatarEmanuele Aina <emanuele.aina@collabora.com>
parent a85cf1f8
No related branches found
No related tags found
1 merge request!208packaging-check-invariants: Avoid crashing on OBS-only packages
Pipeline #697668 canceled
......@@ -235,7 +235,7 @@ class InvariantChecker:
if not set(package).intersection({"git", "obs", "published"}):
return
if "published" not in package:
if package.git.default_branch:
if "git" in package and package.git.default_branch:
default_branch = package.git.default_branch
channels = set(package.git.branches).intersection(self.data.channels)
active_channels = [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment