Anons79 Mini Shell

Directory : /proc/self/root/lib/python2.7/site-packages/ansible/galaxy/
Upload File :
Current File : //proc/self/root/lib/python2.7/site-packages/ansible/galaxy/collection.pyc

�
�Udac@`s'ddlmZmZmZeZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlmZddlmZmZddlmZddlmZddlmZyddlZWnek
rCddl ZnXddl!j"Z#ddl$m%Z%dd	l&m'Z'dd
l(m)Z)m*Z*ddl+m,Z,ddl-m.Z.dd
l/m0Z0m1Z1m2Z2ddl3m4Z4ddl5m6Z6ddl7m8Z8m9Z9ddl:m;Z;e.j<j=j>j?Z?e.j<j=j@ZAe6�aBdZCdfd��YZDd�ZEd�ZFd�ZGd�ZHed��ZIed��ZJed��ZKd�ZLd�ZMd�ZNd�ZOd �ZPd!�ZQeRd"�ZSeRd#�ZTd$�ZUeRd%�ZVd&�ZWeRd'�ZXeRd(�ZYdS()i(tabsolute_importtdivisiontprint_functionN(tcontextmanager(tLooseVersiont
StrictVersion(tsha256(tBytesIO(t	YAMLError(tAnsibleError(t get_collections_galaxy_meta_info(tCollectionVersionMetadatatGalaxyError(t
user_agent(tsix(tto_bytest	to_nativetto_text(tAnsibleCollectionRef(tDisplay(tsecure_hasht
secure_hash_s(topen_urlitCollectionRequirementcB`s�eZddgZddded�Zd�Zd�Zed��Z	ed��Z
d	�Zd
�Zd�Z
d�Zd
�Zedd��Zedd��Zedd��ZRS(s
MANIFEST.jsont
manifest_files
FILES.jsont
files_filecC`st||_||_||_||_t|�|_||_||_g|_|	|_	|
|_
|j||�dS(s�
        Represents a collection requirement, the versions that are available to be installed as well as any
        dependencies the collection has.

        :param namespace: The collection namespace.
        :param name: The collection name.
        :param b_path: Byte str of the path to the collection tarball if it has already been downloaded.
        :param api: The GalaxyAPI to use if the collection is from Galaxy.
        :param versions: A list of versions of the collection that are available.
        :param requirement: The version requirement string used to verify the list of versions fit the requirements.
        :param force: Whether the force flag applied to the collection.
        :param parent: The name of the parent the collection is a dependency of.
        :param metadata: The galaxy.api.CollectionVersionMetadata that has already been retrieved from the Galaxy
            server.
        :param files: The files that exist inside the collection. This is based on the FILES.json file inside the
            collection artifact.
        :param skip: Whether to skip installing the collection. Should be set if the collection is already installed
            and force is not set.
        N(t	namespacetnametb_pathtapitsettversionstforcetskiptrequired_byt	_metadatat_filestadd_requirement(tselfRRRRRtrequirementR tparenttmetadatatfilesR!((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyt__init__9s									cC`std|j|jf�S(Ns%s.%s(RRR(R&((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyt__str__\scC`sd|j|jfS(Nu%s.%s(RR(R&((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyt__unicode___scC`sOy6tg|jD]}|dkr|^qdt�SWntk
rJdSXdS(Nt*tkey(tmaxRRt
ValueError(R&tv((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pytlatest_versionbs6
cC`sO|js/t|j�dkr"iS|j�n|jj}|dkrKiS|S(Ni(R#tlenRt
_get_metadatatdependenciestNone(R&R6((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyR6is	
c
`s|�jj��f�t���fd��jD��}t|�dkro�jr��rbdnd}�jdkr��jnd}dt���||f}t|��n>�dkr�d�t��f}nd	t����f}t�j
d
d�p
�jj}dj
�fd
��jD��}dj
t�jdt��}	td|||	|f��n|�_dS(Nc3`s*|] }�j|���r|VqdS(N(t_meets_requirements(t.0R2(R(R'R&(s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pys	<genexpr>ysis--force-with-depss--forceR.tunknowns]Cannot meet requirement %s:%s as it is already installed at version '%s'. Use %s to overwrites,Cannot meet requirement %s for dependency %ss<Cannot meet dependency requirement '%s:%s' for collection %st	nonstringtpassthrus
c3`s@|]6\}}d|r$t|�ndt��|fVqdS(s
	%s - '%s:%s'tbaseN(R(R9tptr(R&(s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pys	<genexpr>�ss, R/s_%s from source '%s'. Available versions before last requirement added: %s
Requirements from:
%s(R"tappendRRR4R!R3RR	R7RRt
api_servertjointsortedR(
R&R(R'tnew_versionst
force_flagtversiontmsgtcollection_sourcetreq_byR((R(R'R&s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyR%ws,%	!cC`sv|jr$tjdt|��dStjj||j|j�}t|dd�}tjdt|�|j	|f�|j
dkr�|jj
}|jj}i}|jj||dt�t||||jjd|�|_
ntjj|�rtj|�ntj|�y
tj|j
dd���}|jd	�}	t||	��.\}
}tjt|j�dd��}WdQXt|d
||�t|d	||�xn|dD]b}
|
d}|d
kr�q�n|
ddkrt||||d|
d�q�t |||�q�WWdQXWnRt!k
rqtj|�tjj"|�}tj#|�sktj$|�n�nXdS(Ns(Skipping '%s' as it is already installedterrorstsurrogate_or_strictsInstalling '%s:%s' to '%s'trequiredtheaderstmodeR?s
FILES.jsons
MANIFEST.jsonR*Rt.tftypetfilet
expected_hasht
chksum_sha256(%R!tdisplayRtostpathRBRRRR3RR7R#tdownload_urltartifact_sha256Rt_add_auth_tokentFalset_download_filetvalidate_certstexiststshutiltrmtreetmakedirsttarfiletopent	getmembert_tarfile_extracttjsontloadstreadt_extract_tar_filet_extract_tar_dirt	Exceptiontdirnametlistdirtrmdir(R&RVtb_temp_pathtcollection_pathtb_collection_pathRWt
artifact_hashRMtcollection_tartfiles_member_objtdummyt	files_objR*t	file_infot	file_nametb_namespace_path((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pytinstall�sJ	#
'


cC`s#t|jg�|_|j�dS(N(RR3RR5(R&((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pytset_latest_version�scC`s5|jr
dS|jj|j|j|j�|_dS(N(R#Rtget_collection_version_metadataRRR3(R&((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyR5�s	c		C`sXitjd6tjd6tjd6tjd6tjd6tjd6tjd6}xt|jd��D]�}t	|�d	kr�|d	dkr�d
nd	}|j
|| �}||}|s�|}tj}n|r|dkr|dkrtjdt
|�||f�qbn|dksb|dkr-qbn|t|�t|��sbPqbqbWtStS(
s�
        Supports version identifiers can be '==', '!=', '>', '>=', '<', '<=', '*'. Each requirement is delimited by ','
        s!=s==t=s>=t>s<=t<t,iiR.s�Failed to validate the collection requirement '%s:%s' for %s when the existing install does not have a version set, the collection may not work.(toperatortneteqtgetgttletlttlisttsplitR4tgetRTtwarningRRtTrueRZ(	R&RFtrequirementsR(top_maptreqtop_postopR'((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyR8�s2






.
	cC`s�tj|�s(tdt|���ni}tj|dd���}x�tjD]�\}}t|�}y|j|�}Wn-tk
r�tdt|�|f��nXt	||��Z\}	}
y)t
jt|
j
�dd��||<Wn!tk
rtd|��nXWdQXqPWWdQX|dd	}|d
d}|d}
|d
}|d}t|
||dd|d�}t|
||d|g||d|d|d|�S(Ns4Collection artifact at '%s' is not a valid tar file.RNR?s9Collection at '%s' does not contain the required file %s.RJRKsCCollection tar file member %s does not contain a valid json string.Rtcollection_infoRR*RRRFR6R(R)(Rat
is_tarfileR	RRbRt
_FILE_MAPPINGRctKeyErrorRdReRfRRgR1RR7(RR R(tinfoRrt
b_member_namet
property_namet
n_member_nametmemberRtt
member_objtmetaR*RRRF((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pytfrom_tar�s2
)



$cC`si}x�tjD]�\}}tjj||�}tjj|�sIqnt|d��Z}y)tjt	|j
�dd��||<Wn'tk
r�tdt
|���nXWdQXqWd|krD|dd}|d}	|d}
t	|d	dd�}tt|�d	�s7tjd
t	|�|f�d}n|d}n]tjd
t	|��tjjt	|dd��\}
}
tjj|
�d}	d}i}t|	|
|dd|�}|jdi�jdi�}t|	|
|d|g||d|d|d|dt�S(NtrbRJRKs=Collection file at '%s' does not contain a valid json string.RR�RRRFs^Collection at '%s' does not have a valid version set, falling back to '*'. Found version: '%s'R.R6sMCollection at '%s' does not have a MANIFEST.json file, cannot detect version.iRR*R(R)R!(RR�RURVRBR]RbReRfRRgR1R	RthasattrRRTR�R�RR7R�R�(RR R(R�tb_file_nameR�tb_file_pathtfile_objtmanifestRRRFR6t
parent_dirR�R*((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyt	from_paths>)


		
	$$cC`s�|jdd�\}}d}xg|D]I}y�|dkpd|jd�pd|jd�pd|jd�s�|jd�r�|jd�}n|j|||�}	|	}|	jg}
n=|j||�}	g|	D]}tjj	|�r�|^q�}
Wn.t
k
r }|jdkr�ng}
nX|
sMtj
d	||j|jf�q%ntj
d
||j|jf�Pq%Wtd||f��t||d||
||d|d
|�}
|
S(NROiR.R~R}s!=R|i�s2Collection '%s' is not available from server %s %ss*Collection '%s' obtained from server %s %ssFailed to find collection %s:%sR(R)(R�R7t
startswithtlstripR{RFtget_collection_versionsRt
version_retmatchRt	http_codeRTtvvvRRAR	R(t
collectiontapisR'R R(RRtgalaxy_metaRtrespRR2terrR�((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyt	from_nameIs6
*/
 !	(s
MANIFEST.jsons
manifest_file(s
FILES.jsons
files_fileN(t__name__t
__module__R�R7RZR+R,R-tpropertyR3R6R%RyRzR5R8tstaticmethodR�R�R�(((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyR5s$"				6			) *c
C`s:t|dd�}tjj|d�}tjj|�sRtdt|���nt|�}t||d|d�}t	|�}tjj|d|d|d|df�}t|dd�}	tjj|	�r#tjj
|	�rtd	t|���q#|s#td
t|���q#nt||	||�dS(s�
    Creates the Ansible collection artifact in a .tar.gz file.

    :param collection_path: The path to the collection to build. This should be the directory that contains the
        galaxy.yml file.
    :param output_path: The path to create the collection build artifact. This should be a directory.
    :param force: Whether to overwrite an existing collection build artifact or fail.
    :return: The path to the collection build artifact.
    RJRKs
