Commit d495a148 authored by Łukasz Nowak's avatar Łukasz Nowak

- assume that non bootstraped server or empty received dicts are wrong

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25765 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8c88c250
......@@ -35,16 +35,24 @@ import sys
from struct import pack
from base64 import encodestring
from pprint import pprint
from time import sleep
def main():
address = sys.argv[1]
port = int(sys.argv[2])
client = TIDClient((address, port))
if not client.bootstraped():
raise ValueError('Server not bootstraped')
dump_dict = client.dump_all()
if not dump_dict:
raise ValueError('Received empty dict from server')
for key,value in dump_dict.iteritems():
dump_dict[key] = encodestring(pack('>Q', value)).rstrip()
pprint(dump_dict)
if __name__ == '__main__':
assert len(sys.argv) == 3, 'Requires exactly 2 arguments: <address> <port>'
sys.exit(main())
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