aboutsummaryrefslogtreecommitdiff
path: root/rpkid/rpki/gui/cacheview/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'rpkid/rpki/gui/cacheview/util.py')
-rw-r--r--rpkid/rpki/gui/cacheview/util.py12
1 files changed, 10 insertions, 2 deletions
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: