From b5dbcbc6ef45a4107502d56a23c895c27d614276 Mon Sep 17 00:00:00 2001 From: Renata <rvaderna@openlawlib.org> Date: Thu, 10 Feb 2022 21:47:48 +0100 Subject: [PATCH 1/2] Return an empty list of targets if the targets folder does not exist --- taf/updater/handlers.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/taf/updater/handlers.py b/taf/updater/handlers.py index 6adef7944..707df086b 100644 --- a/taf/updater/handlers.py +++ b/taf/updater/handlers.py @@ -285,9 +285,12 @@ def ensure_not_changed(self, metadata_filename): ) def get_current_targets(self): - return self.validation_auth_repo.list_files_at_revision( - self.current_commit, "targets" - ) + try: + return self.validation_auth_repo.list_files_at_revision( + self.current_commit, "targets" + ) + except GitError: + return [] def get_mirrors(self, _file_type, _file_path): # pylint: disable=unused-argument From e0e600f0d9bf976e9c96d0d731a702ff65df371c Mon Sep 17 00:00:00 2001 From: Renata <rvaderna@openlawlib.org> Date: Thu, 10 Feb 2022 22:16:03 +0100 Subject: [PATCH 2/2] Updated changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30f1fedc0..fbe0b6229 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,8 +17,10 @@ and this project adheres to [Semantic Versioning][semver]. ### Fixed +- Update handler fix: return an empty list of targets if the targets folder does not exist ([208]) - pytest works when taf installed via wheel ([200]) +[208]: https://github.com/openlawlibrary/taf/pull/208 [207]: https://github.com/openlawlibrary/taf/pull/207 [200]: https://github.com/openlawlibrary/taf/pull/200