← Back to team overview

cloud-init-dev team mailing list archive

[Merge] ~slystopad/cloud-init:fix/LP1665694 into cloud-init:master

 

Serg Lystopad has proposed merging ~slystopad/cloud-init:fix/LP1665694 into cloud-init:master.

Requested reviews:
  cloud init development team (cloud-init-dev)
Related bugs:
  Bug #1665694 in cloud-init: "cc_set_passwords fails to change passwords specified as chpasswd['list'] in cloud-config"
  https://bugs.launchpad.net/cloud-init/+bug/1665694

For more details, see:
https://code.launchpad.net/~slystopad/cloud-init/+git/cloud-init/+merge/317671
-- 
Your team cloud init development team is requested to review the proposed merge of ~slystopad/cloud-init:fix/LP1665694 into cloud-init:master.
diff --git a/cloudinit/config/cc_set_passwords.py b/cloudinit/config/cc_set_passwords.py
index cf1f59e..3e287da 100755
--- a/cloudinit/config/cc_set_passwords.py
+++ b/cloudinit/config/cc_set_passwords.py
@@ -79,7 +79,7 @@ def handle(_name, cfg, cloud, log, args):
 
     if 'chpasswd' in cfg:
         chfg = cfg['chpasswd']
-        plist = util.get_cfg_option_str(chfg, 'list', plist)
+        plist = util.get_cfg_option_list(chfg, 'list', plist)
         expire = util.get_cfg_option_bool(chfg, 'expire', expire)
 
     if not plist and password:
@@ -95,7 +95,7 @@ def handle(_name, cfg, cloud, log, args):
         plist_in = []
         randlist = []
         users = []
-        for line in plist.splitlines():
+        for line in plist:
             u, p = line.split(':', 1)
             if p == "R" or p == "RANDOM":
                 p = rand_user_password()

Follow ups