Skip to content

Commit

Permalink
Fix bug in S3Bucket.list
Browse files Browse the repository at this point in the history
  • Loading branch information
eterna2 committed Dec 27, 2019
1 parent e6781dd commit acb5af0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# `e2fyi.utils`

## v0.2.1

- Fixes:

- `S3Bucket.list` should properly yield all objects when `max_objects` is less or equal to `0`.

## v0.2.0

- New features:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![Coverage Status](https://coveralls.io/repos/github/e2fyi/py-utils/badge.svg?branch=master)](https://coveralls.io/github/e2fyi/py-utils?branch=master)
[![Documentation Status](https://readthedocs.org/projects/e2fyi-utils/badge/?version=latest)](https://e2fyi-utils.readthedocs.io/en/latest/?badge=latest)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Downloads](https://pepy.tech/badge/e2fyi-utils)](https://pepy.tech/project/e2fyi-utils)
[![Downloads](https://pepy.tech/badge/e2fyi-utils/month)](https://pepy.tech/project/e2fyi-utils/month)

`e2fyi-utils` is an `e2fyi` namespaced python package with `utils` subpackage
(i.e. `e2fyi.utils`) which holds a collections of useful helper classes and
Expand Down
4 changes: 2 additions & 2 deletions e2fyi/utils/aws/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,11 @@ def to_s3_resource(item):
size = len(resources)

# terminate if max_objects hit
if count >= max_objects >= 0:
if count >= max_objects > 0:
break

# terminate if max_objects hit
if count + size > max_objects:
if count + size > max_objects > 0:
yield from resources[: max_objects - count]
break

Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.0.post1
0.2.1

0 comments on commit acb5af0

Please sign in to comment.