Add limit for new password in gitlab_user ()

Fixes: 

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Abhijeet Kasurde 2017-12-01 12:38:44 +05:30 committed by GitHub
parent 89b65e81d1
commit dd6532b29a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -62,6 +62,7 @@ options:
password:
description:
- The password of the user.
- GitLab server enforces minimum password length to 8, set this value with 8 or more characters.
required: true
email:
description:
@ -302,6 +303,9 @@ def main():
state = module.params['state']
confirm = module.params['confirm']
if len(user_password) < 8:
module.fail_json(msg="New user's 'password' should contain more than 8 characters.")
# We need both login_user and login_password or login_token, otherwise we fail.
if login_user is not None and login_password is not None:
use_credentials = True