diff options
author | Avra Sengupta <asengupt@redhat.com> | 2015-06-09 17:49:23 +0530 |
---|---|---|
committer | Krishnan Parthasarathi <kparthas@redhat.com> | 2015-06-10 03:02:20 -0700 |
commit | 5b05d3e376e984f00528f5bf2f0febd0220ca91f (patch) | |
tree | 76b09e2948ec30622dd970544840ba5213cf2d1a /extras | |
parent | 00f9a61fe8884062c141edd662424625d349a377 (diff) |
snapshot/scheduler: Check if GCRON_TASKS exists before
accessing it's mtime
Change-Id: I873c83d21620527b20d7de428d11582c5499d1af
BUG: 1228613
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/11138
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')
-rwxr-xr-x | extras/snap_scheduler/gcron.py | 4 |
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: |