Skip to content

Commit

Permalink
update set_table.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jobs committed Nov 16, 2016
1 parent 11f7789 commit b0b25fd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hustdb/ha/nginx/test/set_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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']
Expand Down

0 comments on commit b0b25fd

Please sign in to comment.