OS : Linux
PHP Version : 7.4.33
Software : Apache/2.4.6 (CentOS) PHP/7.4.33
Information System : Linux apprendre2 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
Disable Function : ó
oBú]c @ sT d Z d d l m Z d d l m Z d d l Z d d g Z d „ Z d „ Z d S( s9
SSH Import Id
-------------
**Summary:** import ssh id
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.
**Internal name:** ``cc_ssh_import_id``
**Module frequency:** per instance
**Supported distros:** ubuntu, debian
**Config keys**::
ssh_import_id:
- user
- gh:user
- lp:user
iÿÿÿÿ( t ug_util( t utilNt ubuntut debianc C sÅ t | ƒ d k rU | d } g } t | ƒ d k rA | d } n t | | | ƒ d St j | | j ƒ \ } } g } x/| j ƒ D]!\ } }
g } |
d r· t j | d g ƒ } n5 y |
d } Wn$ t k
rë | j d | ƒ qƒ n Xy2 t j
| ƒ } g | D] } t | ƒ ^ q} Wn$ t k
rD| j d | ƒ qƒ n Xt | ƒ sWqƒ n y t | | | ƒ Wqƒ t k
r£}
t j | d | | ƒ | j
|
ƒ qƒ Xqƒ Wt | ƒ rÁ| d ‚ n d S( Ni i t defaultt
ssh_import_ids+ User %s is not configured for ssh_import_ids5 User %s is not correctly configured for ssh_import_ids ssh-import-id failed for: %s %s( t lent import_ssh_idsR t normalize_users_groupst distrot itemsR t get_cfg_option_listt Exceptiont debugt
uniq_merget strt logexct append( t _namet cfgt cloudt logt argst usert idst userst _groupst elistt user_cfgt
import_idst it exc( ( sE /usr/lib/python2.7/site-packages/cloudinit/config/cc_ssh_import_id.pyt handle) sF
#
c C sà | o | s# | j d | | ƒ d Sy t j | ƒ Wn t k
rO } | ‚ n Xd d | d g | } | j d | ƒ y t j | d t ƒWn/ t j k
r¾ } t j | d | ƒ | ‚ n Xd S( Ns( empty user(%s) or ids(%s). not importingt sudos -Hus
ssh-import-ids Importing ssh ids for user %s.t captures* Failed to run command to import %s ssh ids( R
t pwdt getpwnamt KeyErrorR t subpt Falset ProcessExecutionErrorR ( R R R R t cmd( ( sE /usr/lib/python2.7/site-packages/cloudinit/config/cc_ssh_import_id.pyR Y s
( t __doc__t cloudinit.distrosR t cloudinitR R# t distrosR R ( ( ( sE /usr/lib/python2.7/site-packages/cloudinit/config/cc_ssh_import_id.pyt