summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorDaniel Watkins <daniel.watkins@canonical.com>2016-03-04 11:25:48 +0000
committerDaniel Watkins <daniel.watkins@canonical.com>2016-03-04 11:25:48 +0000
commitac7a4f3d961587edf18474b37cf139b7c1e368b8 (patch)
tree2fbd3e2289fa943605e7f0c8ce34d6f689e2d817 /cloudinit
parentd4aa1ab6837a178e4efc79b4443b7609e50fa68f (diff)
parent921728d42731091f849d21dbef0920b84c559480 (diff)
downloadvyos-cloud-init-ac7a4f3d961587edf18474b37cf139b7c1e368b8.tar.gz
vyos-cloud-init-ac7a4f3d961587edf18474b37cf139b7c1e368b8.zip
Enable password changing via a hashed string
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/distros/__init__.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py
index 4bad8708..a73acae5 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'], hashed=True)
+
# Default locking down the account. 'lock_passwd' defaults to True.
# lock account unless lock_password is False.
if kwargs.get('lock_passwd', True):