community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1719942 - /comdev/projects.apache.org/scripts/cronjobs/parseprojects.py
Date Mon, 14 Dec 2015 15:41:23 GMT
Author: sebb
Date: Mon Dec 14 15:41:23 2015
New Revision: 1719942

URL: http://svn.apache.org/viewvc?rev=1719942&view=rev
Log:
Only use previous failure data if specifically requested
Ensure the failure data is removed if run is successful

Modified:
    comdev/projects.apache.org/scripts/cronjobs/parseprojects.py

Modified: comdev/projects.apache.org/scripts/cronjobs/parseprojects.py
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/scripts/cronjobs/parseprojects.py?rev=1719942&r1=1719941&r2=1719942&view=diff
==============================================================================
--- comdev/projects.apache.org/scripts/cronjobs/parseprojects.py (original)
+++ comdev/projects.apache.org/scripts/cronjobs/parseprojects.py Mon Dec 14 15:41:23 2015
@@ -26,8 +26,13 @@ parseprojects-failures.xml (if failures
 projectsList = "../../data/projects.xml";
 save = True;
 if os.path.exists("parseprojects-failures.xml"):
-    projectsList = "parseprojects-failures.xml";
-    save = False;
+    # Only use restart data if requested (e.g. when running interactively)
+    if 'restart' in sys.argv:
+        projectsList = "parseprojects-failures.xml";
+        save = False;
+    else:
+        print("Previous run failed, ignoring restart data")
+
 with open(projectsList, "r") as f:
     data  = f.read()
     f.close()
@@ -228,5 +233,12 @@ if len(failures) > 0:
             f.write("<location>%s</location>\n" % fail)
         f.write("</doapFiles>\n")
         f.close()
+else:
+    if os.path.exists("parseprojects-failures.xml"):
+        print("No failures detected, removing previous failure data")
+        try:
+            os.remove("parseprojects-failures.xml")
+        except FileNotFoundError: # should not happen
+            pass
 
 print("Done!")



Mime
View raw message