ó oBú]c@sTdZddlZddlmZddlmZeZdZd„Zd„Z dS(s Keys to Console --------------- **Summary:** control which ssh keys may be written to console For security reasons it may be desirable not to write ssh fingerprints and keys to the console. To avoid the fingerprint of types of ssh keys being written to console the ``ssh_fp_console_blacklist`` config key can be used. By default all types of keys will have their fingerprints written to console. To avoid keys of a key type being written to console the ``ssh_key_console_blacklist`` config key can be used. By default ``ssh-dss`` keys are not written to console. **Internal name:** ``cc_keys_to_console`` **Module frequency:** per instance **Supported distros:** all **Config keys**:: ssh_fp_console_blacklist: ssh_key_console_blacklist: iÿÿÿÿN(t PER_INSTANCE(tutils(%s/cloud-init/write-ssh-key-fingerprintscCs/y |j}Wntk r&d}nXt|S(Ns/usr/lib(t usr_lib_exectAttributeErrortHELPER_TOOL_TPL(tdistrotbase_lib((sG/usr/lib/python2.7/site-packages/cloudinit/config/cc_keys_to_console.pyt_get_helper_tool_path,s    c Csêt|jƒ}tjj|ƒs8|jd||ƒdStj|dgƒ}tj|ddgƒ}y]|dj|ƒdj|ƒg}tj |ƒ\} } tj d| j ƒdt dt ƒWn!tk rå|jd ƒ‚nXdS( Ns9Unable to activate module %s, helper tool not found at %stssh_fp_console_blacklisttssh_key_console_blacklistsssh-dsst,s%s tstderrtconsoles*Writing keys to the system console failed!(RRtostpathtexiststwarningRtget_cfg_option_listtjointsubpt multi_logtstriptFalsetTruet Exception( tnametcfgtcloudtlogt_argst helper_patht fp_blacklistt key_blacklisttcmdtstdoutt_stderr((sG/usr/lib/python2.7/site-packages/cloudinit/config/cc_keys_to_console.pythandle4s$      !  ( t__doc__R tcloudinit.settingsRt cloudinitRt frequencyRRR$(((sG/usr/lib/python2.7/site-packages/cloudinit/config/cc_keys_to_console.pyts