jplana / python-etcd

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

ValueError if first host is not reachable and `use_proxies=True` #158

Open fasaxc opened 8 years ago

fasaxc commented 8 years ago

I tried supplying multiple hosts, the first of which was down as proxies. Rather than falling back to the next host, I get this value error:

>>> c = etcd.Client(host=(("localhost", 1234), ("localhost", 4001)), allow_reconnect=True, u
se_proxies=True)
>>> c.get("calico")
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/home/gulfstream/git/python-etcd/src/etcd/client.py", line 631, in get
    return self.read(key)
  File "/home/gulfstream/git/python-etcd/src/etcd/client.py", line 488, in read
    timeout=timeout)
  File "/home/gulfstream/git/python-etcd/src/etcd/client.py", line 813, in api_execute
    self._machines_cache.remove(self._base_uri)
ValueError: list.remove(x): x not in list