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

Unified Diff: infra_libs/logs/logs.py

Issue 1527843002: infra_libs/logs: Check if log directory exists. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 5 years 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: infra_libs/logs/logs.py
diff --git a/infra_libs/logs/logs.py b/infra_libs/logs/logs.py
index abd5165f908511a724e24561d464d7f528fb6445..2a32786d825f49164ea6ca0c515281d650b3f678 100644
--- a/infra_libs/logs/logs.py
+++ b/infra_libs/logs/logs.py
@@ -258,6 +258,9 @@ def _add_file_handlers(options, logger): # pragma: no cover
# running locally on developers' workstations.
logs_directory = tempfile.gettempdir()
for directory in options.logs_directory.split(os.pathsep):
+ if not os.path.isdir(directory):
+ continue
+
try:
with tempfile.TemporaryFile(dir=directory):
pass
« 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