← Back to team overview

cloud-init-dev team mailing list archive

[Merge] lp:~harlowja/cloud-init/fix-passwd into lp:cloud-init

 

Joshua Harlow has proposed merging lp:~harlowja/cloud-init/fix-passwd into lp:cloud-init.

Requested reviews:
  cloud init development team (cloud-init-dev)
Related bugs:
  Bug #1096423 in cloud-init: "Password always locked?"
  https://bugs.launchpad.net/cloud-init/+bug/1096423

For more details, see:
https://code.launchpad.net/~harlowja/cloud-init/fix-passwd/+merge/142019
-- 
https://code.launchpad.net/~harlowja/cloud-init/fix-passwd/+merge/142019
Your team cloud init development team is requested to review the proposed merge of lp:~harlowja/cloud-init/fix-passwd into lp:cloud-init.
=== modified file 'cloudinit/distros/__init__.py'
--- cloudinit/distros/__init__.py	2012-11-20 06:04:31 +0000
+++ cloudinit/distros/__init__.py	2013-01-05 18:20:27 +0000
@@ -335,9 +335,10 @@
             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):
+        #
+        # Which means if lock_passwd is False (on non-existent its true)
+        # then lock or if system is True (on non-existent its false) then lock.
+        if (kwargs.get('lock_passwd', True) or kwargs.get('system', False)):
             try:
                 util.subp(['passwd', '--lock', name])
             except Exception as e:


Follow ups