Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions nettacker/core/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,26 +118,25 @@ def generate_loops(self):
self.module_content["payloads"] = expand_module_steps(self.module_content["payloads"])

def sort_loops(self):
steps = []
for index in range(len(self.module_content["payloads"])):
for step in copy.deepcopy(self.module_content["payloads"][index]["steps"]):
if "dependent_on_temp_event" not in step[0]["response"]:
steps.append(step)
steps_without_dependencies = []
steps_with_temp_dependencies = []
steps_with_normal_dependencies = []

for step in copy.deepcopy(self.module_content["payloads"][index]["steps"]):
if (
"dependent_on_temp_event" in step[0]["response"]
and "save_to_temp_events_only" in step[0]["response"]
):
steps.append(step)
resp = step[0]["response"]
if "dependent_on_temp_event" not in resp:
steps_without_dependencies.append(step)
elif "save_to_temp_events_only" in resp:
steps_with_temp_dependencies.append(step)
else:
steps_with_normal_dependencies.append(step)

for step in copy.deepcopy(self.module_content["payloads"][index]["steps"]):
if (
"dependent_on_temp_event" in step[0]["response"]
and "save_to_temp_events_only" not in step[0]["response"]
):
steps.append(step)
self.module_content["payloads"][index]["steps"] = steps
self.module_content["payloads"][index]["steps"] = (
steps_without_dependencies
+ steps_with_temp_dependencies
+ steps_with_normal_dependencies
)

def start(self):
active_threads = []
Expand Down