From 2dcaac18ed7e395f5613b92d2e481e4380337929 Mon Sep 17 00:00:00 2001 From: Matt Dainty Date: Fri, 1 Apr 2016 16:40:22 +0100 Subject: testing/cloud-init: fix user creation User creation wasn't unlocking the user so SSH access didn't work, the default user should not be locked either. Also add e2fsprogs-extra as a dependency so that the resize filesystem functionality works out of the box. --- testing/cloud-init/20-alpine.patch | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'testing/cloud-init/20-alpine.patch') diff --git a/testing/cloud-init/20-alpine.patch b/testing/cloud-init/20-alpine.patch index e2db6a3129..b2cf52d52c 100644 --- a/testing/cloud-init/20-alpine.patch +++ b/testing/cloud-init/20-alpine.patch @@ -202,18 +202,22 @@ + util.logexc(LOG, "Failed to create user %s", name) + raise e + ++ # Unlock the user ++ LOG.debug("Unlocking user %s", name) ++ try: ++ util.subp(['passwd', '-u', name], logstring=['passwd', '-u', name]) ++ except Exception as e: ++ util.logexc(LOG, "Failed to unlock user %s", name) ++ raise e ++ + if 'groups' in kwargs: + groups = kwargs['groups'] -+ if isinstance(groups, six.string_types): ++ if groups and isinstance(groups, str): + # Why are these even a single string in the first place? -+ groups = [groups.split(',')] -+ for group in kwargs['groups']: ++ groups = groups.split(',') ++ for group in groups: + try: + util.subp(['adduser', name, group], logstring=['adduser', name, group]) + except Exception as e: + util.logexc(LOG, "Failed to add user %s to group %s", name, group) + raise e -+ -+ def lock_passwd(self, name): -+ # Already locked -+ pass -- cgit v1.2.3