Capture exceptions when getting `image_url`
Currently we get `image_url` via testcloud.util, but testcloud.util
may raise unexpected exceptions because of hidden defects. Hence, we
capture the exceptions from tmt side to ensure it is user friendly.
@@ -266,6 +266,7 @@ class GuestTestcloud(tmt.GuestSsh):
assert testcloud is not None
# Plain name match means we want the latest release
+ try:
if name == 'fedora':
url = testcloud.util.get_fedora_image_url("latest", self.arch)
elif name == 'fedora-coreos':
@@ -299,6 +300,8 @@ class GuestTestcloud(tmt.GuestSsh):
matched_debian.group(2), self.arch)
elif 'rawhide' in name:
url = testcloud.util.get_fedora_image_url("rawhide", self.arch)
+ except Exception as error:
+ raise ProvisionError("Could not get image url.") from error
if not url:
raise ProvisionError(f"Could not map '{name}' to compose.")
