Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(635)

Unified Diff: webkit/tools/layout_tests/layout_package/http_server.py

Issue 149263: Remove old log files so they don't accumulate on try bots. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/layout_tests/layout_package/http_server.py
===================================================================
--- webkit/tools/layout_tests/layout_package/http_server.py (revision 20031)
+++ webkit/tools/layout_tests/layout_package/http_server.py (working copy)
@@ -25,6 +25,13 @@
def PathFromBase(*pathies):
return google.path_utils.FindUpward(THISDIR, *pathies)
+def RemoveLogFiles(folder, starts_with):
+ files = os.listdir(folder)
+ for file in files:
+ if file.startswith(starts_with) :
+ full_path = os.path.join(folder, file)
+ os.remove(full_path)
+
class HttpdNotStarted(Exception):
pass
@@ -104,6 +111,10 @@
log_file_name = "error.log-" + time_str + ".txt"
error_log = os.path.join(self._output_dir, log_file_name)
+ # Remove old log files. We only need to keep the last ones.
+ RemoveLogFiles(self._output_dir, "access.log-")
+ RemoveLogFiles(self._output_dir, "error.log-")
+
# Write out the config
f = file(base_conf_file, 'rb')
base_conf = f.read()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698