mirror of https://github.com/MISP/misp-modules
chg: [apiosintds] make flake8 happy
parent
36d9873d8c
commit
dec2494a0a
|
@ -25,6 +25,7 @@ moduleinfo = {'version': '0.1', 'author': 'Davide Baglieri aka davidonzo',
|
||||||
|
|
||||||
moduleconfig = ['import_related_hashes', 'cache', 'cache_directory']
|
moduleconfig = ['import_related_hashes', 'cache', 'cache_directory']
|
||||||
|
|
||||||
|
|
||||||
def handler(q=False):
|
def handler(q=False):
|
||||||
if q is False:
|
if q is False:
|
||||||
return False
|
return False
|
||||||
|
@ -85,7 +86,7 @@ def handler(q=False):
|
||||||
misperrors['error'] = ErrorMSG
|
misperrors['error'] = ErrorMSG
|
||||||
return misperrors
|
return misperrors
|
||||||
else:
|
else:
|
||||||
log.debug("Cache option is set to "+request['config'].get('cache')+". You are not using the internal cache system and this is NOT recommended!")
|
log.debug("Cache option is set to " + request['config'].get('cache') + ". You are not using the internal cache system and this is NOT recommended!")
|
||||||
log.debug("Please, consider to turn on the cache setting it to 'Yes' and specifing a writable directory for the cache directory option.")
|
log.debug("Please, consider to turn on the cache setting it to 'Yes' and specifing a writable directory for the cache directory option.")
|
||||||
try:
|
try:
|
||||||
response = apiosintDS.request(entities=tosubmit, cache=submitcache, cachedirectory=submitcache_directory, verbose=True)
|
response = apiosintDS.request(entities=tosubmit, cache=submitcache, cachedirectory=submitcache_directory, verbose=True)
|
||||||
|
@ -97,6 +98,7 @@ def handler(q=False):
|
||||||
misperrors['error'] = str(e)
|
misperrors['error'] = str(e)
|
||||||
return r
|
return r
|
||||||
|
|
||||||
|
|
||||||
def apiosintParser(response, import_related_hashes):
|
def apiosintParser(response, import_related_hashes):
|
||||||
ret = []
|
ret = []
|
||||||
if isinstance(response, dict):
|
if isinstance(response, dict):
|
||||||
|
@ -133,9 +135,11 @@ def apiosintParser(response, import_related_hashes):
|
||||||
ret.append({"types": ["text"], "values": [comment]})
|
ret.append({"types": ["text"], "values": [comment]})
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
def introspection():
|
def introspection():
|
||||||
return mispattributes
|
return mispattributes
|
||||||
|
|
||||||
|
|
||||||
def version():
|
def version():
|
||||||
moduleinfo['config'] = moduleconfig
|
moduleinfo['config'] = moduleconfig
|
||||||
return moduleinfo
|
return moduleinfo
|
||||||
|
|
Loading…
Reference in New Issue