From c8cca3cc82c3c446c49bf23ff6e2805f2aaeef48 Mon Sep 17 00:00:00 2001 From: Ben Howard Date: Mon, 27 Aug 2012 16:26:46 -0600 Subject: Fixed critical bug where user and group creation was being done after SSH configurations were applied. The result of this bug was that cloud-config supplied SSH public keys would fail to apply since the configured user may or may not exist. (LP: #1042459). cloudinit/config/cc_ssh_import_id.py: ssh_import_id.py now handles all user SSH import IDs. cloudinit/distros/ubuntu.py: Removed create_user class override as cruft, since ssh_import_id now handles all users. config/cloud.cfg: Moved users_groups to run under cloud_init_modules. doc/examples/cloud-config.txt: Added missing documentation on user and group creation. --- cloudinit/distros/ubuntu.py | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'cloudinit/distros') diff --git a/cloudinit/distros/ubuntu.py b/cloudinit/distros/ubuntu.py index 4b3f8572..cb93f971 100644 --- a/cloudinit/distros/ubuntu.py +++ b/cloudinit/distros/ubuntu.py @@ -32,21 +32,3 @@ class Distro(debian.Distro): distro_name = 'ubuntu' default_user = 'ubuntu' - - def create_user(self, name, **kargs): - - if not super(Distro, self).create_user(name, **kargs): - return False - - if 'sshimportid' in kargs: - cmd = ["sudo", "-Hu", name, "ssh-import-id"] + kargs['sshimportid'] - LOG.debug("Importing ssh ids for user %s, post user creation." - % name) - - try: - util.subp(cmd, capture=True) - except util.ProcessExecutionError as e: - util.logexc(LOG, "Failed to import %s ssh ids", name) - raise e - - return True -- cgit v1.2.3