Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't fail on missing metadata #50

Merged
merged 2 commits into from
Feb 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions obs_img_utils/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,11 +407,22 @@ def _set_image_version(self):
self._image_release = version.obs_build

@retry(DownloadMetadataFileExceptionOBS)
def get_image_packages_metadata(self):
def get_image_packages_metadata(self) -> dict:
has_error = None
result_packages = {}
try:
result_packages = self.parse_report_file()
except DownloadMetadataFileExceptionOBS:
result_packages = self.parse_packages_file()
try:
result_packages = self.parse_packages_file()
except DownloadMetadataFileExceptionOBS as issue:
has_error = issue

if self.conditions and has_error:
self.log_callback.error(
f'Cannot verify {self.conditions} without metadata'
)
raise OBSImageConditionsException(has_error)

return result_packages

Expand Down
Loading