3
\mex @ s U d Z ddlZddlZddlmZ ddlmZmZ ddlm Z ddl
mZ ddlm
Z
mZ ddlmZ dd lmZ d
ddd
gZdZdZdddeeeedgg dZe
eeZ ejeZeee eddddZdd ZeeedddZ dS )zSSH Import ID: Import SSH id N)dedent)subputil)Cloud)Config)
MetaSchemaget_meta_doc)ug_util)PER_INSTANCEZalpineZcosZdebianZubuntuz
ssh-import-ida2 This module imports SSH keys from either a public keyserver, usually launchpad
or github using ``ssh-import-id``. Keys are referenced by the username they are
associated with on the keyserver. The keyserver can be specified by prepending
either ``lp:`` for launchpad or ``gh:`` for github to the username.
Zcc_ssh_import_idz
SSH Import IDz
Import SSH idzi ssh_import_id:
- user
- gh:user
- lp:user
)idnametitledescriptiondistrosZ frequencyZexamplesZactivate_by_schema_keys)r cfgcloudargsreturnc " C s t |dstjd d S tjts0tjd d S t|dkrn|d }g }t|dkr`|dd }t|| d S t j
||j\}}g }x|j D ]\}} g }
| d rt
j|dg }
n0y| d }
W n" tk
r tjd| wY nX yt
j|
}
dd |
D }
W n$ tk
r" tjd
| wY nX t|
s0qyt|
| W q tk
r| } z t
jtd||
|j| W Y d d }~X qX qW t|r|d d S )NZ
ssh_import_idzISkipping module named ssh_import_id, no 'ssh_import_id' directives found.zXssh-import-id is not installed, but module ssh_import_id is configured. Skipping module.r defaultz+User %s is not configured for ssh_import_idc S s g | ]}t |qS )str).0ir r &/usr/lib/python3.6/cc_ssh_import_id.py