diff options
author | Antti Kokko <antti.kokko@qt.io> | 2019-02-11 16:05:40 +0200 |
---|---|---|
committer | Antti Kokko <antti.kokko@qt.io> | 2019-02-12 11:08:05 +0000 |
commit | e86728cf3de8fafb43c3e1ed39a989a8191f6137 (patch) | |
tree | e3d7d038585b77b20ae1724b4a13c5e99fa86102 /packaging-tools/archiveresolver.py | |
parent | ef06b4c9f7ea446d0f1f0837c12b2bdf80dcc4c6 (diff) |
Fix archiveresolver logic when handling unavailable resources
Raise exception if we have valid url but the resource is
unavailable instead of trying to compose a valid url.
Change-Id: I8f069a0327e2717bb0b0257f247be984091fe269
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'packaging-tools/archiveresolver.py')
-rw-r--r-- | packaging-tools/archiveresolver.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/packaging-tools/archiveresolver.py b/packaging-tools/archiveresolver.py index 3c7d61239..837334748 100644 --- a/packaging-tools/archiveresolver.py +++ b/packaging-tools/archiveresolver.py @@ -44,6 +44,7 @@ import os import sys import bldinstallercommon import pkg_constants +from urlparse import urlparse SERVER_NAMESPACE = 'ArchiveRemoteLocation' PACKAGE_REMOTE_LOCATION_RELEASE = 'release' @@ -160,6 +161,10 @@ class ArchiveLocationResolver: res = bldinstallercommon.is_content_url_valid(archive_uri) if res: return archive_uri + else: + parts = urlparse(archive_uri) + if parts.scheme and parts.netloc: + raise RuntimeError("Url: [%s] points to valid location but it is inaccessible." % (archive_uri)) # 4. try to compose full URL temp = self.server_url_by_name(server_name) if not temp.endswith('/') and not archive_uri.startswith('/'): |