Put in check for version to specify how to generate random password.

Signed-off-by: ziycon <ziycon.eire@gmail.com>
Missing assignment operator.

Signed-off-by: ziycon <ziycon.eire@gmail.com>