Commit 5cb39463 authored by Kirill Smelkov's avatar Kirill Smelkov

fixup! X wcfs/zeo started to work locally

ZEO4 can have ._addr as either ("host", port) or "path".
parent cec0447c
...@@ -322,10 +322,19 @@ def zstor_2zurl(zstor): ...@@ -322,10 +322,19 @@ def zstor_2zurl(zstor):
# ZEO # ZEO
if ztype == "ZEO.ClientStorage.ClientStorage": if ztype == "ZEO.ClientStorage.ClientStorage":
u = "zeo://" u = "zeo://"
addr = zstor._addr _addr = zstor._addr
if len(addr) != 1: addr = None
raise NotImplementedError("ZEO client has multiple configured servers: %r" % (addr,)) # ZEO4/3 for backward compatibility accept either a single "address" or single ("host", port) pair
addr = addr[0] # https://github.com/zopefoundation/ZEO/blob/4.2.0b1-49-g47d3fbe8/src/ZEO/zrpc/client.py#L179
if zmajor <= 4:
if isinstance(_addr, str):
addr = _addr
elif len(_addr) == 2 and isinstance(_addr[0], str) and isinstance(_addr[1], int):
addr = _addr
if addr is None:
if len(_addr) != 1:
raise NotImplementedError("ZEO client has multiple configured servers: %r" % (addr,))
addr = _addr[0]
# addr is either TCP (host,port) or UNIX path # addr is either TCP (host,port) or UNIX path
if isinstance(addr, str): if isinstance(addr, str):
u += addr u += addr
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment