[virt-tools-list] [virt-install PATCH] cloudinit: Fix password expiration

athina.plaskasoviti at gmail.com athina.plaskasoviti at gmail.com
Sun Jul 28 09:01:41 UTC 2019


From: Athina Plaskasoviti <athina.plaskasoviti at gmail.com>

Password expiration happens in case of one time random password generation.
When user provides password from file, don't expire the password.

Signed-off-by: Athina Plaskasoviti <athina.plaskasoviti at gmail.com>
---
 virtinst/install/cloudinit.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/virtinst/install/cloudinit.py b/virtinst/install/cloudinit.py
index b1a3b146..79326b49 100644
--- a/virtinst/install/cloudinit.py
+++ b/virtinst/install/cloudinit.py
@@ -52,7 +52,11 @@ def create_userdata(scratchdir, cloudinit_data):
         content += "chpasswd:\n"
         content += "  list: |\n"
         content += "    root:%s\n" % rootpass
+
+    if cloudinit_data.root_password_generate:
         content += "  expire: True\n"
+    elif cloudinit_data.root_password_file:
+        content += "  expire: False\n"
 
     if cloudinit_data.ssh_key:
         content += "users:\n"
-- 
2.21.0




More information about the virt-tools-list mailing list