-
-
Notifications
You must be signed in to change notification settings - Fork 305
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
Add support for Name.com #507
base: master
Are you sure you want to change the base?
Conversation
Hello @AnalogJ, |
Name.com API docs: https://www.name.com/api-docs/DNS
Hello @adferrand, |
Hello @Jamim, I put your PR on my backlog, I should be able to review it by Friday. |
Sounds great, thank you! |
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.
Thanks a lot @Jamim. I opened some remarks that are mainly details that are not impacting the behavior. It is a great job!
I would like to thanks you specifically for adding that amount of new integration tests for your provider on top of the standard ones, and I am seriously thinking in adding some of them, if not all, as a new standard test suite for all new providers!
records = (record for record in records | ||
if record['content'] == content) | ||
|
||
if not isinstance(records, list): |
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.
Do you have a specific reason to use comprehension tuples above which then need to cast back tuples into list here ? From what I see, you could use comprehension lists directly ([record for record in records if ...]
) above, and avoid this cast.
if not records: | ||
LOGGER.warning('delete_record: there is no record to delete') | ||
return None | ||
record_ids = tuple(record['id'] for record in records) |
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.
A comprehension list would be a better fit here, since it will be iterated after (record_ids = [record['id'] for record in records]
).
return None | ||
record_ids = tuple(record['id'] for record in records) | ||
else: | ||
record_ids = (identifier,) |
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.
Same here: records_ids = [identifier,]
'delete_record: record %s has been deleted', record_id | ||
) | ||
|
||
return record_ids if len(record_ids) > 1 else record_ids[0] |
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.
Our specification about delete is to return True
if the delete was successful.
return self._get(url) | ||
|
||
def _request(self, action='GET', url='/', data=None, query_params=None): | ||
response = self.session.request(method=action, |
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.
Is it strictly required to use an HTTP session with pre-authentication? I would prefer if possible to use plain request each time because I saw from my experience that HTTP sessions are raising their own problems. However if it speeds up the requests, I am ok with it if it works for Name.com.
"""TestCase for Name.com""" | ||
|
||
# I don't think we really need some docstrings here. | ||
# pylint: disable=missing-function-docstring |
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.
In fact, most of the time I even put this pylint disable directive at the top of the test module ;)
# Provider.authenticate() # | ||
########################### | ||
@_vcr_integration_test | ||
def test_provider_authenticate(self): |
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.
Could you rename this test to not shadow the existing one in integration_test
?
Hello @Jamim! Are you willing to continue on your PR and answer to my questions? Thanks in advance! |
Hello @adferrand, |
Re @Jamim, quick reminder if you find the time to finish the PR :) |
This reverts commit da2f11f.
# Conflicts: # README.md
I'll try to bring to merge this pr, I really need the support for name.com. @adferrand can I rebase @Jamim 's code onto master or do you prefer to merge master into this branch again? |
Hello @giuseongit, it is really up to you. I am a big fan of the strategy "stop rebasing once the branch becomes public", because it helps for the review by keeping track of all changes, but if you want to take over this PR on a clean state, this is also a viable strategy. We have the current PR for the historical review. |
Hello,
I'd like to propose adding support for the Name.com domain name registrar.
Name.com API docs: https://www.name.com/api-docs/DNS
Hope you might find these changes useful.
Best regards!