aboutsummaryrefslogtreecommitdiffstats
path: root/testing/cloud-init/20-alpine.patch
diff options
context:
space:
mode:
authorMatt Dainty <matt+alpine@bodgit-n-scarper.com>2016-04-01 16:40:22 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2016-06-15 09:58:18 +0000
commit2dcaac18ed7e395f5613b92d2e481e4380337929 (patch)
tree27755d551de6d32254fd6690dfce672c7dbf7949 /testing/cloud-init/20-alpine.patch
parent5a72214e4926eadf68b15b44e26d4f69fcb431ce (diff)
downloadaports-2dcaac18ed7e395f5613b92d2e481e4380337929.tar.gz
aports-2dcaac18ed7e395f5613b92d2e481e4380337929.tar.bz2
aports-2dcaac18ed7e395f5613b92d2e481e4380337929.tar.xz
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.
Diffstat (limited to 'testing/cloud-init/20-alpine.patch')
-rw-r--r--testing/cloud-init/20-alpine.patch18
1 files changed, 11 insertions, 7 deletions
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