From 11c0c94d60e303f1d074fc622c32b3879784b90d Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Mon, 2 Mar 2015 00:45:40 +0100 Subject: reproducible: html_packages: catch a ENOENT in purge_old_pages() --- bin/reproducible_html_packages.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/reproducible_html_packages.py b/bin/reproducible_html_packages.py index 73b190aa..9b44cdaf 100755 --- a/bin/reproducible_html_packages.py +++ b/bin/reproducible_html_packages.py @@ -189,8 +189,12 @@ def purge_old_pages(): for suite in SUITES: for arch in ARCHES: log.info('Removing old pages from ' + suite + '...') - presents = sorted(os.listdir(RB_PKG_PATH + '/' + suite + '/' + - arch)) + try: + presents = sorted(os.listdir(RB_PKG_PATH + '/' + suite + '/' + + arch)) + except OSError as e: + if e.errno != errno.ENOENT: # that's 'No such file or + raise # directory' error (errno 17) for page in presents: pkg = page.rsplit('.', 1)[0] query = 'SELECT s.name ' + \ -- cgit v1.2.3-70-g09d2