diff options
author | Scott Moser <smoser@ubuntu.com> | 2013-01-07 11:36:10 -0500 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2013-01-07 11:36:10 -0500 |
commit | 573d2b6cbdbcd6451290e0619f41ddc84f02f683 (patch) | |
tree | 26add8941825c9a17868fd593efb401b9ce0844e | |
parent | de7442b73e79820ef1ab28799c31e19c1968e0d1 (diff) | |
parent | 6cfd12c96608eb5fd086da49c4c685635e40e6e0 (diff) | |
download | vyos-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
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | cloudinit/distros/__init__.py | 7 |
2 files changed, 5 insertions, 4 deletions
@@ -14,6 +14,8 @@ - fix CloudStack DataSource to use Virtual Router as found in /var/lib/dhcpclient rather than default gateway (LP: #1089989) - fix redaction of password field in log (LP: #1096417) + - fix to cloud-config user setup. Previously, lock_passwd was broken and + all accounts would be locked unless 'system' was given (LP: #1096423). 0.7.1: - sysvinit: fix missing dependency in cloud-init job for RHEL 5.6 - config-drive: map hostname to local-hostname (LP: #1061964) 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: |