add an old client hack (just for reference)
This commit is contained in:
parent
b38c9b6060
commit
10f09c7115
2 changed files with 23 additions and 0 deletions
0
uncloud/client/__init__.py
Normal file
0
uncloud/client/__init__.py
Normal file
23
uncloud/client/main.py
Normal file
23
uncloud/client/main.py
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
import argparse
|
||||||
|
import etcd3
|
||||||
|
from uncloud.common.etcd_wrapper import Etcd3Wrapper
|
||||||
|
|
||||||
|
arg_parser = argparse.ArgumentParser('client', add_help=False)
|
||||||
|
arg_parser.add_argument('--dump-etcd-contents-prefix', help="Dump contents below the given prefix")
|
||||||
|
|
||||||
|
def dump_etcd_contents(prefix):
|
||||||
|
etcd = Etcd3Wrapper()
|
||||||
|
for k,v in etcd.get_prefix_raw(prefix):
|
||||||
|
k = k.decode('utf-8')
|
||||||
|
v = v.decode('utf-8')
|
||||||
|
print("{} = {}".format(k,v))
|
||||||
|
# print("{} = {}".format(k,v))
|
||||||
|
|
||||||
|
# for k,v in etcd.get_prefix(prefix):
|
||||||
|
#
|
||||||
|
print("done")
|
||||||
|
|
||||||
|
|
||||||
|
def main(arguments):
|
||||||
|
if 'dump_etcd_contents_prefix' in arguments:
|
||||||
|
dump_etcd_contents(prefix=arguments['dump_etcd_contents_prefix'])
|
Loading…
Reference in a new issue