diff options
author | Scott Moser <smoser@ubuntu.com> | 2012-08-27 20:17:33 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2012-08-27 20:17:33 -0400 |
commit | e0179ea4ba8f7024d9ce4e74c48f5ed95cd17167 (patch) | |
tree | a10bb1d3576df6796e47472acb1f9cf22231d76e /cloudinit/distros/ubuntu.py | |
parent | b81d5ed43e7ebed1d11d4b4109e22e9954316d4c (diff) | |
parent | e57e4524133c819a65730060c515b048fcb09c2f (diff) | |
download | vyos-cloud-init-e0179ea4ba8f7024d9ce4e74c48f5ed95cd17167.tar.gz vyos-cloud-init-e0179ea4ba8f7024d9ce4e74c48f5ed95cd17167.zip |
fix bug preventing public_keys from being imported for to-be-created users
If a user hadn't been created in the image, when the public_key was to
be injected by cc_ssh into the user's account, it didn't exist yet.
This moves the population of the authorized_keys from the metadata service
into user_groups, and puts that before cc_ssh runs. moving before cc_ssh
means that when ssh comes up, the users will be ready.
ssh-import-id then handles any ssh-import-id users after networking is up.
LP: #1042459
Diffstat (limited to 'cloudinit/distros/ubuntu.py')
-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 |