From de1827f6dc6c171c0dc6887f3ba871e0f77211fa Mon Sep 17 00:00:00 2001 From: Michael Elkins Date: Mon, 23 Sep 2013 16:24:30 +0000 Subject: catch OSError when calling os.stat() and treat the object as if it were missing from rcynic.xml see #625 svn path=/trunk/; revision=5512 --- rpkid/rpki/gui/cacheview/util.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'rpkid/rpki/gui/cacheview/util.py') diff --git a/rpkid/rpki/gui/cacheview/util.py b/rpkid/rpki/gui/cacheview/util.py index de683e98..0e6e0973 100644 --- a/rpkid/rpki/gui/cacheview/util.py +++ b/rpkid/rpki/gui/cacheview/util.py @@ -177,8 +177,16 @@ def save_statuses(statuses): else: inst = inst_qs[0] - # determine if the object is changed/new - mtime = os.stat(vs.filename)[stat.ST_MTIME] + try: + # determine if the object is changed/new + mtime = os.stat(vs.filename)[stat.ST_MTIME] + except OSError as e: + logger.error('unable to stat %s: %s %s' % ( + vs.filename, type(e), e)) + # treat as if missing from rcynic.xml + inst.delete() + return + if mtime != inst.mtime: inst.mtime = mtime try: -- cgit v1.2.3