diff options
author | Niels de Vos <ndevos@redhat.com> | 2018-06-12 09:51:44 +0200 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-06-18 04:06:16 +0000 |
commit | 7005b1a336e483ec150c2f924a618dcfe197db0b (patch) | |
tree | ac640fa0d7abf116fddd9a05373c6d4e779a42d0 | |
parent | 3808d8d46ad2fab3f30c2c98283a13fc7170d495 (diff) |
gcron: create the lockfile if it is missing
The lockfile for the job may not exist yet. If that is the case, it
should be created upon the first time it is accessed.
Change-Id: I4da2b3ecdb79cc63ed82cc7bfa026c8f08d4d043
Fixes: bz#1590193
Signed-off-by: Niels de Vos <ndevos@redhat.com>
-rwxr-xr-x | extras/snap_scheduler/gcron.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/extras/snap_scheduler/gcron.py b/extras/snap_scheduler/gcron.py index b4c1146759b..de79562ceab 100755 --- a/extras/snap_scheduler/gcron.py +++ b/extras/snap_scheduler/gcron.py @@ -88,7 +88,7 @@ def takeSnap(volname="", snapname=""): def doJob(name, lockFile, jobFunc, volname): success = True try: - f = os.open(lockFile, os.O_RDWR | os.O_NONBLOCK) + f = os.open(lockFile, os.O_CREAT | os.O_RDWR | os.O_NONBLOCK) try: fcntl.flock(f, fcntl.LOCK_EX | fcntl.LOCK_NB) mtime = os.path.getmtime(lockFile) |