[Qa-jenkins-scm] [jenkins.debian.net] 01/01: reproducible: _breakages: wrap a a os.path call in a try/excpet to catch FileNotFoundError and not choke on it

Holger Levsen holger at moszumanska.debian.org
Tue Sep 22 21:56:34 UTC 2015


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit 0d0494618ae22303fc4761f7ba65bd4575aba8f7
Author: Mattia Rizzolo <mattia at mapreri.org>
Date:   Tue Sep 22 21:53:20 2015 +0000

    reproducible: _breakages: wrap a a os.path call in a try/excpet to catch FileNotFoundError and not choke on it
---
 bin/reproducible_html_breakages.py | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/bin/reproducible_html_breakages.py b/bin/reproducible_html_breakages.py
index 19fdd0c..67698f1 100755
--- a/bin/reproducible_html_breakages.py
+++ b/bin/reproducible_html_breakages.py
@@ -147,11 +147,14 @@ def alien_log(directory=None):
                              + bcolors.ENDC)
                 continue
             if not query_db(query.format(pkg=pkg, suite=suite, arch=arch)):
-                if os.path.getmtime('/'.join([root, file]))<time.time()-1800:
-                    bad_files.append('/'.join([root, file]))
-                    log.warning('/'.join([root, file]) + ' should not be there')
-                else:
-                    log.info('ignoring ' + '/'.join([root, file]) + ' which should not be there, but is also less than 30m old and will probably soon be gone.')
+                try:
+                    if os.path.getmtime('/'.join([root, file]))<time.time()-1800:
+                        bad_files.append('/'.join([root, file]))
+                        log.warning('/'.join([root, file]) + ' should not be there')
+                    else:
+                        log.info('ignoring ' + '/'.join([root, file]) + ' which should not be there, but is also less than 30m old and will probably soon be gone.')
+                except FileNotFoundError:
+                    pass  # that bad file is already gone.
     return bad_files
 
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list