[virt-tools-list] [virt-bootstrap] [PATCH v5 07/13] Do not call mapping_uid_gid() for format="qcow2"

Radostin Stoyanov rstoyanov1 at gmail.com
Fri Aug 4 14:30:43 UTC 2017


When fmt is qcow2 (fmt == 'dir' is False) mapping_uid_gid() should not
be called.

    >>> False and True or True
    True
    >>> False and (True or True)
    False
---
 src/virtBootstrap/virt_bootstrap.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/virtBootstrap/virt_bootstrap.py b/src/virtBootstrap/virt_bootstrap.py
index 0bc2e2b..0c1626c 100755
--- a/src/virtBootstrap/virt_bootstrap.py
+++ b/src/virtBootstrap/virt_bootstrap.py
@@ -132,7 +132,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)
 
-- 
2.13.4




More information about the virt-tools-list mailing list