mirror of
https://github.com/codingo/Interlace.git
synced 2025-12-17 23:04:24 +01:00
Fixed reference bug
This commit is contained in:
@@ -18,16 +18,28 @@ class InputHelper(object):
|
|||||||
|
|
||||||
return arg
|
return arg
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def expand_targets(targets):
|
||||||
|
# expand CIDR from net addr
|
||||||
|
# expand comma notation
|
||||||
|
|
||||||
|
# return list of unique hosts
|
||||||
|
return targets
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def process_targets(arguments):
|
def process_targets(arguments):
|
||||||
targets = set()
|
targets = set()
|
||||||
|
|
||||||
|
# build list of targets from file/input
|
||||||
if arguments.target:
|
if arguments.target:
|
||||||
targets.add(arguments.target)
|
targets.add(arguments.target)
|
||||||
else:
|
else:
|
||||||
for target in arguments.target_list:
|
for target in arguments.target_list:
|
||||||
targets.add(target.strip())
|
targets.add(target.strip())
|
||||||
|
|
||||||
|
# take list of targets and expand CIDR / comma notation
|
||||||
|
targets = set(arguments.expand_targets(targets))
|
||||||
|
|
||||||
return targets
|
return targets
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ class Pool(object):
|
|||||||
for thread in threads:
|
for thread in threads:
|
||||||
thread.join()
|
thread.join()
|
||||||
|
|
||||||
|
# test harness
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
tasks = ["sleep 1",
|
tasks = ["sleep 1",
|
||||||
"sleep 2",
|
"sleep 2",
|
||||||
|
|||||||
Reference in New Issue
Block a user