Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/certbot/certbot.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Strecansky <bob.strecansky@gmail.com>2017-08-07 06:02:07 +0300
committerBob Strecansky <bob.strecansky@gmail.com>2017-08-07 06:02:07 +0300
commit521f783020e3219bd698bbbe84397426c56e2dce (patch)
tree051001e842af410c081ebfa20c73df3d1b9dc82a
parent5fb1568b6e69866e4b0b7df0fd99a62bf0888b98 (diff)
[#4535] - Unwrap max retries exceeded errors
-rw-r--r--acme/acme/client.py2
-rw-r--r--acme/acme/client_test.py18
2 files changed, 3 insertions, 17 deletions
diff --git a/acme/acme/client.py b/acme/acme/client.py
index 2e07d34d7..6fcee2fdc 100644
--- a/acme/acme/client.py
+++ b/acme/acme/client.py
@@ -647,7 +647,7 @@ class ClientNetwork(object): # pylint: disable=too-many-instance-attributes
err_regex = r".*host='(\S*)'.*Max retries exceeded with url\: (\/\w*).*(\[Errno \d+\])([A-Za-z ]*)"
m = re.match(err_regex, str(e))
if m is None:
- raise # pragma: no cover
+ raise #pragma: no cover
else:
host, path, _err_no, err_msg = m.groups()
raise ValueError("Requesting {0}{1}:{2}".format(host, path, err_msg))
diff --git a/acme/acme/client_test.py b/acme/acme/client_test.py
index 172e94d74..ff0ac18ef 100644
--- a/acme/acme/client_test.py
+++ b/acme/acme/client_test.py
@@ -7,7 +7,6 @@ from six.moves import http_client # pylint: disable=import-error
import mock
import requests
-import sys
from acme import challenges
from acme import errors
@@ -630,21 +629,8 @@ class ClientNetworkTest(unittest.TestCase):
# Python Exceptions
except ValueError as y:
- if "linux" in sys.platform:
- self.assertEqual("Requesting localhost/nonexistent: "
- "Connection refused", str(y))
- else: #pragma: no cover
- self.assertEqual("Requesting localhost/nonexistent: "
- "Connection refused", str(y))
-
- # Requests Exceptions
- except requests.exceptions.ConnectionError as z: #pragma: no cover
- if "linux" in sys.platform:
- self.assertEqual("('Connection aborted.', "
- "error(111, 'Connection refused'))", str(z))
- else: #pragma: no cover
- self.assertEqual("('Connection aborted.', "
- "error('Connection refused'))", str(z))
+ self.assertEqual("Requesting localhost/nonexistent: "
+ "Connection refused", str(y))
class ClientNetworkWithMockedResponseTest(unittest.TestCase):
"""Tests for acme.client.ClientNetwork which mock out response."""