[Kimchi-devel] [PATCH] bug fix: Auto-generate guest console password when the passed value is an empty string
Paulo Ricardo Paz Vital
pvital at linux.vnet.ibm.com
Fri Aug 29 21:35:21 UTC 2014
--
Reviewed-by: Paulo Vital <pvital at linux.vnet.ibm.com>
On Fri, 2014-08-29 at 16:28 -0300, Aline Manera wrote:
> As the password will be an empty string we need to check if its value is
> not None, otherwise the password will not be generated.
>
> Signed-off-by: Aline Manera <alinefm at linux.vnet.ibm.com>
> ---
> src/kimchi/model/vms.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/kimchi/model/vms.py b/src/kimchi/model/vms.py
> index e91c0ed..d8a02cd 100644
> --- a/src/kimchi/model/vms.py
> +++ b/src/kimchi/model/vms.py
> @@ -312,7 +312,7 @@ class VMModel(object):
> return xml
>
> password = params['graphics'].get("passwd")
> - if password and len(password.strip()) == 0:
> + if password is not None and len(password.strip()) == 0:
> password = "".join(random.sample(string.ascii_letters +
> string.digits, 8))
>
More information about the Kimchi-devel
mailing list