Commenting out the __init__.py inside line 25/26.
where it checks the version with PBR
#__version__ = pbr.version.VersionInfo(
# 'etcd3gw').version_string()
commenting this line out and running ./test.py
my response is success.
# testing steps for bionic
version - 0.2.1-1ubuntu0.18.04.1
python3 version - 3.6.9
python2 version - 2.7.17
mkdir 1820083-verification-testing
cd 1820083-verification-testing
pull-lp-source python-etcd3gw bionic
Commenting out the __init__.py inside line 25/26. VersionInfo( ).version_ string( )
where it checks the version with PBR
#__version__ = pbr.version.
# 'etcd3gw'
commenting this line out and running ./test.py
my response is success.
# testing steps for bionic 18.04.1
version - 0.2.1-1ubuntu0.
python3 version - 3.6.9
python2 version - 2.7.17
mkdir 1820083- verification- testing verification- testing
cd 1820083-
pull-lp-source python-etcd3gw bionic
apt install python3-pip ts.txt
pip3 install -r requirements.txt
pip3 install -r test-requiremen
# generate certs in python-etcd3gw folder
openssl req -x509 -keyout localhost.key -newkey rsa:4096 -nodes -sha256 -out localhost.crt
#download etcd binaries & launch etcd locally with TLS enabled /github. com/etcd- io/etcd/ releases/ download/ v3.3.13/ etcd-v3. 3.13-linux- amd64.tar. gz
wget https:/
tar -zxvf etcd-v3. 3.14-linux- amd64.tar. gz
cd etcd-v3. 3.14-linux- amd64/
#spin up etcd server file=/python- etcd3gw/ localhost. crt --key-file= /python- etcd3gw/ localhost. key --advertise- client- urls=https:/ /127.0. 0.1:2379 --listen- client- urls=https:/ /127.0. 0.1:2379
./etcd --name infra0 --data-dir infra0 --cert-
# test cert connection endpoint /127.0. 0.1:2379/ health
curl --cacert localhost.crt --key localhost.key --cert localhost.crt https:/
response
{"health":"true"}
modify test.py to your config setup for etcd
#run test
./test.py
response
success!
# code for test.py
touch test.py
chmod +rwx test.py
gedit test.py
#!/usr/bin/python3
from etcd3gw import Etcd3Client
c = Etcd3Client( host="127. 0.0.1", protocol="https", cert_key= "localhost. key", cert_cert= "localhost. crt", ca_cert= "localhost. crt", timeout=10) '.join( resp).decode( ))
c.put('test', 'success!')
resp = c.get('test')
print(b'
#also feel free to run unit tests with
python3 -m unittest