-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(aws): SNS threw IndexError if SubscriptionArn is PendingConfirmation #6896
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6896 +/- ##
==========================================
- Coverage 88.73% 88.70% -0.03%
==========================================
Files 1200 1200
Lines 34609 34609
==========================================
- Hits 30710 30701 -9
- Misses 3899 3908 +9
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch @kagahd !!
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
Context
The
sns_service.py
threw the errorIndexError[100]: list index out of range
upon extracting the region from the fieldSubscriptionArn
of a subscription if the fieldSubscriptionArn
was not an ARN but the valuePendingConfirmation
.Description
This PR fixes it by verifying that the
SubscriptionArn
has at least 4 parts after the split by the character:
in order to extract the 4th part, which is theregion
. If it doesn't, theregion
is set tounkown
. Instead ofunknown
it could have been set also toregional_client.region
ortopic.region
but I'm not sure if they can differ from the region of a subscription. Feel free to adapt it.Checklist
API
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.