Skip to content

Commit

Permalink
gravelrpc: SSL in rpctool
Browse files Browse the repository at this point in the history
  • Loading branch information
zielmicha committed Aug 29, 2013
1 parent d27160e commit 2389043
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion rpctool.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@
from gravelrpc import FD

parser = argparse.ArgumentParser()
parser.add_argument('--ssl', action='store_true')
parser.add_argument('--ssl-key', default='example.pem')
parser.add_argument('name')
parser.add_argument('expression')
args = parser.parse_args()

client = gravelrpc.Client(args.name)
if args.ssl:
host, port = args.name.split(':')
client = gravelrpc.SSLClient((host, int(port)), args.ssl_key)
else:
client = gravelrpc.Client(args.name)
print eval('client.' + args.expression)

0 comments on commit 2389043

Please sign in to comment.