Raise error if dracr password is above 20 chars

This commit is contained in:
Aditya Kulkarni 2015-12-04 15:45:11 -05:00 committed by rallytime
parent a1ffc5aacb
commit 2c55c55ff1

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)