galaxy.ymls3The collection galaxy.yml path '%s' does not exist.RRs%s-%s-%s.tar.gzRFsQThe output collection artifact '%s' already exists, but is a directory - abortingsWThe file '%s' already exists. You can use --force to re-create the collection artifact.N(RRURVRBR]R	Rt_get_galaxy_ymlt_build_files_manifestt_build_manifesttisdirt_build_collection_tar(
Rotoutput_pathR Rpt
b_galaxy_pathtcollection_metat
file_manifesttcollection_manifesttcollection_outputtb_collection_output((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pytbuild_collectionvs&
cC`s�|j|�}|r�d}x-t|jd��D]}|r1|}Pq1q1W|sdtd|��ntjd|j|jf�t��|j	||�WdQXtjd|j|jf�n tjd|j|j|f�dS(s~
    Publish an Ansible collection tarball into an Ansible Galaxy server.

    :param collection_path: The path to the collection tarball to publish.
    :param api: A GalaxyAPI to publish the collection to.
    :param wait: Whether to wait until the import process is complete.
    :param timeout: The time in seconds to wait for the import process to finish, 0 is indefinite.
    t/soPublishing the collection did not return valid task info. Cannot wait for task status. Returned task info: '%s's8Collection has been published to the Galaxy server %s %sNsRCollection has been successfully published and imported to the Galaxy server %s %ss�Collection has been pushed to the Galaxy server %s %s, not waiting until import has completed due to --no-wait being set. Import task results can be found at %s(
tpublish_collectionR7treversedR�R	RTRRAt_display_progresstwait_import_task(RoRtwaitttimeoutt
import_urittask_idtpath_segment((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyR��s 	
		c
C`s�t|�}t���}	tjd�t��&t|||	|||||�}
WdQXtjd�t��uxm|
j�D]_}y|j||	�Wqztk
r�}|r�tjdt	|�t	|�f�q��qzXqzWWdQXWdQXdS(s
    Install Ansible collections to the path specified.

    :param collections: The collections to install, should be a list of tuples with (name, requirement, Galaxy server).
    :param output_path: The path to install the collections to.
    :param apis: A list of GalaxyAPIs to query when searching for a collection.
    :param validate_certs: Whether to validate the certificates if downloading a tarball.
    :param ignore_errors: Whether to ignore any errors when installing the collection.
    :param no_deps: Ignore any collection dependencies and only install the base requirements.
    :param force: Re-install a collection if it has already been installed.
    :param force_deps: Re-install a collection as well as its dependencies if they have already been installed.
    sProcess install dependency mapNs#Starting collection install processsXFailed to install collection %s but skipping due to --ignore-errors being set. Error: %s(
t_find_existing_collectionst_tempdirRTR�t_build_dependency_maptvaluesRyR	R�R(
tcollectionsR�R�R\t
ignore_errorstno_depsR t
force_depstexisting_collectionsRntdependency_mapR�R�((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pytinstall_collections�s 




	cC`s?|jd�\}}}tj|�r+|Std|��dS(s�
    Validates the collection name as an input from the user or a requirements file fit the requirements.

    :param name: The input name with optional range specifier split by ':'.
    :return: The input value, required for argparse validation.
    t:s�Invalid collection name '%s', name must be in the format <namespace>.<collection>. Please make sure namespace and collection name contains characters from [a-zA-Z0-9_] only.N(t	partitionRtis_valid_collection_nameR	(RR�Rt((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pytvalidate_collection_name�s
cc`s7tjdttjdd��}|Vtj|�dS(NtdirRJRK(ttempfiletmkdtempRtCtDEFAULT_LOCAL_TMPR^R_(Rn((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyR��s!cc`s(|j|�}||fV|j�dS(N(textractfiletclose(ttarR�ttar_obj((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyRd�scc`s�d�}dtfd��Y}t}z�ymtj�}||�atjd|d||f�}t|_|j�z	dVWdt|_	|j
�XWntk
r��nXWd|aXdS(NcS`s�|jd�tj�}x�tr�x�dD]�}|j|ddt�tjd�xctr�y%|jdtdd�\}}}Wnt	j
k
r�PqVXt||�}|||�qVWt|dt�r)|jd	�dSq)WqWdS(
Ns(Starting display_progress display threads|/-\stnewlineg�������?tblockR�tfinishs7Received end signal for display_progress display thread(tdebugt	threadingtcurrent_threadR�RTRZttimetsleepR�tqueuetEmptytgetattr(t
display_queuetactual_displaytttctmethodtargstkwargstfunc((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pytprogresss 
	

	%
t
DisplayThreadcB`seZd�Zd�ZRS(cS`s
||_dS(N(R�(R&R�((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyR+sc`s��fd�}|S(Nc`s�jj�||f�dS(N(R�tput(R�R�(tattrR&(s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pytcall_displays((R&R�R�((R�R&s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyt__getattr__s(R�R�R+R�(((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyR�s	ttargetR�(tobjectRTR�tQueueR�tThreadR�tdaemontstartR�RBRj(R�R�told_displayR�R�((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyR��s"	
	
		
cC`s�t�}t�}t�}t�}t�}xp|D]h}|jdt�r`|j|d�ni|d6|d6|d6|jdd�}|j|d�q4Wtt|�t|�t|�t|��}y+t|d��}	tj	|	�}
WdQXWn5t
k
r2}tdt|�t|�f��nXt|
j
��}|j|�}
|
r�td	t|�d
jt|
��f��n|j|�}t|�dkr�tjdt|�d
j|�f�nx'|D]}||
kr�d|
|<q�q�WxX|D]P}|
j|d�}|dkr4g|
|<qt|t�s|g|
|<qqWx'|D]}||
kr^i|
|<q^q^W|
d
|
d<|
d
=|
S(NRLR/tstrR�tdictttypeR�sCFailed to parse the galaxy.yml at '%s' with the following error:
%ssMThe collection galaxy.yml at '%s' is missing the following mandatory keys: %ss, is7Found unknown keys in collection galaxy.yml at '%s': %stlicensetlicense_ids(R
RR�RZtaddt	frozensetR�Rbtyamlt	safe_loadRR	Rtkeyst
differenceRBRCR4RTR�RR7t
isinstance(tb_galaxy_yml_patht	meta_infotmandatory_keyststring_keyst	list_keyst	dict_keysR�t
key_list_typetall_keystg_yamlt
galaxy_ymlR�tset_keystmissing_keyst
extra_keystoptional_stringt
optional_listtlist_valt
optional_dict((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyR�8sZ					
0 (	 



c	`stdtfdtfdtftdj||��tfg��tdtfdtfdtfdtfdtfd	tfd
tfg��idd6dd6dd
6dd6td6�iidd6dd6dd
6dd6td6gd6td6������fd���||��S(Ns*.pycs*.retrys.gits{0}-{1}-*.tar.gztCVSs.bzrs.hgs.svnt__pycache__s.toxRRPtchksum_typeRStformatROR�R*c`s||k�x	tj|�D]��tjj|��}||krIdn|t|�d}ttjj|��dd�}tjj|�rut��fd��D��r�tj	dt|��qntjj
|�rtjj|�}t||�stj
dt|��qqn�j�}||d<d	|d
<�dj|�tjj
|�s�||�qq�dkr�qn<t��fd
��D��r�tj	dt|��qn�j�}||d<d|d
<d|d<t|dt�|d<�dj|�qWdS(NtiRJRKc3`s4|]*\}}|s"|�kr�|kVqdS(N((R9Rt	root_only(tb_itemtis_root(s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pys	<genexpr>�s	s"Skipping '%s' for collection buildsLSkipping '%s' as it is a symbolic link to a directory outside the collectionRR�RPR*s
galaxy.ymlc3`s:|]0\}}|s"|�krtj�|�VqdS(N(tfnmatch(R9t	b_patternR'(R(R)(s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pys	<genexpr>�s	RQRR$t	hash_funcRS(RURlRVRBR4RR�tanyRTR�tislinktrealpatht_is_child_pathR�tcopyR@RR(Rtb_top_level_dirt
b_abs_pathtb_rel_base_dirtrel_patht
b_link_targettmanifest_entry(t_walkt
b_ignore_dirstb_ignore_filestentry_templateR�(R(R)s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyR8�s@&!		




(RRZR�RR%R7tMANIFEST_FORMAT(RpRR((R8R9R:R;R�s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyR�ws*$0

0
cK`s�ii|d6|d6|d6|d6|d6|d6|d6|d6|rJ|ndd	6|	d
6|
d6|d6|d
6|
d6d6idd6dd6dd6dd6td6d6td6}|S(NRRRFtauthorstreadmettagstdescriptionRtlicense_fileR6t
repositoryt
documentationthomepagetissuesR�s
FILES.jsonRQRPRR$RSR%tfile_manifest_file(R7R<(RRRFR=R>R?R@R	RAR6RBRCRDRER�R�((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyR��s0
cC`s�ttj|dt�dd�}t|dt�|dd<ttj|dt�dd�}t��V}tjj	|tjj
|��}tj|dd���}x~d	|fd
|fgD]d\}	}
t
|
�}tj|	�}t|
�|_tj�|_d|_|jd|d
|�q�Wx?|dD]3}
|
ddkrIq-nt|
ddd�}tjj	|t|dd��}d�}tjj|�r5tjj|�}t||�r5tjj|dtjj|��}tj|�}tj|_t|dd�|_||�}|jd|�q-q5n|jtjj|�d|dtd|�q-WWdQXt j!||�d|dd|ddf}t"j"d|t#|�f�WdQXdS(NtindentRJRKR,RFRSRNsw:gzs
MANIFEST.jsons
FILES.jsoni�ttarinfotfileobjR*RROcS`sj|jtjkrF|jtj@}|s4|j�r:dnd|_nd|_|_d|_	|_
|S(Ni�i�iR&(RRatSYMTYPERNtstattS_IXUSRR�tuidtgidtunametgname(RHtexisting_is_exec((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyt
reset_stats$Rtarcnamet	recursivetfilters%s.%sR�RsCreated collection for %s at %s($RRetdumpsR�RRR�RURVRBtbasenameRaRbRtTarInfoR4tsizeR�tmtimeRNtaddfileRR.R/R0trelpathRkRJRtlinknameR
RZR^R1RTR(Rpt
b_tar_pathR�R�tfiles_manifest_jsontcollection_manifest_jsonRntb_tar_filepathttar_fileRtbtb_iottar_infoRvtfilenamet
b_src_pathRRR6t
b_rel_pathtcollection_name((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyR��sD!!!%	!		$	5cC`s�g}t|dd�}x�tj|�D]�}tjj||�}tjj|�r[q(nx�tj|�D]x}tjj||�}tjj|�rktj|t	�}t
jdt|�|j
t|�f�|j|�qkqkWq(W|S(NRJRKs(Found installed collection %s:%s at '%s'(RRURlRVRBtisfileR�RR�RZRTR�RR3R@(RVR�Rtb_namespaceRxtb_collectionRpR�((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyR�!scC`s�i}x?|D]7\}	}
}t|||	|
|||||p@|�	q
Wtg|j�D]}|jrXt|�^qX�}
x?t|�t|
�kr�x�|sPt|j��j|
�}t}x|D]w}||}|j	r�t
}xE|j	j�D]4\}}t||||d||||d|�	q�W|
j
|�q�q�W|r�Pq�q�Wt|j��j|
�}xK|D]C}||j�|s�t||j	�dkrs|
j
|�qsqsWqW|S(NR(i(t_get_collection_infoRR�R!RR4RRR�R6RZtitemsR7R
Rz(R�R�RnR�R\R R�R�R�RRFtsourceR�tchecked_parentstparents_to_checktdeps_exhaustedR(tparent_infotdep_nametdep_requirementtdeps_not_checkedR�((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyR�5s44	

	
c
C`sUd}
|	rd|	}
ntjdt|�|
f�d}tjjt|dd��r�tjdt|��t|dd�}n�t	|�j
j�dkr	tjd	|�yt||d|�}Wq	t
jk
r}td
t|�t|�f��q	Xn|rhtj||d|	�}
t|
�}||kr_||}|jd|
j�q�|
}nwt|�tjd|�||kr�||}|j|	|�n3|r�|gn|}tj||||d|	�}g|D]$}t|�t|�kr�|^q�}|rA|jrA|d
j|	|�|d
}n||t|�<dS(NR&s - as dependency of %ss(Processing requirement collection '%s'%sRJRKs-Collection requirement '%s' is a tar artifactthttpthttpss6Collection requirement '%s' is a URL to a tar artifacts/Failed to download collection tar from '%s': %sR(s7Collection requirement '%s' is the name of a collectioni(RwRx(RTR�RR7RURVRjRtvvvvturlparsetschemetlowerR[turllib_errortURLErrorR	RRR�R%R3R�R�R (tdep_mapR�R�R'RoRnR�R\R R(tdep_msgR^R�R�RiR�R�texisting((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyRm_sD
#
	

1
c
C`s�d}t�}tjjt|jdd�d��}t|ddd�}t|ddd�}	tjd|d|d	|	d
t	�j
}
tjd|t|�f�t
t|dd�d|d
|ddgdt��}t|
d��L}|j|�}
x3|
r3|j|
�|j|
�|j|�}
qWWdQX|r�|j�}tjd||f�||kr�td��q�n|
S(NiR�iiRJRKR�tprefixtsuffixtdeletesDownloading %s to %sR\RMtunredirected_headerst
Authorizationt
http_agenttwbs8Validating downloaded file hash %s with expected hash %ss+Mismatch artifact hash with downloaded file(RRURVtsplitextRtrsplitRR�tNamedTemporaryFileRZRRTR�RRR
RbRgtupdatetwritet	hexdigestRyR	(turlRRRR\RMtbufsizetdigestturlsplitR�t
b_file_extR�R�t
download_filetdatatactual_hash((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyR[�s*	('!	

c
C`s�t|dd�g}|djtjj�sL|j|dtjj�nxU|D]1}y|j|�}Wntk
r�qSnXPqSWtdt|dd���tjj	|t
|dd��}tjj|�}ytj|dd�Wn+t
k
r}|jtjkr�qnX|jtjkr�t
|jdd�}	t|	|d|�swtdt|�|	f��ntj|	|�n%tjj|�s�tj|d�nd	S(
s- Extracts a directory from a collection tar. RJRKi����s&Unable to extract '%s' from collectionRNi�t	link_names]Cannot extract symlink '%s' in collection: path points to location outside of collection '%s'N(RtendswithRURVtsepR@RcR�R	RBRRkR`tOSErrorterrnotEEXISTRRaRJR]R0tsymlinkR�tmkdir(
R�Rktb_desttmember_namesR�t
tar_membert
b_dir_patht
b_parent_pathtetb_link_path((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyRi�s2

!
c
C`s2t|dd�}t||��\}}|jtjkrKt|�}n0tjd|dt��}	t||	�}WdQX|r�||kr�t	d|t|j
�f��ntjj
tjj|t|dd���}
tjj|
�}t||�st	dt|dd���ntjj|�sDtj|dd	�n|jtjkr�t|jdd�}t||d
|
�s�t	dt|�|f��ntj||
�nvtjt|	j
dd�|
�|jt|dd��}d}
tj|j�tj@r|
d
O}
ntj|
|
�WdQXdS(s( Extracts a file from a collection tar. RJRKR�R�Ns4Checksum mismatch for '%s' inside collection at '%s'sSCannot extract tar entry '%s' as it will be placed outside the collection directoryRNi�R�s]Cannot extract symlink '%s' in collection: path points to location outside of collection '%s'i�iI(Rt_get_tar_file_memberRRaRJt
_consume_fileR�R�RZR	RRURVtabspathRBRRkR0R]R`R]R�R^tmoveRcRKtS_IMODERNRLtchmod(R�RfR�RnRRt
n_filenameR�R�R�ttmpfile_objtb_dest_filepathtb_parent_dirR�tnew_mode((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyRh�s8-
cC`set|dd�}y|j|�}Wn0tk
rWtdt|j�|f��nXt||�S(NRJRKs?Collection tar at '%s' does not contain the expected file '%s'.(RRcR�R	RRd(R�RfR�R�((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyR�s
cC`s�t|dd�}|rmtjj|�rmtjjt|dd��}tjjtjj||��}nt|dd�}||kp�|j|ttjj��S(s> Checks that path is a path within the parent_path specified. RJRK(	RRURVtisabsRkR�RBR�R�(RVtparent_pathR�Rt
b_link_dirR�((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyR0s$cC`swd}t�}|j|�}xL|rl|dk	rM|j|�|j�n|j|�|j|�}q!W|j�S(Ni(RRgR7R�tflushR�R�(t	read_fromtwrite_toR�t
sha256_digestR�((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyR�s		


(Zt
__future__RRRRt
__metaclass__R�R*ReR�RUR^RKtsysRaR�R�R�Rt
contextlibRtdistutils.versionRRthashlibRtioRt
yaml.errorRR�tImportErrorRtansible.constantst	constantsR�tansible.errorsR	tansible.galaxyR
tansible.galaxy.apiRRtansible.galaxy.user_agentR
tansible.module_utilsRtansible.module_utils._textRRRtansible.utils.collection_loaderRtansible.utils.displayRtansible.utils.hashingRRtansible.module_utils.urlsRtmovesturllibtparseRzterrorR}RTR<RR�R�R�R�R�RdR�R�R�R�R�R�R�R7RmR[RiRhR�R0R�(((s=/usr/lib/python2.7/site-packages/ansible/galaxy/collection.pyt<module>sx
	�B	#	$	"	:	?	P	!	9		+/	).	

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