From 163db3f2b8af5aa4a8b30f859ce97ddc17d97d02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 26 Aug 2016 12:39:55 +0200 Subject: [PATCH] Let generated links for 'unittest' backend actually be a valid link. --- pillar/api/file_storage.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pillar/api/file_storage.py b/pillar/api/file_storage.py index 2de8f43d..0a4f6ca3 100644 --- a/pillar/api/file_storage.py +++ b/pillar/api/file_storage.py @@ -321,8 +321,10 @@ def generate_link(backend, file_path, project_id=None, is_public=False): if backend == 'cdnsun': return hash_file_path(file_path, None) if backend == 'unittest': - return md5(file_path).hexdigest() + return 'https://unit.test/%s' % md5(file_path).hexdigest() + log.warning('generate_link(): Unknown backend %r, returning empty string as new link.', + backend) return ''