Skip to content
Permalink
Browse files
Merge pull request #1 from apache/cml/return_all
return all results from a ban search
  • Loading branch information
Humbedooh committed Sep 8, 2020
2 parents 882378b + fdc8f12 commit 9a885518bfab8891590652c915119ad99e2eaf94
Showing 1 changed file with 2 additions and 6 deletions.
@@ -112,7 +112,7 @@ def run(API, environ, indata, session):
doc['ip'] = doc['rid'].replace('_', '/')
found['banlist'].append(doc)

# Find any iptables rules that may have it as well (max 10)
# Find any iptables rules that may have it as well
found_iptables = 0
anything = netaddr.IPNetwork("0.0.0.0/0")
for host in iptables:
@@ -123,14 +123,10 @@ def run(API, environ, indata, session):
rule['ip'] = str(rule['ip']) # stringify
found['iptables'].append(rule)
found_iptables += 1
if found_iptables == 10:
break
if found_iptables == 10:
break

yield json.dumps({"results": found}, indent = 2)
return

# Finally, if we hit a method we don't know, balk!
yield API.exception(400, "I don't know this request method!!")


0 comments on commit 9a88551

Please sign in to comment.