From 8418090018edca365b8f95b564115ee5a97efe77 Mon Sep 17 00:00:00 2001 From: Jonh Wendell Date: Tue, 27 Jan 2015 21:12:39 -0200 Subject: [PATCH] Recover file permissions after shrink a vmdk image After vmware-vdiskmanager runs, the image is left with a 600 permission. This commit fixes it by preserving the file permission before the shrink operation. --- bootstrapvz/plugins/minimize_size/tasks.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bootstrapvz/plugins/minimize_size/tasks.py b/bootstrapvz/plugins/minimize_size/tasks.py index ef7ff97..5cba758 100644 --- a/bootstrapvz/plugins/minimize_size/tasks.py +++ b/bootstrapvz/plugins/minimize_size/tasks.py @@ -81,4 +81,6 @@ class ShrinkVolume(Task): @classmethod def run(cls, info): from bootstrapvz.common.tools import log_check_call + perm = os.stat(info.volume.image_path).st_mode & 0777 log_check_call(['/usr/bin/vmware-vdiskmanager', '-k', info.volume.image_path]) + os.chmod(info.volume.image_path, perm)