jplana / python-etcd

A python client for etcd
Other
522 stars 210 forks source link

fix bug introduced from dnspython dep upgrade #201

Closed tmacro closed 8 years ago

tmacro commented 8 years ago

between version 1.12.0 and 1.14.0 of dnspython the return value of answer.target.to_text(omit_final_dot=True) has switched from a python string to a byte string, causing this exception to be thrown .

etcd.EtcdException: Could not get the list of servers, maybe you provided the wrong host(s) to connect to?

further up the stack trace is this urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host="b'example.com'", port=2379): Max retries exceeded with url: /v2/machines (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f1eb30af5f8>: Failed to establish a new connection: [Errno -2] Name or service not known',)) notice the host argument.

calling .decode() on the string returned from dns.resolver.query() fixes this issue.

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-0.3%) to 88.181% when pulling 26c8fe5e23dfb2183f202172a755dd96590f5a39 on tmacro:master into 0d0145f5e835aa032c97a0a5e09c4c68b7a03f66 on jplana:master.

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-0.09%) to 88.36% when pulling 1cf714e61f325589ef065a085bf642688b72b5c9 on tmacro:master into 0d0145f5e835aa032c97a0a5e09c4c68b7a03f66 on jplana:master.

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-0.09%) to 88.36% when pulling a22d0df7654cf7d657e5b841ad085ccd358646c6 on tmacro:master into 0d0145f5e835aa032c97a0a5e09c4c68b7a03f66 on jplana:master.