mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
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.
This commit is contained in:
parent
e1e1150a04
commit
8418090018
1 changed files with 2 additions and 0 deletions
|
@ -81,4 +81,6 @@ class ShrinkVolume(Task):
|
||||||
@classmethod
|
@classmethod
|
||||||
def run(cls, info):
|
def run(cls, info):
|
||||||
from bootstrapvz.common.tools import log_check_call
|
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])
|
log_check_call(['/usr/bin/vmware-vdiskmanager', '-k', info.volume.image_path])
|
||||||
|
os.chmod(info.volume.image_path, perm)
|
||||||
|
|
Loading…
Add table
Reference in a new issue