From 944623f4ad3e4c7319758c64053d06a3b05555a2 Mon Sep 17 00:00:00 2001 From: Juerg Haefliger Date: Wed, 19 Jun 2013 08:44:00 +0200 Subject: fix and cleanup usage of util.logexc --- cloudinit/config/cc_set_passwords.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cloudinit/config/cc_set_passwords.py') diff --git a/cloudinit/config/cc_set_passwords.py b/cloudinit/config/cc_set_passwords.py index c6bf62fd..e93c8c6f 100644 --- a/cloudinit/config/cc_set_passwords.py +++ b/cloudinit/config/cc_set_passwords.py @@ -1,7 +1,7 @@ # vi: ts=4 expandtab # # Copyright (C) 2009-2010 Canonical Ltd. -# Copyright (C) 2012 Hewlett-Packard Development Company, L.P. +# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P. # # Author: Scott Moser # Author: Juerg Haefliger @@ -81,8 +81,8 @@ def handle(_name, cfg, cloud, log, args): util.subp(['chpasswd'], ch_in) except Exception as e: errors.append(e) - util.logexc(log, - "Failed to set passwords with chpasswd for %s", users) + util.logexc(log, "Failed to set passwords with chpasswd for %s", + users) if len(randlist): blurb = ("Set the following 'random' passwords\n", -- cgit v1.2.3 From 1072010fdde26203bc69b911e4a478953323a6ef Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Tue, 23 Jul 2013 11:45:34 -0400 Subject: Fix password setting for rhel5. Changing password via 'chpasswd' command in rhel5 would fail, if input to the 'chpasswd' command doesn't end with '\n'. The fix is just to append a carriage return to the input. --- ChangeLog | 2 ++ cloudinit/config/cc_set_passwords.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'cloudinit/config/cc_set_passwords.py') diff --git a/ChangeLog b/ChangeLog index dcc67626..4cdd20ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,8 @@ 'initctl reload-configuration' (LP: #1124384). If so, then invoke it. - add Azure datasource. - add support for SuSE / SLES [Juerg Haefliger] + - add a trailing carriage return to chpasswd input, which reportedly + caused a problem on rhel5 if missing. 0.7.2: - add a debian watch file - add 'sudo' entry to ubuntu's default user (LP: #1080717) diff --git a/cloudinit/config/cc_set_passwords.py b/cloudinit/config/cc_set_passwords.py index e93c8c6f..56a36906 100644 --- a/cloudinit/config/cc_set_passwords.py +++ b/cloudinit/config/cc_set_passwords.py @@ -75,7 +75,7 @@ def handle(_name, cfg, cloud, log, args): plist_in.append("%s:%s" % (u, p)) users.append(u) - ch_in = '\n'.join(plist_in) + ch_in = '\n'.join(plist_in) + '\n' try: log.debug("Changing password for %s:", users) util.subp(['chpasswd'], ch_in) -- cgit v1.2.3