Skip to content

Commit

Permalink
removed ipsetting altogether
Browse files Browse the repository at this point in the history
  • Loading branch information
pry authored and pry committed Jan 20, 2021
1 parent f38bb59 commit 64ef017
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions Interlace/lib/core/input.py
Expand Up @@ -218,23 +218,8 @@ def parse_and_group_target_specs(target_specs, nocidr):
str_targets = set()
ipset_targets = IPSet()
for target_spec in target_specs:
if (
target_spec.startswith(".") or
(target_spec[0].isalpha() or target_spec[-1].isalpha()) or
(nocidr and "/" in target_spec)
):
str_targets.add(target_spec)
else:
if "-" in target_spec:
start_ip, post_dash_segment = target_spec.split("-")
end_ip = start_ip.rsplit(".", maxsplit=1)[0] + "." + \
post_dash_segment
target_spec = IPRange(start_ip, end_ip)
elif "*" in target_spec:
target_spec = glob_to_iprange(target_spec)
else: # str IP addresses and str CIDR notations
target_spec = (target_spec,)
ipset_targets.update(IPSet(target_spec))
str_targets.add(target_spec)

return (str_targets, ipset_targets)

str_targets, ipset_targets = parse_and_group_target_specs(
Expand Down

0 comments on commit 64ef017

Please sign in to comment.