Add support for Name.com#507
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! |
adferrand
left a comment
There was a problem hiding this comment.
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.
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.
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.
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.
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.
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.
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.
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!