[virt-bootstrap] [PATCH v7 11/26] UID/GID mapping: Use empty list instead of None

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Resove an issue when only uid_map or only gid_map is specified.

We set the default values to None. However, `len(None)` will raise
an exception. To avoid this we need to set the default values to
[] (empty list).
---
 src/virtBootstrap/virt_bootstrap.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/virtBootstrap/virt_bootstrap.py b/src/virtBootstrap/virt_bootstrap.py
index 0bc2e2b..f970838 100755
--- a/src/virtBootstrap/virt_bootstrap.py
+++ b/src/virtBootstrap/virt_bootstrap.py
@@ -120,6 +120,12 @@ def bootstrap(uri, dest,
         logger.error("No write permissions on destination path '%s'", dest)
         sys.exit(1)
 
+    if uid_map is None:
+        uid_map = []
+
+    if gid_map is None:
+        gid_map = []
+
     source(uri=uri,
            fmt=fmt,
            username=username,
-- 
2.13.5

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list



[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux