Skip to content

Commit

Permalink
fix: ansible kinesis stream paginated shards bug (ansible-collections#93
Browse files Browse the repository at this point in the history
)

* fix: ansible kinesis stream paginated shards bug
* only set shardid params when more shards
* add changelog fragment
  • Loading branch information
sidpatel13 authored Dec 1, 2020
1 parent 1654d5c commit e331bb8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- kinesis_stream - fixes issue where kinesis streams with > 100 shards get stuck in an infinite loop (https://github.com/ansible-collections/community.aws/pull/93)
2 changes: 2 additions & 0 deletions plugins/modules/kinesis_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,8 @@ def find_stream(client, stream_name, check_mode=False):
)
shards.extend(results.pop('Shards'))
has_more_shards = results['HasMoreShards']
if has_more_shards:
params['ExclusiveStartShardId'] = shards[-1]['ShardId']
results['Shards'] = shards
num_closed_shards = len([s for s in shards if 'EndingSequenceNumber' in s['SequenceNumberRange']])
results['OpenShardsCount'] = len(shards) - num_closed_shards
Expand Down

0 comments on commit e331bb8

Please sign in to comment.