Skip to content

Commit b3125f3

Browse files
committed
utility/utility_helper.py
1 parent ff40a50 commit b3125f3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

total_replay/utility/utility_helper.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -370,13 +370,13 @@ def locate_associated_attack_data_yaml_file(self, attack_data_link:str, attack_d
370370
if attack_id:
371371
needed_yaml_field_cache['attack_data_uuid'] = attack_data_yaml_buff['id']
372372
ColorPrint.print_success_fg(f"[+][SUCCESS]: ... {file} ==> associated yml file extracted successfully")
373-
break
373+
return needed_yaml_field_cache
374374
else:
375375
ColorPrint.print_warning_fg(f"[!][WARNING]: ... attack_data yaml field: [uuid] => not found!!")
376-
else:
377-
continue
378-
379-
return needed_yaml_field_cache
376+
else:
377+
# This runs ONLY if the loop never hits 'return' or 'break'
378+
ColorPrint.print_error_fg("[-][ERROR]: No matching YAML file was found during iteration!")
379+
return {}
380380

381381
def create_metadata_cache(self, yaml_data: yaml) -> dict:
382382
"""Create a metadata cache from the YAML data."""
@@ -474,7 +474,7 @@ def attack_data_replay_cmd(self, needed_replay_yaml_field:dict, index_value:str)
474474
attack_data_yml_file_path = needed_replay_yaml_field['attack_data_yml_file_path']
475475

476476
if not os.path.isdir(os.path.expanduser(self.read_config_settings('attack_data_dir_path'))):
477-
ColorPrint.print_error_fg("[+][. ERROR]: ... The attack data folder path in config is invalid or not exist.")
477+
ColorPrint.print_error_fg("[-][. ERROR]: ... The attack data folder path in config is invalid or not exist.")
478478
return False
479479

480480
try:

0 commit comments

Comments
 (0)