summaryrefslogtreecommitdiffstats
path: root/extras/snap_scheduler
diff options
context:
space:
mode:
authorAvra Sengupta <asengupt@redhat.com>2015-06-09 17:49:23 +0530
committerKrishnan Parthasarathi <kparthas@redhat.com>2015-06-11 04:50:22 -0700
commit04722f44fd05ce8b247e18034c1e261a7734a827 (patch)
treea8bd4a65a3f20e9957e5de4199b0c36c31fb9de4 /extras/snap_scheduler
parentbc743c012aca8b5854baf1b71a9ec9591c378645 (diff)
snapshot/scheduler: Check if GCRON_TASKS exists before
accessing it's mtime Backport of http://review.gluster.org/#/c/11138/ Change-Id: I873c83d21620527b20d7de428d11582c5499d1af BUG: 1230167 Signed-off-by: Avra Sengupta <asengupt@redhat.com> (cherry picked from commit 5b05d3e376e984f00528f5bf2f0febd0220ca91f) Reviewed-on: http://review.gluster.org/11159 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'extras/snap_scheduler')
-rwxr-xr-xextras/snap_scheduler/gcron.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/extras/snap_scheduler/gcron.py b/extras/snap_scheduler/gcron.py
index e67e48cc932..a21c40f894f 100755
--- a/extras/snap_scheduler/gcron.py
+++ b/extras/snap_scheduler/gcron.py
@@ -120,6 +120,10 @@ def main():
initLogger(script_name)
global start_time
if sys.argv[1] == "--update":
+ if not os.path.exists(GCRON_TASKS):
+ return
+ if not os.path.exists(GCRON_CROND_TASK):
+ return
if os.lstat(GCRON_TASKS).st_mtime > \
os.lstat(GCRON_CROND_TASK).st_mtime:
try: