Skip to content

Commit

Permalink
only set shardid params when more shards
Browse files Browse the repository at this point in the history
  • Loading branch information
sidpatel13 committed Aug 31, 2020
1 parent 7d0334b commit 8db1a9d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/modules/kinesis_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,8 @@ def find_stream(client, stream_name, check_mode=False):
)
shards.extend(results.pop('Shards'))
has_more_shards = results['HasMoreShards']
params['ExclusiveStartShardId'] = shards[-1]['ShardId']
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 8db1a9d

Please sign in to comment.