summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntanas Uršulis <antanas.ursulis@gmail.com>2013-07-18 01:03:19 +0300
committerAntanas Uršulis <antanas.ursulis@gmail.com>2013-07-18 01:03:19 +0300
commit5640153330f6ff8935009f1570563c48a088aef5 (patch)
tree29e4d62e64d709e74f14fca6b7522635e0cc7cf6
parentGroup logs by source hostname and add multiple-file submissions (diff)
downloadlog-analysis-5640153330f6ff8935009f1570563c48a088aef5.tar.gz
log-analysis-5640153330f6ff8935009f1570563c48a088aef5.tar.bz2
log-analysis-5640153330f6ff8935009f1570563c48a088aef5.zip
Send only filename, not full path
-rw-r--r--simple_client.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/simple_client.py b/simple_client.py
index 0335260..3abc7c9 100644
--- a/simple_client.py
+++ b/simple_client.py
@@ -2,14 +2,14 @@
Simple submission client that forms a correct protobuf message and performs a POST
"""
-import submission_pb2, sys, urllib
+import submission_pb2, sys, urllib, os
def send_submission(filenames):
submission = submission_pb2.Submission()
for f in filenames:
new_file = submission.files.add()
- new_file.filename = f
+ new_file.filename = os.path.basename(f)
new_file.data = open(f, 'rb').read()
print urllib.urlopen('http://[::1]:5000/submit', submission.SerializeToString()).read()