summaryrefslogtreecommitdiff
path: root/obnamlib/fmt_ga/client.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2015-08-20 21:48:31 +0200
committerLars Wirzenius <liw@liw.fi>2015-08-20 21:48:31 +0200
commit3305308413053f3ed6b9264ac21e4bd8ccc19284 (patch)
tree0c8b17166143fa79f531d8b2ce7a33527ad536a4 /obnamlib/fmt_ga/client.py
parentcdbdd7b8d001a7fb7dab492d7cd870b93473cb41 (diff)
downloadobnam-3305308413053f3ed6b9264ac21e4bd8ccc19284.tar.gz
Avoid calling _require_file_exists in get_file_chunk_ids
Diffstat (limited to 'obnamlib/fmt_ga/client.py')
-rw-r--r--obnamlib/fmt_ga/client.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/obnamlib/fmt_ga/client.py b/obnamlib/fmt_ga/client.py
index 00c1cd3f..5018e182 100644
--- a/obnamlib/fmt_ga/client.py
+++ b/obnamlib/fmt_ga/client.py
@@ -293,10 +293,15 @@ class GAClient(object):
def get_file_chunk_ids(self, gen_number, filename):
self._load_data()
- self._require_file_exists(gen_number, filename)
generation = self._lookup_generation_by_gen_number(gen_number)
metadata = generation.get_file_metadata()
- return metadata.get_file_chunk_ids(filename)
+ result = metadata.get_file_chunk_ids(filename)
+ if result is None:
+ raise obnamlib.RepositoryFileDoesNotExistInGeneration(
+ client_name=self._client_name,
+ genspec=gen_number,
+ filename=filename)
+ return result
def append_file_chunk_id(self, gen_number, filename, chunk_id):
self._load_data()
@@ -648,7 +653,7 @@ class GAFileMetadata(object):
chunk_ids = dir_obj.get_file_chunk_ids(basename)
return chunk_ids
else:
- return []
+ return None
def append_file_chunk_id(self, filename, chunk_id):
if filename in self._added_files: