diff options
author | Mattia Rizzolo <mattia@mapreri.org> | 2015-09-22 21:53:20 +0000 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-09-22 23:56:14 +0200 |
commit | 0d0494618ae22303fc4761f7ba65bd4575aba8f7 (patch) | |
tree | 1478dd74527bbe3009a67bc4b240134c3f5ba6a1 /bin | |
parent | d91692119e074964a8b76ff1394b22600b71b387 (diff) | |
download | jenkins.debian.net-0d0494618ae22303fc4761f7ba65bd4575aba8f7.tar.xz |
reproducible: _breakages: wrap a a os.path call in a try/excpet to catch FileNotFoundError and not choke on it
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/reproducible_html_breakages.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/bin/reproducible_html_breakages.py b/bin/reproducible_html_breakages.py index 19fdd0c7..67698f16 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 |