# HG changeset patch # User Frank Koormann # Date 1425652540 -3600 # Node ID 3928af61b4cec9ab1c6171df529800ed7c656e00 # Parent 22ce0dc2e71ca37fe9ebd8a3c3b445dca012a5f8 checkclient final fixes diff -r 22ce0dc2e71c -r 3928af61b4ce checkclient.py --- a/checkclient.py Fri Mar 06 15:27:12 2015 +0100 +++ b/checkclient.py Fri Mar 06 15:35:40 2015 +0100 @@ -14,21 +14,18 @@ parser.add_option("-p", "--port", default="5000") (options, args) = parser.parse_args() - if len(args) < 2: + if len(args) < 1: parser.print_usage() sys.exit(1) url = "http://%s:%s/check/" % (options.host, options.port) infilename = args[0] - format = options.format files = {'file': open(infilename, 'rb')} - r = requests.post(url, data=data, files=files) + r = requests.post(url, files=files) if r.status_code == 200: - with open(outfilename, "wb") as f: - f.write(r.content) print "OK" else: print "An error has occured"