Fix for working with latest version

It seems that the latest version of pyMISP or MISP itself has changed it data structure. After reviewing the response, this change seemed logical and it is working (at least for me).
pull/57/head
Jeffrey E 2018-12-19 12:26:06 +01:00 committed by GitHub
parent 94767a47dd
commit b29be6a1b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -66,7 +66,7 @@ def post_stix(manager, content_block, collection_ids, service_id):
for attrib in values:
log.info("Checking for existence of %s", attrib)
search = MISP.search("attributes", values=str(attrib))
if search["response"] != []:
if search["response"]["Attribute"] != []:
# This means we have it!
log.info("%s is a duplicate, we'll ignore it.", attrib)
package.attributes.pop([x.value for x in package.attributes].index(attrib))