Skip to content

Commit

Permalink
Fix crash when listing latest backup
Browse files Browse the repository at this point in the history
A one-element list containing "None" was emitted rather than an empty
list.  Fix this bug and insert some assertions to make such defects
more perspicuous.
  • Loading branch information
Daniel Farina committed Sep 8, 2013
1 parent 6625744 commit 716ae18
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions wal_e/operator/s3_operator.py
Expand Up @@ -273,6 +273,8 @@ def database_s3_fetch(self, pg_cluster_dir, backup_name, pool_size):

# There must be exactly one qualifying backup at this point.
assert len(backups) == 1
assert backups[0] is not None

backup_info = backups[0]
layout.basebackup_tar_partition_directory(backup_info)

Expand Down
1 change: 0 additions & 1 deletion wal_e/worker/s3_worker.py
Expand Up @@ -540,7 +540,6 @@ def find_all(self, query):
all_backups = list(iter(self))

if not all_backups:
yield None
return

assert len(all_backups) > 0
Expand Down

0 comments on commit 716ae18

Please sign in to comment.