From 55ca454b924758dbd1804b3f4d1e4eb579354f0e Mon Sep 17 00:00:00 2001 From: Alexandre Dulaunoy Date: Fri, 6 Nov 2015 11:22:38 +0100 Subject: [PATCH] Auth parameters updated --- examples/upload.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/examples/upload.py b/examples/upload.py index 5148b51..f3080a8 100755 --- a/examples/upload.py +++ b/examples/upload.py @@ -2,8 +2,7 @@ # -*- coding: utf-8 -*- from pymisp import PyMISP -from keys import url_priv, key_priv -# from keys import url_cert, key_cert +from keys import misp_url, misp_key import argparse import os import glob @@ -15,11 +14,7 @@ def init(url, key): def upload_files(m, eid, paths, distrib, ids, categ, info, analysis, threat): out = m.upload_samplelist(paths, eid, distrib, ids, categ, info, analysis, threat) - if out.status_code == 200: - print("Files uploaded sucessfully") - else: - print("Something failed: {}".format(out.text)) - + print(out) if __name__ == '__main__': parser = argparse.ArgumentParser(description='Send malware sample to MISP.') @@ -33,8 +28,7 @@ if __name__ == '__main__': parser.add_argument("-t", "--threat", type=int, help="The threat level ID of the newly created event, if applicatble. [0-3]") args = parser.parse_args() - misp = init(url_priv, key_priv) - # misp = init(url_cert, key_cert) + misp = init(misp_url, misp_key) files = [] if os.path.isfile(args.upload):