diff options
authorNiels de Vos <>2018-06-12 09:49:09 +0200
committerNiels de Vos <>2018-06-18 13:20:33 +0000
commitdcdd8f1fae0d748cfd31a782efd48d6773c91740 (patch)
parentabe2e42666f7f8652f17ff8e110b5c8caec1ab16 (diff)
gcron: catch OSError as well as IOError
In case fails because the file does not exist, an OSError is raised. To prevent the script to abort uncleanly, catch the OSError in addition to the IOError. Change-Id: I48e5b23e17d63639cc33db51b4229249a9887880 Fixes: bz#1559829 Signed-off-by: Niels de Vos <> (cherry picked from commit 26b52694feb04c98e6c9436bcd4e23e1687f0237)
1 files changed, 2 insertions, 2 deletions
diff --git a/extras/snap_scheduler/ b/extras/snap_scheduler/
index d720578..4a2ae71 100755
--- a/extras/snap_scheduler/
+++ b/extras/snap_scheduler/
@@ -105,10 +105,10 @@ def doJob(name, lockFile, jobFunc, volname):
else:"Job %s has been processed already", name)
fcntl.flock(f, fcntl.LOCK_UN)
- except IOError as (errno, strerror):
+ except (OSError, IOError) as (errno, strerror):"Job %s is being processed by another agent", name)
- except IOError as (errno, strerror):
+ except (OSError, IOError) as (errno, strerror):
log.debug("Failed to open lock file %s : %s", lockFile, strerror)
log.error("Failed to process job %s", name)
success = False