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

Cole Robinson crobinso at redhat.com
Sun Jul 28 19:16:45 UTC 2019


On 7/28/19 5:01 AM, athina.plaskasoviti at gmail.com wrote:
> 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.
> 

Yes this seems like the correct thing to do. I've pushed this to the
cloudinit branch now

- Cole

> 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"
>




More information about the virt-tools-list mailing list