Anons79 Mini Shell

Directory : /proc/self/root/lib/python2.7/site-packages/ansible/module_utils/
Upload File :
Current File : //proc/self/root/lib/python2.7/site-packages/ansible/module_utils/known_hosts.pyo

�
�Udac@s�ddlZddlZddlZddlmZyddlmZWnek
rgddlZnXdZ	d�Z
d�Zd�Zd�Z
d	d
ed�ZdS(i����N(turlparse(tsha1s|1|cCsDd|krd|krtSx!dD]}|j|�r#tSq#WtS(s check if url is ssh t@s://sssh://s
git+ssh://s
ssh+git://(sssh://s
git+ssh://s
ssh+git://(tTruet
startswithtFalse(turltscheme((sD/usr/lib/python2.7/site-packages/ansible/module_utils/known_hosts.pyt
is_ssh_url+s
cCsvd
}d
}tjd�}d|kr�d|kr�|jdd�d}|j|�}|rs|j�\}}qld|kr�|jd�d}qld|krl|jd�d}qln�d|krlt|�}|ddkrl|d}d|kr|jdd�d}n|j|�}|r;|j�\}}qid|kri|jd�dd	!\}}qiqln||fS(s) chop the hostname and port out of a url s(\[[^]]*\])(?::([0-9]+))?Rs://it:it/tiN(tNonetretcompiletsplittmatchtgroupsR(trepo_urltfqdntporttipv6_reRtpathtparts((sD/usr/lib/python2.7/site-packages/ansible/module_utils/known_hosts.pytget_fqdn_and_port7s0
%cCst||�S(N(tnot_in_host_file(tmoduleR((sD/usr/lib/python2.7/site-packages/ansible/module_utils/known_hosts.pyt
check_hostkeyZsc
Cs�dtjkr$tjjd�}nd}tjj|�}g}|j|�|jd�|jd�|jd�d}xv|D]n}tjj|�s�|d7}q�nyt|�}Wntk
r�|d7}q�nX|j	�}|j
�x�|jd	�D]�}|dksd
|kr&qn|j�}	|	dj
t�dkr�yt|	dtt�jdd�\}
}tj|
jd
�dt�}|j|�|j�|jd
�kr�tSWq�tk
r�qq�Xq||	dkrtSqWq�WtS(NtUSERs~${USER}/.ssh/known_hostss~/.ssh/known_hostss/etc/ssh/ssh_known_hostss/etc/ssh/ssh_known_hosts2s/etc/openssh/ssh_known_hostsiis
t t|itbase64t	digestmod(tostenvironRt
expandvarst
expandusertappendtexiststopentIOErrortreadtcloseRRtfindtHASHED_KEY_MAGICtlenthmactnewtdecodeRtupdatetdigestRt	ExceptionR(
tselfthosttuser_host_filethost_file_listthfiles_not_foundthfthost_fhtdatatlinettokenstkn_salttkn_hostthash((sD/usr/lib/python2.7/site-packages/ansible/module_utils/known_hosts.pyRasJ








&


itrsac
Cs�|jdt�}dtjkrHtjjd�}tjjd�}nd}d}tjj|�}tjj|�s�|r�ytj|t	dd��Wq�t
k
r�|jd	d
|�q�Xq|jd	d|�n)tjj|�s|jd	d|�n|r%d
||||f}nd|||f}|j
|�\}	}
}|	dksc|
r�d}|
s�|d|7}n|d||
f7}|r�|d|7}n|jd	|�n|j||
�|	|
|fS(s$ use ssh-keyscan to add the hostkey sssh-keyscanRs~${USER}/.ssh/s~${USER}/.ssh/known_hostss~/.ssh/s~/.ssh/known_hostst700itmsgs'failed to create host key directory: %ss%s does not exists%s is not a directorys%s -t %s -p %s %ss%s -t %s %sisfailed to retrieve hostkeys. "%s" returned no matches.s! using command "%s". [stdout]: %ss
 [stderr]: %s(tget_bin_pathRR!R"RR#R$R&tmakedirstintR3t	fail_jsontisdirtrun_commandtappend_to_file(
RRRtkey_typet
create_dirtkeyscan_cmdtuser_ssh_dirR6tthis_cmdtrctoutterrRC((sD/usr/lib/python2.7/site-packages/ansible/module_utils/known_hosts.pytadd_host_key�s<
(R!R.R
t+ansible.module_utils.six.moves.urllib.parseRthashlibRtImportErrortshaR,RRRRRRS(((sD/usr/lib/python2.7/site-packages/ansible/module_utils/known_hosts.pyt<module>s
		#		4

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]