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
DNS driver for digitalocean and other minor Node driver updates #505
Conversation
Pulled connection/response from libcloud.compute.driver.digitalocean into libcloud.common.digitalocean Implemented majority functions in libcloud.dns.driver.digitalocean
- Added 'common' to FIXTURES_ROOT for FileFixtures in test/common - Modified DigitalOceanBaseDriver from compute/drivers/digitalocean into common/digitalocean to support v1 and v2 by initialization - Added dns/driver/digitalocean tests - Added common/digitalocean tests
… tests from dns/test_digitalocean performed in DigitalOceanBaseDriver
- Support for v1 and v2 initialization with authentication secret - Updated v1 DigitalOceanNodeDriver to use updated KeyPair Management - Updated tests to reflect KeyPair Management changes
I'm wondering if the hack is what is causing the provider feature matrix build to fail. Should this also include a check if this is node driver vs dns driver to let the normal driver selector hit without overriding?
|
Great, thanks! I will have a look asap. |
I'm thinking the hack can be removed entirely since the DigitalOceanNodeDriver can handle both cases with just passing of the secret or key only:
Also, I'm pulling the ex_ssh functions back into the v1 driver to live alongside the key pair functions so it doesn't break existing functionality. Poor foresight on my part. |
- Removed hack to load DigitalOcean_v2_NodeDriver as DigitalOceanNodeDriver will handle v1/v2 properly - Restored DigitalOceanNodeDriver (v1) ex_ssh* methods with Warning of deprecation
Looks like removing the hack worked as it handles the tests properly for both v1 and v2 cases in DigitalOceanNodeDriver, also the old ex_ssh_* functions have been restored to v1, but with warnings.warn regarding deprecation. This looks good from a working build perspective, let me know if there is anything else needed on this. |
- Includes driver instantiation example - Updated Node driver documentation to reflect duality of v1/v2 api in DigitalOceanNodeDriver
- Updated documentation for DigitalOcean regarding locations - Fixed type for DigitalOcean DNS documentation
@@ -2,4 +2,4 @@ | |||
from libcloud.compute.providers import get_driver | |||
|
|||
cls = get_driver(Provider.DIGITAL_OCEAN) | |||
driver = cls('client id', 'api key', api_version='v1') |
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.
This is a minor thing - I prefer to be explicit and explicitly specify an api version. This way it's immediately obvious which API version is used.
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.
Hey, sorry for the delay. Personal life had some crazy changes cutting my time for projects to almost nothing. Going over these, and they should be easy to get done over the next couple days.
As for this entry in particular, I agree it should be explicit here as well. I'm also going to update the v2 API compute example to include the api_version='v2'
as well.
I've added some comments. Overall the PR looks good, but there are some small things which need to be addressed so we can get it merged. |
@jcastillo2nd Sorry for the delay and please ping me when those comments are addressed - I would love to get this change included in the next release. |
- Raise on api_version / key or key-secret mismatch - Added tests for v1 and v2 DigitalOceanNodeDriver using wrong keys - Updated examples to include explicit api_version values
- Raise on api_version / key or key-secret mismatch - Added tests for v1 and v2 DigitalOceanNodeDriver using wrong keys - Updated examples to include explicit api_version values - Cleaned up some whitespace lint
- Raise on api_version / key or key-secret mismatch - Added tests for v1 and v2 DigitalOceanNodeDriver using wrong keys - Updated examples to include explicit api_version values - Cleaned up some whitespace lint - Cleaned up tests
@Kami Hopefully I've clarified the issues with the current code and moved things in the right direction. Let me know what your thoughts are on the pending issues. |
- v2 driver referenced object instead of response
- v2 driver referenced object instead of response
- Update v2 Node driver to properly set data instead of parameters for API requests
- Added ex_ssh_key_ids to create_node - Implemented list_key_pairs with public key retreival
- Consistency in v2 for attributes -> json request data
@Kami I've got some time over the next couple of weeks to work on anything else that may come up on this. If there are still any issues keeping this from being merged, I will hopefully be able to resolve them before the next release is established. |
I restored a slightly modified hack to make the table generation script work again (8952234) and merged changes into trunk. Thanks. |
I'v run through the DigitalOcean files ( for common, node and dns ) with flake8, and with the exception of 2 tests files, ( with long strings that I don't know how to break up to pass the test AND land within 79 chars ) everything is clean.
I would like to note that the documentation on the KeyPair management may need to be updated to include return types that are consistent with the other components of libcloud. This could be setup in an issue, but at the same time, this could be arbitrarily added without breaking anything before accepting this merge.