summaryrefslogtreecommitdiffstats
path: root/src/virtBootstrap/virt_bootstrap.py
diff options
context:
space:
mode:
authorRadostin Stoyanov <rstoyanov1@gmail.com>2017-08-26 21:42:04 +0100
committerRadostin Stoyanov <rstoyanov1@gmail.com>2017-08-28 16:03:28 +0100
commit7baf904cffdc4074ba5529b095f98a8c1ed6707a (patch)
treef7fffb9fcef085c747898e3649a182cdcc3fce4d /src/virtBootstrap/virt_bootstrap.py
parent6ca9a3f7eccae0411f73d7aa8df759eb09be8955 (diff)
downloadvirt-bootstrap.git-7baf904cffdc4074ba5529b095f98a8c1ed6707a.tar.gz
virt-bootstrap.git-7baf904cffdc4074ba5529b095f98a8c1ed6707a.tar.xz
virt-bootstrap.git-7baf904cffdc4074ba5529b095f98a8c1ed6707a.zip
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.
Diffstat (limited to 'src/virtBootstrap/virt_bootstrap.py')
-rwxr-xr-xsrc/virtBootstrap/virt_bootstrap.py4
1 files changed, 3 insertions, 1 deletions
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)