diff --git a/hammer/library/ddb_issues.py b/hammer/library/ddb_issues.py index d9ae7de2..586cad25 100755 --- a/hammer/library/ddb_issues.py +++ b/hammer/library/ddb_issues.py @@ -322,10 +322,16 @@ def get_account_open_issues(ddb_table, account_id, issue_class=None): :return: all account open issue """ issues = [] - response = ddb_table.query(KeyConditionExpression=Key('account_id').eq(account_id), - FilterExpression=Attr('status').eq(IssueStatus.Open.value)) - for item in response['Items']: - issues.append(Issue.from_dict(item, issue_class)) + first_iteration = True + response = None + while first_iteration == True or 'LastEvaluatedKey' in response: + response = ddb_table.query(KeyConditionExpression=Key('account_id').eq(account_id), + FilterExpression=Attr('status').eq(IssueStatus.Open.value)) + for item in response['Items']: + issues.append(Issue.from_dict(item, issue_class)) + + if first_iteration == True: + first_iteration = False return issues @staticmethod