Raise error if dracr password is above 20 chars

This commit is contained in:
Aditya Kulkarni 2015-12-04 15:45:11 -05:00
parent 7caead8630
commit 856eb4664f

View File

@ -459,7 +459,11 @@ def change_password(username, password, uid=None, host=None,
be necessary if one is not sure which user slot contains the one you want.
Many late-model Dell chassis have 'root' as UID 1, so if you can depend
on that then setting the password is much quicker.
Raises an error if the supplied password is greater than 20 chars.
'''
if len(password) > 20:
raise CommandExecutionError('Supplied password should be 20 characters or less')
if uid is None:
user = list_users(host=host, admin_username=admin_username,
admin_password=admin_password, module=module)