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 2020/11/23 01:00:26 UTC

[GitHub] [libcloud] macfreek opened a new pull request #1522: Fix for apache/libcloud #1521

macfreek opened a new pull request #1522:
URL: https://github.com/apache/libcloud/pull/1522


   ## Bug fix: raise proper exception when using incorrect credentials for AuroraDNS
   
   ### Description
   
   This is a minor fix for a bug that was introduced in january 2016. See #1521 for details.
   
   #### Code to reproduce:
   
   ```
   #!/usr/bin/env python3
   
   from libcloud.dns.types import Provider
   from libcloud.dns.providers import get_driver
   
   api_key = '123456'
   secret_key = 'this_is_the_wrong_password'
   
   cls = get_driver(Provider.AURORADNS)
   driver = cls(api_key, secret_key)
   
   for zone in driver.iterate_zones():
       print(zone)
   ```
   
   #### Expected exception:
   
   This should have raised an `ProviderError: Authorization failed`
   
   #### Actual exception:
   
   `TypeError: __init__() got an unexpected keyword argument 'http_status'`
   
   ### Source of the bug:
   
   This bug was introduced in commit de7862f, which includes the following rewrite:
   
   ```
   -            raise ProviderError(value='Authorization failed', http_code=status,
   -                                driver=self)
   +            error['value'] = 'Authorization failed'
   +            error['http_status'] = status
   +            raise ProviderError(**error)
   ```
   
   While the intention is clear, the author inadvertently changed the way `ProviderError` was called from `ProviderError(value=..., http_code=status)` to `ProviderError(value=..., http_status=status)`
   
   This PR fixes this bug by changing the line `error['http_status'] = status` to `error['http_code'] = status`
   
   ### Status
   
   - done, ready for review
   
   ### Checklist (tick everything that applies)
   
   - [X] [Code linting](http://libcloud.readthedocs.org/en/latest/development.html#code-style-guide) (required, can be done after the PR checks)
   - [X] Documentation
   - [ ] [Tests](http://libcloud.readthedocs.org/en/latest/testing.html)
   - [ ] [ICLA](http://libcloud.readthedocs.org/en/latest/development.html#contributing-bigger-changes) (required for bigger changes)
   


----------------------------------------------------------------
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



[GitHub] [libcloud] Kami commented on pull request #1522: Fix for apache/libcloud #1521

Posted by GitBox <gi...@apache.org>.
Kami commented on pull request #1522:
URL: https://github.com/apache/libcloud/pull/1522#issuecomment-739499805


   Thanks for the contribution.
   
   The change looks good to me. I added (regression) test case for it and merged it into trunk - d3dec976c580f6612235907e46f4f9cbf72c7416.


----------------------------------------------------------------
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



[GitHub] [libcloud] asfgit merged pull request #1522: Fix for apache/libcloud #1521

Posted by GitBox <gi...@apache.org>.
asfgit merged pull request #1522:
URL: https://github.com/apache/libcloud/pull/1522


   


----------------------------------------------------------------
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



[GitHub] [libcloud] codecov-io commented on pull request #1522: Fix for apache/libcloud #1521

Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #1522:
URL: https://github.com/apache/libcloud/pull/1522#issuecomment-731881514


   # [Codecov](https://codecov.io/gh/apache/libcloud/pull/1522?src=pr&el=h1) Report
   > Merging [#1522](https://codecov.io/gh/apache/libcloud/pull/1522?src=pr&el=desc) (5829845) into [trunk](https://codecov.io/gh/apache/libcloud/commit/66ab3cad69a79dd60e7115761546ecdbfa7da7a1?el=desc) (66ab3ca) will **not change** coverage.
   > The diff coverage is `0.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/libcloud/pull/1522/graphs/tree.svg?width=650&height=150&src=pr&token=PYoduksh69)](https://codecov.io/gh/apache/libcloud/pull/1522?src=pr&el=tree)
   
   ```diff
   @@           Coverage Diff           @@
   ##            trunk    #1522   +/-   ##
   =======================================
     Coverage   84.77%   84.77%           
   =======================================
     Files         388      388           
     Lines       81718    81718           
     Branches     8270     8270           
   =======================================
     Hits        69278    69278           
     Misses       9440     9440           
     Partials     3000     3000           
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/libcloud/pull/1522?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [libcloud/dns/drivers/auroradns.py](https://codecov.io/gh/apache/libcloud/pull/1522/diff?src=pr&el=tree#diff-bGliY2xvdWQvZG5zL2RyaXZlcnMvYXVyb3JhZG5zLnB5) | `71.74% <0.00%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/libcloud/pull/1522?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/1522?src=pr&el=footer). Last update [66ab3ca...5829845](https://codecov.io/gh/apache/libcloud/pull/1522?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