Module: check_mk
Branch: master
Commit: 908e722884125f2d1f3d64f1aa25b337be86bb9b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=908e722884125f…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Mar 27 11:51:17 2017 +0200
Crawl test: Only copy web.log when it exists
Change-Id: Ib320bb2b4284641ee28492cb9a7b9a1668a9057b
---
tests/web/test_crawl.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tests/web/test_crawl.py b/tests/web/test_crawl.py
index f3ee934..58c78bd 100644
--- a/tests/web/test_crawl.py
+++ b/tests/web/test_crawl.py
@@ -385,7 +385,8 @@ class TestCrawler(object):
os.rename(self.report_file()+".tmp", self.report_file())
# Save the web.log for later diagnose
- shutil.copyfile(self.site.read_file("var/log/web.log"),
self.web_log_file())
+ if self.site.file_exists("var/log/web.log"):
+ shutil.copyfile(self.site.read_file("var/log/web.log"),
self.web_log_file())
if self.errors:
pytest.fail("Crawled %d URLs in %d seconds. Failures:\n%s" %