[Piuparts-commits] [SCM] piuparts git repository branch, develop, updated. 0.42-68-g205fdcb
Andreas Beckmann
debian at abeckmann.de
Mon May 14 12:02:15 UTC 2012
The following commit has been merged in the develop branch:
commit b1c54fe5032186ae1b7bb0588fed8997392caca3
Author: Andreas Beckmann <debian at abeckmann.de>
Date: Sun Apr 15 18:57:09 2012 +0200
report: catch logfile copy-delete race
logfiles (especially in reserved/) may be deleted externally
while being copied to htdocs/...
Traceback (most recent call last):
File "/org/piuparts.debian.org/share/piuparts/piuparts-report", line 1212, in <module>
main()
File "/org/piuparts.debian.org/share/piuparts/piuparts-report", line 1180, in main
section.generate_output(master_directory=master_directory,output_directory=output_directory,section_names=section_names)
File "/org/piuparts.debian.org/share/piuparts/piuparts-report", line 1153, in generate_output
self.generate_html()
File "/org/piuparts.debian.org/share/piuparts/piuparts-report", line 1117, in generate_html
copy_logs(logs_by_dir, self._output_directory)
File "/org/piuparts.debian.org/share/piuparts/piuparts-report", line 548, in copy_logs
update_file(source, target)
File "/org/piuparts.debian.org/share/piuparts/piuparts-report", line 537, in update_file
shutil.copyfile(source, target)
File "/usr/lib/python2.6/shutil.py", line 50, in copyfile
with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: 'reserved/nagios3-dbg_3.2.1-2.log'
Signed-off-by: Andreas Beckmann <debian at abeckmann.de>
diff --git a/debian/changelog b/debian/changelog
index 472ae43..a4f4abc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -32,6 +32,7 @@ piuparts (0.44) UNRELEASED; urgency=low
- Add link to the list of untestable logs.
- Add more known problem reports: forgotten alternatives, warnings in
passed logs: leftover files and failed maintainer scripts.
+ - Do not abort if logfiles disappear during copying.
* Makefile: Install documentation with mode 0644 instead of 0755.
[ Holger Levsen ]
diff --git a/piuparts-report.py b/piuparts-report.py
index 3a7b6ef..3b44439 100644
--- a/piuparts-report.py
+++ b/piuparts-report.py
@@ -504,7 +504,10 @@ def update_file(source, target):
bb = os.stat(target)
if aa.st_size == bb.st_size and aa.st_mtime < bb.st_mtime:
return
- shutil.copyfile(source, target)
+ try:
+ shutil.copyfile(source, target)
+ except IOError as (errno, strerror):
+ logging.error("failed to copy %s to %s: I/O error(%d): %s" % (source, target, errno, strerror))
def copy_logs(logs_by_dir, output_dir):
--
piuparts git repository
More information about the Piuparts-commits
mailing list