From 7baf904cffdc4074ba5529b095f98a8c1ed6707a Mon Sep 17 00:00:00 2001 From: Radostin Stoyanov Date: Sat, 26 Aug 2017 21:42:04 +0100 Subject: Enable UID/GID mapping for qcow2 Apply ownership mapping in qcow2 images using libguestfs python bindings. To make this solution more general we introduce function guestfs_walk() which will return the root file system tree of disk image along with UID/GID values. These changes are applied in additional qcow2 disk image using the last layer as backing file. For FileSource this is layer-1.qcow2 with backing file layer-0.qcow2. --- src/virtBootstrap/virt_bootstrap.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/virtBootstrap/virt_bootstrap.py') diff --git a/src/virtBootstrap/virt_bootstrap.py b/src/virtBootstrap/virt_bootstrap.py index f970838..f0abac4 100755 --- a/src/virtBootstrap/virt_bootstrap.py +++ b/src/virtBootstrap/virt_bootstrap.py @@ -130,6 +130,8 @@ def bootstrap(uri, dest, fmt=fmt, username=username, password=password, + uid_map=uid_map, + gid_map=gid_map, not_secure=not_secure, no_cache=no_cache, progress=prog).unpack(dest) @@ -138,7 +140,7 @@ def bootstrap(uri, dest, logger.info("Setting password of the root account") utils.set_root_password(fmt, dest, root_password) - if fmt == "dir" and uid_map or gid_map: + if fmt == "dir" and (uid_map or gid_map): logger.info("Mapping UID/GID") utils.mapping_uid_gid(dest, uid_map, gid_map) -- cgit