From 7d85a13fafccf9ef9276a4a1d5f91f8c4c86f44c Mon Sep 17 00:00:00 2001 From: prodigysml Date: Tue, 11 Feb 2020 10:55:08 +1100 Subject: [PATCH 1/2] Fixed issue with dup clean target command creation --- Interlace/lib/core/input.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Interlace/lib/core/input.py b/Interlace/lib/core/input.py index a8a7b32..791d94d 100644 --- a/Interlace/lib/core/input.py +++ b/Interlace/lib/core/input.py @@ -172,9 +172,14 @@ class InputHelper(object): variable = '_cleantarget_' tasks = [] temp = set() # this helps avoid command duplication and re/deconstructing of temporary set - for command in commands: - for dirty_target in dirty_targets: + # changed order to ensure different combinations of commands aren't created + for dirty_target in dirty_targets: + for command in commands: if command.name().find(variable) != -1: + new_task = command.clone() + + new_task.replace("_target_", dirty_target) + # replace all https:// or https:// with nothing dirty_target = dirty_target.replace('http://', '') dirty_target = dirty_target.replace('https://', '') @@ -183,11 +188,12 @@ class InputHelper(object): dirty_target = dirty_target.strip('/') # replace all remaining '/' with '-' and that's enough cleanup for the day clean_target = dirty_target.replace('/', '-') - new_task = command.clone() new_task.replace(variable, clean_target) add_task(new_task, tasks, temp) else: + command.replace("_target_", dirty_target) add_task(command, tasks, temp) + return tasks @staticmethod @@ -273,9 +279,9 @@ class InputHelper(object): else: commands = InputHelper._pre_process_commands(arguments.command_list) - commands = InputHelper._replace_variable_with_commands(commands, "_target_", targets) - commands = InputHelper._replace_variable_with_commands(commands, "_host_", targets) + # commands = InputHelper._replace_variable_with_commands(commands, "_target_", targets) commands = InputHelper._process_clean_targets(commands, targets) + commands = InputHelper._replace_variable_with_commands(commands, "_host_", targets) if arguments.port: commands = InputHelper._replace_variable_with_commands(commands, "_port_", ports) From 3b5ecb10105b8349b16984207f41d5116c25e6e0 Mon Sep 17 00:00:00 2001 From: prodigysml Date: Tue, 11 Feb 2020 10:55:39 +1100 Subject: [PATCH 2/2] Version increment done, as fix was applied --- Interlace/lib/core/__version__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Interlace/lib/core/__version__.py b/Interlace/lib/core/__version__.py index 043606c..89962bf 100644 --- a/Interlace/lib/core/__version__.py +++ b/Interlace/lib/core/__version__.py @@ -1 +1 @@ -__version__ = '1.7.4' +__version__ = '1.7.5'