From e47765f09fc625fde0a831e410c08901f1234fb9 Mon Sep 17 00:00:00 2001 From: pyth0n1c <87383215+pyth0n1c@users.noreply.github.com> Date: Tue, 17 May 2022 20:01:45 -0700 Subject: [PATCH] Fixing error introduced when sorting steps in initialize. --- .../contentctl_core/application/use_cases/initialize.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/contentctl_project/contentctl_core/application/use_cases/initialize.py b/bin/contentctl_project/contentctl_core/application/use_cases/initialize.py index dae0d5eacf..7929fb7787 100644 --- a/bin/contentctl_project/contentctl_core/application/use_cases/initialize.py +++ b/bin/contentctl_project/contentctl_core/application/use_cases/initialize.py @@ -180,7 +180,7 @@ class Initialize: def remove_all_content(self)-> bool: errors = [] - #Sort the steps so they are performced alphabetically + #List out all the steps we will have to take steps = [(self.remove_detections,"Removing Detections"), (self.remove_baselines,"Removing Baselines"), (self.remove_investigations,"Removing Investigations"), @@ -190,7 +190,9 @@ class Initialize: (self.remove_playbooks,"Removing Playbooks"), (self.remove_stories,"Removing Stores"), (self.remove_tests,"Removing Tests"), - (self.remove_dist_lookups,"Removing Dist Lookups")].sort(key=lambda name: name[1]) + (self.remove_dist_lookups,"Removing Dist Lookups")] + #Sort the steps so they are performced alphabetically + steps.sort(key=lambda name: name[1]) for func, text in steps: print(f"{text}...",end='')