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
Allow local dynamodb to be installed on another host than localhost #8965
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8965 +/- ##
=======================================
Coverage 77.80% 77.81%
=======================================
Files 150 150
Lines 18686 18694 +8
Branches 3193 3194 +1
=======================================
+ Hits 14539 14547 +8
Misses 3854 3854
Partials 293 293
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -153,6 +154,14 @@ def __init__(self, url=None, table_name=None, *args, **kwargs): | |||
secret_access_key=aws_secret_access_key | |||
) | |||
|
|||
@staticmethod | |||
def _is_valid_ip(ip): |
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.
I wonder if that's the best way to check it.. or if it's worth delaying for 🤔
Anyway, should not be merged before v5.4 release. We're in RC2 at the moment.
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.
I guess I could do
pattern = re.compile(r'^[a-z]{2}-[a-z]+-[0-9]{1}$')
if pattern.match(input_string):
do real dynamodb
else:
do local dynamodb
if we trust the AWS region names keeps following the current format of xx-yyyy-n
That would also allow to use non ip hosts names.
The docker-docs failure is not related btw |
Note: Before submitting this pull request, please review our contributing
guidelines.
Description
The previous version of dynamodb backend only allowed to have local dynamodb on your local dev machine. I changed it so that you can have local dynamodb running on an different machine and use an ip address instead of localhost:8000 . I use 127.0.0.1 as ip address in the unit test but it works with any ip address.