ó 'KXc@sNddlmZddlmZddlZddgZd„Zd„ZdS(iÿÿÿÿ(tdistros(tutilNtubuntutdebiancCs±t|ƒdkrU|d}g}t|ƒdkrA|d}nt|||ƒdStj||jƒ\}}g} x|jƒD] \}} g} | dr·tj|dgƒ} n+y| d} Wn|jd|ƒqƒnXy2tj | ƒ} g| D]} t | ƒ^qû} Wn|jd|ƒqƒnXt| ƒsCqƒnyt| ||ƒWqƒt k r} tj |d|| ƒ| j | ƒqƒXqƒWt| ƒr­| d‚ndS(Niitdefaultt ssh_import_ids+User %s is not configured for ssh_import_ids5User %s is not correctly configured for ssh_import_idsssh-import-id failed for: %s %s(tlentimport_ssh_idstdstnormalize_users_groupstdistrotitemsRtget_cfg_option_listtdebugt uniq_mergetstrt Exceptiontlogexctappend(t_nametcfgtcloudtlogtargstusertidstuserst_groupstelisttuser_cfgt import_idstitexc((sN/opt/freeware/lib/python2.7/site-packages/cloudinit/config/cc_ssh_import_id.pythandle!sF   #   cCsÅ|o |s#|jd||ƒdSytj|ƒ}Wntk rQ}|‚nXdd|dg|}|jd|ƒytj|dtƒWn/tjk rÀ}tj|d|ƒ|‚nXdS(Ns(empty user(%s) or ids(%s). not importingtsudos-Hus ssh-import-idsImporting ssh ids for user %s.tcaptures*Failed to run command to import %s ssh ids( R tpwdtgetpwnamtKeyErrorRtsubptFalsetProcessExecutionErrorR(RRRt_checkR tcmd((sN/opt/freeware/lib/python2.7/site-packages/cloudinit/config/cc_ssh_import_id.pyRQs  (t cloudinitRRRR$R!R(((sN/opt/freeware/lib/python2.7/site-packages/cloudinit/config/cc_ssh_import_id.pyts    0