packaging-check-invariants: check if 'component' is in 'branch' before using it
Sometimes, we need to import and modify packages from Debian. To make the initial review easier, an apertis/v202* branch is created from the debian one, then a merge request is created against it adding debian/apertis/* files. During the review, the apertis branch doesn't have any debian/apertis/* files and the dashboard fails with:
Traceback (most recent call last):
File "/builds/infrastructure/dashboard/./bin/packaging-check-invariants", line 857, in <module>
checker.check_git_and_obs_versions(package)
File "/builds/infrastructure/dashboard/./bin/packaging-check-invariants", line 271, in check_git_and_obs_versions
component = branch.component
^^^^^^^^^^^^^^^^
File "/builds/infrastructure/dashboard/./bin/packaging-check-invariants", line 79, in __getattr__
item = super(DictWrapper, self).__getitem__(attr)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'component'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/builds/infrastructure/dashboard/./bin/packaging-check-invariants", line 867, in <module>
raise Error(package.name) from e
See: pkg/opencv!2 (comment 129850)
Signed-off-by: Dylan Aïssi dylan.aissi@collabora.com