class MyZKClient(ZKClient):
def __init__(
self,
servers,
chroot=None,
session_timeout=10,
default_acl=None,
retry_policy=None,
allow_read_only=False,
read_timeout=None,
loop=None,
auth_data=None,
):
super().__init__(servers, chroot, session_timeout, default_acl,
retry_policy, allow_read_only, read_timeout,
loop)
self.auth_data = auth_data
async def send(self, request):
try:
return await super().send(request)
except NoAuth:
if self.auth_data:
await super().send(self.auth_data)
return await super().send(request)
auth_data = AuthRequest(type=0, scheme='digest', auth=auth)
MyZKClient(zk_hosts, auth_data=auth_data)
Can you add
auth_datawhen ZKClient instance likeKazooClient(auth_data=auth_data)?Or that would work not good?
For example:
but, still has some
NoAutherror when useTreeCachezookeeper: 3.4.10