summaryrefslogtreecommitdiffstats
path: root/src/virtBootstrap/virt_bootstrap.py
diff options
context:
space:
mode:
authorRadostin Stoyanov <rstoyanov1@gmail.com>2017-07-24 09:14:05 +0100
committerRadostin Stoyanov <rstoyanov1@gmail.com>2017-07-24 15:01:36 +0100
commit5853bf681d2b18bf51f997526b3d3934345d0b4c (patch)
tree97ee528d6b34945a9ef916e38411927049f7203f /src/virtBootstrap/virt_bootstrap.py
parentf4abf17432983c4ce539bbd4cadf0645a7c4154a (diff)
downloadvirt-bootstrap.git-5853bf681d2b18bf51f997526b3d3934345d0b4c.tar.gz
virt-bootstrap.git-5853bf681d2b18bf51f997526b3d3934345d0b4c.tar.xz
virt-bootstrap.git-5853bf681d2b18bf51f997526b3d3934345d0b4c.zip
Add support for setting root passowrd in qcow2
For containers bootstrapped in qcow2 format use the tool 'virt-edit' to insert the hashed root password in the shadow file of the last layer
Diffstat (limited to 'src/virtBootstrap/virt_bootstrap.py')
-rwxr-xr-xsrc/virtBootstrap/virt_bootstrap.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/virtBootstrap/virt_bootstrap.py b/src/virtBootstrap/virt_bootstrap.py
index 5506445..c9bf1c8 100755
--- a/src/virtBootstrap/virt_bootstrap.py
+++ b/src/virtBootstrap/virt_bootstrap.py
@@ -200,14 +200,13 @@ def bootstrap(uri, dest,
no_cache=no_cache,
progress=prog).unpack(dest)
- if fmt == "dir":
- if root_password is not None:
- logger.info("Setting password of the root account")
- utils.set_root_password(dest, root_password)
-
- if uid_map or gid_map:
- logger.info("Mapping UID/GID")
- mapping_uid_gid(dest, uid_map, gid_map)
+ if root_password is not None:
+ 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:
+ logger.info("Mapping UID/GID")
+ mapping_uid_gid(dest, uid_map, gid_map)
def set_logging_conf(loglevel=None):