summaryrefslogtreecommitdiff
path: root/cloudinit/distros
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2013-01-07 11:36:10 -0500
committerScott Moser <smoser@ubuntu.com>2013-01-07 11:36:10 -0500
commit573d2b6cbdbcd6451290e0619f41ddc84f02f683 (patch)
tree26add8941825c9a17868fd593efb401b9ce0844e /cloudinit/distros
parentde7442b73e79820ef1ab28799c31e19c1968e0d1 (diff)
parent6cfd12c96608eb5fd086da49c4c685635e40e6e0 (diff)
downloadvyos-cloud-init-573d2b6cbdbcd6451290e0619f41ddc84f02f683.tar.gz
vyos-cloud-init-573d2b6cbdbcd6451290e0619f41ddc84f02f683.zip
fix 'lock_password' for cloud-config user setup
This simiplifies the logic, by just making it independent of 'system'. LP: #1096423
Diffstat (limited to 'cloudinit/distros')
-rw-r--r--cloudinit/distros/__init__.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py
index 8a3e0570..38b2f829 100644
--- a/cloudinit/distros/__init__.py
+++ b/cloudinit/distros/__init__.py
@@ -338,10 +338,9 @@ class Distro(object):
if 'plain_text_passwd' in kwargs and kwargs['plain_text_passwd']:
self.set_passwd(name, kwargs['plain_text_passwd'])
- # Default locking down the account.
- if ('lock_passwd' not in kwargs and
- ('lock_passwd' in kwargs and kwargs['lock_passwd']) or
- 'system' not in kwargs):
+ # Default locking down the account. 'lock_passwd' defaults to True.
+ # lock account unless lock_password is False.
+ if kwargs.get('lock_passwd', True):
try:
util.subp(['passwd', '--lock', name])
except Exception as e: