diff options
author | Alex Sirbu <alexandru.sirbu@bigstep.com> | 2016-03-02 09:15:42 +0000 |
---|---|---|
committer | Alex Sirbu <alexandru.sirbu@bigstep.com> | 2016-03-02 09:15:42 +0000 |
commit | 603bdecc5aaa34043379aa4311c271d52dfe61e8 (patch) | |
tree | cc0602af187f7f7f8cda4dc2549353a06000232f /cloudinit/distros/__init__.py | |
parent | 97efb9d48197d7098f1abe2ee519418afbe6aec5 (diff) | |
download | vyos-cloud-init-603bdecc5aaa34043379aa4311c271d52dfe61e8.tar.gz vyos-cloud-init-603bdecc5aaa34043379aa4311c271d52dfe61e8.zip |
Added the hashed_passwd argument for the function create_user, which uses the already implemented functionality of changing the password with a hashed string, but which wasn't used anywhere.
Diffstat (limited to 'cloudinit/distros/__init__.py')
-rw-r--r-- | cloudinit/distros/__init__.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py index 8167c594..6778c93a 100644 --- a/cloudinit/distros/__init__.py +++ b/cloudinit/distros/__init__.py @@ -393,6 +393,10 @@ class Distro(object): if 'plain_text_passwd' in kwargs and kwargs['plain_text_passwd']: self.set_passwd(name, kwargs['plain_text_passwd']) + # Set password if hashed password is provided and non-empty + if 'hashed_passwd' in kwargs and kwargs['hashed_passwd']: + self.set_passwd(name, kwargs['hashed_passwd'], True) + # Default locking down the account. 'lock_passwd' defaults to True. # lock account unless lock_password is False. if kwargs.get('lock_passwd', True): |