diff options
author | Avra Sengupta <asengupt@redhat.com> | 2015-04-29 12:02:05 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2015-05-06 04:17:24 -0700 |
commit | eeb41c11aeba4de93e979dfefc4d4c60b26d9447 (patch) | |
tree | 8d1ab89446944d06506167ffa3b3cd3a04c62c82 /extras | |
parent | 0758307635ec429e8d0081df2acea8c14478cc53 (diff) |
snapshot/scheduler: Use shutil.move instead of os.rename()
os.rename is a wrapper on top of the rename function,
which fails with invalid cross-device link if /tmp
is a tmpfs. Hence using shutil.move
Change-Id: Ia026d2a810b725ccd398db895e612c53bc6a2f95
BUG: 1218575
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/10347
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Aravinda VK <avishwan@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/10560
Diffstat (limited to 'extras')
-rwxr-xr-x | extras/snap_scheduler/snap_scheduler.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/extras/snap_scheduler/snap_scheduler.py b/extras/snap_scheduler/snap_scheduler.py index e7e5fda812f..68ac08937cb 100755 --- a/extras/snap_scheduler/snap_scheduler.py +++ b/extras/snap_scheduler/snap_scheduler.py @@ -17,6 +17,7 @@ import argparse import fcntl import logging.handlers import sys +import shutil from errno import EEXIST @@ -234,7 +235,7 @@ def write_tasks_to_file(): ret = False return ret - os.rename(TMP_FILE, GCRON_ENABLED) + shutil.move(TMP_FILE, GCRON_ENABLED) ret = True return ret @@ -346,7 +347,7 @@ def initialise_scheduler(): ret = False return ret - os.rename("/tmp/crontab", GCRON_UPDATE_TASK) + shutil.move("/tmp/crontab", GCRON_UPDATE_TASK) if not os.path.lexists(GCRON_TASKS): try: |