From b0b25fd59d4ce70cddf153a4ef4fcab3b4db230e Mon Sep 17 00:00:00 2001 From: jobs Date: Tue, 15 Nov 2016 17:15:44 +0800 Subject: [PATCH] update set_table.py --- hustdb/ha/nginx/test/set_table.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hustdb/ha/nginx/test/set_table.py b/hustdb/ha/nginx/test/set_table.py index 8ba90b0..ce9f7ce 100644 --- a/hustdb/ha/nginx/test/set_table.py +++ b/hustdb/ha/nginx/test/set_table.py @@ -11,16 +11,16 @@ def manual(): print """ usage: - python set_table.py [option] [host] [private pem] [table] + python set_table.py [option] [uri] [private pem] [table] [option] -t: simple test -m: mutiprocess test sample: - python set_table.py -t localhost conf/private.pem conf/hustdbtable.json + python set_table.py -t localhost:8082 conf/private.pem conf/hustdbtable.json """ def get_identifier(sess, host): - cmd = 'http://%s:8082/set_table' % host + cmd = 'http://%s/set_table' % host r = sess.post(cmd, auth=AUTH) return None if 200 != r.status_code else r.content def overwrite_table(sess, host, cipher_id, private_pem, table): @@ -30,7 +30,7 @@ def overwrite_table(sess, host, cipher_id, private_pem, table): p = f.read() privkey = rsa.PrivateKey.load_pkcs1(p) id = rsa.decrypt(cipher_id, privkey) - cmd = 'http://%s:8082/set_table?id=%s' % (host, id) + cmd = 'http://%s/set_table?id=%s' % (host, id) r = sess.post(cmd, body, auth=AUTH) if 200 != r.status_code: print r.headers['errorcode']