Skip to content

Commit

Permalink
Allow for the case of no secondary indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
tremble committed Jul 3, 2023
1 parent 5080067 commit b9dabd7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugins/module_utils/dynamodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ def __init__(self, module):
# the AWSRetry wrapper doesn't support the wait functions (there's no
# public call we can cleanly wrap)
client = module.client("dynamodb")
super(DynamodbWaiterFactory, self).__init__(module, client)
super().__init__(module, client)

@property
def _waiter_model_data(self):
data = super(DynamodbWaiterFactory, self)._waiter_model_data
data = super()._waiter_model_data
ddb_data = dict(
table_exists=dict(
operation="DescribeTable",
Expand All @@ -45,6 +45,8 @@ def _waiter_model_data(self):
maxAttempts=25,
acceptors=[
dict(expected="ResourceNotFoundException", matcher="error", state="failure"),
# If there are no secondary indexes, simply return
dict(expected=False, matcher="path", state="success", argument="contains(keys(Table), `SecondaryIndexes`)"),
dict(
expected="ACTIVE",
matcher="pathAll",
Expand Down

0 comments on commit b9dabd7

Please sign in to comment.