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
|
||||
|
||||
@staticmethod
|
||||
def expand_targets(targets):
|
||||
# expand CIDR from net addr
|
||||
# expand comma notation
|
||||
|
||||
# return list of unique hosts
|
||||
return targets
|
||||
|
||||
@staticmethod
|
||||
def process_targets(arguments):
|
||||
targets = set()
|
||||
|
||||
# build list of targets from file/input
|
||||
if arguments.target:
|
||||
targets.add(arguments.target)
|
||||
else:
|
||||
for target in arguments.target_list:
|
||||
targets.add(target.strip())
|
||||
|
||||
# take list of targets and expand CIDR / comma notation
|
||||
targets = set(arguments.expand_targets(targets))
|
||||
|
||||
return targets
|
||||
|
||||
@staticmethod
|
||||
|
||||
@@ -58,6 +58,7 @@ class Pool(object):
|
||||
for thread in threads:
|
||||
thread.join()
|
||||
|
||||
# test harness
|
||||
if __name__ == "__main__":
|
||||
tasks = ["sleep 1",
|
||||
"sleep 2",
|
||||
|
||||
Reference in New Issue
Block a user