You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2020/12/06 13:02:43 UTC

[libcloud] branch trunk updated (66ab3ca -> fb7e69e)

This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git.


    from 66ab3ca  Merge pull request #1517 from micafer/ost_flavor_extra_specs
     new 5829845  Fix for apache/libcloud #1521
     new d3dec97  Add a regression test case for it.
     new fb7e69e  Add changelog entry.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 CHANGES.rst                         |  4 ++++
 libcloud/dns/drivers/auroradns.py   |  2 +-
 libcloud/test/dns/test_auroradns.py | 14 ++++++++++++++
 3 files changed, 19 insertions(+), 1 deletion(-)


[libcloud] 02/03: Add a regression test case for it.

Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git

commit d3dec976c580f6612235907e46f4f9cbf72c7416
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Sun Dec 6 14:01:47 2020 +0100

    Add a regression test case for it.
---
 libcloud/test/dns/test_auroradns.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/libcloud/test/dns/test_auroradns.py b/libcloud/test/dns/test_auroradns.py
index 56ef20c..205c544 100644
--- a/libcloud/test/dns/test_auroradns.py
+++ b/libcloud/test/dns/test_auroradns.py
@@ -15,6 +15,7 @@
 import sys
 import json
 
+from libcloud.common.types import ProviderError
 from libcloud.dns.drivers.auroradns import AuroraDNSDriver
 from libcloud.dns.drivers.auroradns import AuroraDNSHealthCheckType
 from libcloud.dns.types import RecordType
@@ -37,6 +38,15 @@ class AuroraDNSDriverTests(LibcloudTestCase):
         AuroraDNSDriverMockHttp.type = None
         self.driver = AuroraDNSDriver(*DNS_PARAMS_AURORADNS)
 
+    def test_403_status_code(self):
+        AuroraDNSDriverMockHttp.type = "HTTP_FORBIDDEN"
+
+        with self.assertRaises(ProviderError) as ctx:
+            self.driver.list_zones()
+
+        self.assertEqual(ctx.exception.value, "Authorization failed")
+        self.assertEqual(ctx.exception.http_code, 403)
+
     def test_merge_extra_data(self):
         rdata = {
             'name': 'localhost',
@@ -262,6 +272,10 @@ class AuroraDNSDriverMockHttp(MockHttp):
             body = self.fixtures.load('zone_list.json')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
+    def _zones_HTTP_FORBIDDEN(self, method, url, body, headers):
+        body = "{}"
+        return (httplib.FORBIDDEN, body, {}, httplib.responses[httplib.FORBIDDEN])
+
     def _zones_example_com(self, method, url, body, headers):
         body = None
         if method == 'GET':


[libcloud] 03/03: Add changelog entry.

Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git

commit fb7e69e6e6281d2c633ae5c42c5767fd79751f39
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Sun Dec 6 14:01:54 2020 +0100

    Add changelog entry.
---
 CHANGES.rst | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/CHANGES.rst b/CHANGES.rst
index 05f28f7..1cb2e7b 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -110,6 +110,10 @@ DNS
   (GITHUB-1505)
   [Andrew Starr-Bochicchio - @andrewsomething]
 
+- [AuroraDNS] Throw correct exception on 403 authorization failed API error.
+  (GITHUB-1521, GITHUB-1522)
+  [Freek Dijkstra - @macfreek]
+
 Changes in Apache Libcloud 3.2.0
 --------------------------------
 


[libcloud] 01/03: Fix for apache/libcloud #1521

Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git

commit 58298451253d8bcd2b82356b0434085c264e7306
Author: Freek Dijkstra <fr...@macfreek.nl>
AuthorDate: Mon Nov 23 01:54:59 2020 +0100

    Fix for apache/libcloud #1521
---
 libcloud/dns/drivers/auroradns.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libcloud/dns/drivers/auroradns.py b/libcloud/dns/drivers/auroradns.py
index 5e634e3..f9257d4 100644
--- a/libcloud/dns/drivers/auroradns.py
+++ b/libcloud/dns/drivers/auroradns.py
@@ -168,7 +168,7 @@ class AuroraDNSResponse(JsonResponse):
             raise InvalidCredsError(**error)
         elif status == httplib.FORBIDDEN:
             error['value'] = 'Authorization failed'
-            error['http_status'] = status
+            error['http_code'] = status
             raise ProviderError(**error)
         elif status == httplib.NOT_FOUND:
             context = self.connection.context