01291cd79ec246a80e79856a5c1f724d55aa39cd
lrnassar
  Fri Feb 14 11:33:30 2025 -0800
Moving up the user var declaration, I had left it below its first use when I added the unfinished run cleanup.

diff --git src/utils/qa/assemblyStatsCron.py src/utils/qa/assemblyStatsCron.py
index aba7b5eb6e3..664ebf79221 100755
--- src/utils/qa/assemblyStatsCron.py
+++ src/utils/qa/assemblyStatsCron.py
@@ -14,36 +14,36 @@
         bashStdoutt = rawBashOutput.stdout
     except subprocess.CalledProcessError as e:
         raise RuntimeError("command '{}' return with error (code {}): {}".format(e.cmd, e.returncode, e.output))
     return(bashStdoutt)
 
 def bashNoErrorCatch(cmd):
     """Run the cmd in bash subprocess, don't catch error since grep returns exit code 1 when no match is found"""
     try:
         rawBashOutput = subprocess.run(cmd, check=True, shell=True,\
                                        stdout=subprocess.PIPE, universal_newlines=True, stderr=subprocess.STDOUT)
         bashStdoutt = rawBashOutput.stdout.rstrip().split("\n")
     except:
         bashStdoutt = []
     return(bashStdoutt)
 
+user = getpass.getuser()
+
 #Clean out any previous unfinished run
 bash("rm -f /hive/users/"+user+"/ErrorLogs/*")
 bash("rm -f /hive/users/"+user+"/ErrorLogsOutput/*")
 
-user = getpass.getuser()
-
 # Get the year to query proper wwwstats directory
 today = datetime.datetime.today()
 year = str(today).split('-')[0]
 
 # Get the last 5 error logs from the RR
 latestLogs = bash('ls /hive/users/chmalee/logs/trimmedLogs/result/hgw1').rstrip().split("\n")
 
 ######################## TESTING MODE - ONLY PROCESS MINIMAL AMOUNT OF LOGS ########################
 testMode = False #Set true for testing mode
 #################################################################################################
 
 if testMode: #Default is one RR log and one asia log
     latestLogs = latestLogs[len(latestLogs)-1:]
     nodes = ['RR', 'asiaNode'] #Add nodes with error logs, nodes can be added or removed
     machines = ['hgw1'] #Add hgw machines to check