diff options
author | Ben Howard <ben.howard@canonical.com> | 2012-08-27 16:26:46 -0600 |
---|---|---|
committer | Ben Howard <ben.howard@canonical.com> | 2012-08-27 16:26:46 -0600 |
commit | c8cca3cc82c3c446c49bf23ff6e2805f2aaeef48 (patch) | |
tree | c6c1033a29b2575eea00de0636d671a1224702c1 /cloudinit/distros | |
parent | b81d5ed43e7ebed1d11d4b4109e22e9954316d4c (diff) | |
download | vyos-cloud-init-c8cca3cc82c3c446c49bf23ff6e2805f2aaeef48.tar.gz vyos-cloud-init-c8cca3cc82c3c446c49bf23ff6e2805f2aaeef48.zip |
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.
Diffstat (limited to 'cloudinit/distros')
-rw-r--r-- | cloudinit/distros/ubuntu.py | 18 |
1 files changed, 0 insertions, 18 deletions
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 |