Revolution1 / etcd3-py

Pure python client for etcd v3 (Using gRPC-JSON-Gateway)
Other
105 stars 25 forks source link

AttributeError: 'AioClient' object has no attribute 'server_version_sem' My Network Problems? Why? #170

Open ghost opened 2 years ago

ghost commented 2 years ago

Description

I just deploy an etcd cluster with TLS, only use AioClient to put key value into etcd,BUT aioclient create error as below!!

Describe what you were trying to get done. Tell us what happened, what went wrong, and what you expected to happen.

What I Did

import asyncio
import etcd3

async def getFoo(client, key, value):
    await client.put(key, value)
    r = await client.range(key)
    print('key:', r.kvs[0].key, 'value:', r.kvs[0].value)

def main():
    key = "hello"
    value = "world"
    aio_client = etcd3.AioClient("192.168.11.109", 2379, protocol="https",
                                 cert=("cert/server.pem", "cert/server-key.pem,"),
                                 verify="cert/ca.pem", timeout=1000)
    loop = asyncio.get_event_loop()
    loop.run_until_complete(getFoo(aio_client, key, value))

if __name__ == "__main__":
    main()