From d3ef1a559452cc15e0db0ec61bcad19b0bb841a9 Mon Sep 17 00:00:00 2001
From: Nico Harringer <nico.harringer@cern.ch>
Date: Thu, 30 May 2024 20:27:54 +0200
Subject: [PATCH] Fix prepare output file

---
 scripts/postprocessing/prepare_output_file.py | 27 +++++++------------
 1 file changed, 10 insertions(+), 17 deletions(-)

diff --git a/scripts/postprocessing/prepare_output_file.py b/scripts/postprocessing/prepare_output_file.py
index 8525d023..2e115529 100644
--- a/scripts/postprocessing/prepare_output_file.py
+++ b/scripts/postprocessing/prepare_output_file.py
@@ -155,13 +155,6 @@ parser.add_option(
     default=False,
     help="Flag for merging data to an allData file.",
 )
-parser.add_option(
-    "--condor-logs",
-    dest="condor_logs",
-    type="string",
-    default="",
-    help="Output path of the Condor Log files.",
-)
 parser.add_option(
     "--max-materialize",
     dest="max_materialize",
@@ -659,7 +652,7 @@ else:
                             submit_file.write("periodic_release =  (NumJobStarts < 3) && ((CurrentTime - EnteredCurrentStatus) > 600)\n")
                             submit_file.write("getenv = True\n")
                             if opt.max_materialize != "": submit_file.write(f"max_materialize = {opt.max_materialize}\n")
-	                        submit_file.write("max_retries = 3\n")
+                            submit_file.write("max_retries = 3\n")
                             submit_file.write("requirements = Machine =!= LastRemoteHost\n")
                             submit_file.write(f'+JobFlavour = "microcentury"\n')
                             submit_file.write('+AccountingGroup = "group_u_CMS.u_zh.users"\n')
@@ -939,15 +932,15 @@ else:
 
     if not opt.condor:
     # We don't want to leave trash around
-    if os.path.exists(dirlist_path):
-        os.system(f"rm {dirlist_path}")
-    if opt.output == "":
-        if os.path.exists(f"{SCRIPT_DIR}/../../higgs_dna/category.json"):
-            os.system(f"rm {SCRIPT_DIR}/../../higgs_dna/category.json")
-        if os.path.exists(f"{SCRIPT_DIR}/../../higgs_dna/variation.json"):
-            os.system(f"rm {SCRIPT_DIR}/../../higgs_dna/variation.json")
-
-    else:
+        if os.path.exists(dirlist_path):
+            os.system(f"rm {dirlist_path}")
+        if opt.output == "":
+            if os.path.exists(f"{SCRIPT_DIR}/../../higgs_dna/category.json"):
+                os.system(f"rm {SCRIPT_DIR}/../../higgs_dna/category.json")
+            if os.path.exists(f"{SCRIPT_DIR}/../../higgs_dna/variation.json"):
+                os.system(f"rm {SCRIPT_DIR}/../../higgs_dna/variation.json")
+
+    elif (opt.condor) and (opt.root):
         if os.path.exists(f"{OUT_PATH}/category.json"):
             os.system(f"rm {OUT_PATH}/category.json")
         if os.path.exists(f"{OUT_PATH}/variation.json"):
-- 
GitLab