You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by GitBox <gi...@apache.org> on 2019/12/18 15:36:39 UTC

[GitHub] [libcloud] Kami opened a new pull request #1389: Reduce reliance on **kwargs in "create_node()" methods

Kami opened a new pull request #1389: Reduce reliance on **kwargs in "create_node()" methods
URL: https://github.com/apache/libcloud/pull/1389
 
 
   This pull request tries to mitigate / resolve an issue with legacy code / kwargs abuse brought up in #1383.
   
   ## Description, Background
   
   Currently a lot of ``create_node()`` method signatures use ``**kwargs`` instead of regular positional + keyword arguments.
   
   That's bad for many reasons (makes code introspection hard / impossible, bad API, hard to follow and understand the code, etc.).
   
   One of the reasons for that is that ``deploy_node()`` method passes all the keyword argument it takes to ``create_node()`` method, even though majority of the arguments it takes are ``deploy_node()`` specific (ssh_username, max_tries, ssh_interface, etc.) and shouldn't be passed / propagated to ``create_node()``.
   
   Only keyword argument which potentially needs to be propagated is ``auth`` argument. That argument is used by provider drivers which support password based SSH authentication (e.g. Linode).
   
   ## Proposed Solution
   
   This solution updates ``deploy_node()`` code to only pass non deploy_node specific keyword arguments to the ``create_node()`` method.
   
   If for some reason driver method throws (e.g. that driver still expects some deploy_node arguments which really shouldn't happen, but there might be some legacy code which does that out there), we simply fall back to the old approach and pass all the arguments to ``create_node()`` method.
   
   This will allow drivers to still support ``deploy_node()`` functionality without needing to use ``**kwargs`` in ``create_node()`` method signature. They will be able to normally declare positional and keyword arguments they support in that method.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [libcloud] Kami merged pull request #1389: Reduce reliance on **kwargs in "create_node()" methods

Posted by GitBox <gi...@apache.org>.
Kami merged pull request #1389: Reduce reliance on **kwargs in "create_node()" methods
URL: https://github.com/apache/libcloud/pull/1389
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [libcloud] codecov-io edited a comment on issue #1389: Reduce reliance on **kwargs in "create_node()" methods

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #1389: Reduce reliance on **kwargs in "create_node()" methods
URL: https://github.com/apache/libcloud/pull/1389#issuecomment-567088055
 
 
   # [Codecov](https://codecov.io/gh/apache/libcloud/pull/1389?src=pr&el=h1) Report
   > Merging [#1389](https://codecov.io/gh/apache/libcloud/pull/1389?src=pr&el=desc) into [trunk](https://codecov.io/gh/apache/libcloud/commit/5bc99f24ef76585887f5293aa206e16a505506af?src=pr&el=desc) will **increase** coverage by `0.02%`.
   > The diff coverage is `76.92%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/libcloud/pull/1389/graphs/tree.svg?width=650&token=PYoduksh69&height=150&src=pr)](https://codecov.io/gh/apache/libcloud/pull/1389?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff            @@
   ##            trunk   #1389      +/-   ##
   =========================================
   + Coverage   86.27%   86.3%   +0.02%     
   =========================================
     Files         372     372              
     Lines       76539   76545       +6     
     Branches     7003    7008       +5     
   =========================================
   + Hits        66035   66059      +24     
   + Misses       7700    7685      -15     
   + Partials     2804    2801       -3
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/libcloud/pull/1389?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [libcloud/test/compute/test\_softlayer.py](https://codecov.io/gh/apache/libcloud/pull/1389/diff?src=pr&el=tree#diff-bGliY2xvdWQvdGVzdC9jb21wdXRlL3Rlc3Rfc29mdGxheWVyLnB5) | `93.52% <ø> (ø)` | :arrow_up: |
   | [libcloud/test/compute/test\_vcloud.py](https://codecov.io/gh/apache/libcloud/pull/1389/diff?src=pr&el=tree#diff-bGliY2xvdWQvdGVzdC9jb21wdXRlL3Rlc3RfdmNsb3VkLnB5) | `94.71% <ø> (ø)` | :arrow_up: |
   | [libcloud/test/compute/test\_voxel.py](https://codecov.io/gh/apache/libcloud/pull/1389/diff?src=pr&el=tree#diff-bGliY2xvdWQvdGVzdC9jb21wdXRlL3Rlc3Rfdm94ZWwucHk=) | `96.59% <ø> (ø)` | :arrow_up: |
   | [libcloud/common/upcloud.py](https://codecov.io/gh/apache/libcloud/pull/1389/diff?src=pr&el=tree#diff-bGliY2xvdWQvY29tbW9uL3VwY2xvdWQucHk=) | `92% <ø> (-0.08%)` | :arrow_down: |
   | [libcloud/test/compute/test\_openstack.py](https://codecov.io/gh/apache/libcloud/pull/1389/diff?src=pr&el=tree#diff-bGliY2xvdWQvdGVzdC9jb21wdXRlL3Rlc3Rfb3BlbnN0YWNrLnB5) | `94.72% <ø> (ø)` | :arrow_up: |
   | [libcloud/compute/drivers/rimuhosting.py](https://codecov.io/gh/apache/libcloud/pull/1389/diff?src=pr&el=tree#diff-bGliY2xvdWQvY29tcHV0ZS9kcml2ZXJzL3JpbXVob3N0aW5nLnB5) | `72.41% <10.52%> (-0.7%)` | :arrow_down: |
   | [libcloud/compute/drivers/joyent.py](https://codecov.io/gh/apache/libcloud/pull/1389/diff?src=pr&el=tree#diff-bGliY2xvdWQvY29tcHV0ZS9kcml2ZXJzL2pveWVudC5weQ==) | `91.17% <100%> (-0.26%)` | :arrow_down: |
   | [libcloud/test/compute/test\_deployment.py](https://codecov.io/gh/apache/libcloud/pull/1389/diff?src=pr&el=tree#diff-bGliY2xvdWQvdGVzdC9jb21wdXRlL3Rlc3RfZGVwbG95bWVudC5weQ==) | `95.19% <100%> (+0.66%)` | :arrow_up: |
   | [libcloud/test/compute/test\_abiquo.py](https://codecov.io/gh/apache/libcloud/pull/1389/diff?src=pr&el=tree#diff-bGliY2xvdWQvdGVzdC9jb21wdXRlL3Rlc3RfYWJpcXVvLnB5) | `97.5% <100%> (ø)` | :arrow_up: |
   | [libcloud/compute/drivers/hostvirtual.py](https://codecov.io/gh/apache/libcloud/pull/1389/diff?src=pr&el=tree#diff-bGliY2xvdWQvY29tcHV0ZS9kcml2ZXJzL2hvc3R2aXJ0dWFsLnB5) | `81.81% <100%> (ø)` | :arrow_up: |
   | ... and [32 more](https://codecov.io/gh/apache/libcloud/pull/1389/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/libcloud/pull/1389?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/libcloud/pull/1389?src=pr&el=footer). Last update [5bc99f2...6b52ab5](https://codecov.io/gh/apache/libcloud/pull/1389?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services