HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //usr/lib/python3.9/site-packages/ansible/galaxy/__pycache__/api.cpython-39.pyc
a

�)g���@s�ddlmZmZmZeZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlmZddlmZmZddlmZmZddlmZmZmZmZmZddl m!Z"ddl#m$Z$dd	l%m&Z&dd
l'm(Z(ddl'm)Z)ddl*m+Z+dd
l,m-Z-m.Z.m/Z/ddl0m1Z1m2Z2ddl3m4Z4ddl5m6Z6ddl7m8Z8e4�Z9e�:�Z;dZ<ej=dej>hZ?dd�Z@dd�ZAdd�ZBdd�ZCe@dd��ZDdd�ZEGd d!�d!e$�ZFe�Gd"gd#��ZHGd$d%�d%�ZIejJGd&d'�d'��ZKdS)(�)�absolute_import�division�print_functionN)�
HTTPStatus)�
BadStatusLine�IncompleteRead)�	HTTPError�URLError)�quote�	urlencode�urlparse�parse_qs�urljoin)�	constants)�AnsibleError)�
user_agent)�retry_with_delays_and_condition)�generate_jittered_backoff)�string_types)�to_bytes�	to_native�to_text)�open_url�prepare_multipart)�Display)�
secure_hash_s)�
makedirs_safe�dics�fdd�}|S)Ncs6t��|i|��Wd�S1s(0YdS�N)�_CACHE_LOCK)�args�kwargs��func��6/usr/lib/python3.9/site-packages/ansible/galaxy/api.py�wrapped0szcache_lock.<locals>.wrappedr$)r#r&r$r"r%�
cache_lock/sr'cCs^t|t�r|jtvrdSt|t�rZt|dd�}rZt|t�rB|j}t|tt	t
tjf�rZdSdS)NT�orig_excF)
�
isinstance�GalaxyError�	http_code�RETRY_HTTP_ERROR_CODESr�getattrr	�reason�TimeoutErrorrr�socket�timeout)�	exceptionr(r$r$r%�should_retry_error7s
r3cs�fdd�}|S)z�
    Wrapper to lazily initialize connection info to Galaxy and verify the API versions required are available on the
    endpoint.

    :param versions: A list of API versions that the function supports.
    cs��fdd�}|S)Nc

s�|j�sjt�d|j�|j}d|j|f}|jdks@|jdkrDd}z|j|d|dd�}Wn�tttt	fy�}zx|�
d	�s�|�
d
�r��t|d
�}z|j|d|dd�}Wn4ty�}z|jdkr�|��WYd}~n
d}~00WYd}~n
d}~00d|v�rtd
||jf��||_|�
dddi�}t|���dgk�rBd|d<||_t�dd�|���|j|jf�t|j���}t���|�}	|	�s�td�jd���d�|�|j|jf���|g|�Ri|��S)Nz'Initial connection to galaxy_server: %sz6Error when finding available api versions from %s (%s)zhttps://galaxy.ansible.comzhttps://galaxy.ansible.com/zhttps://galaxy.ansible.com/api/�GETT)�method�error_context_msg�cachez/apiz/api/��available_versionszSTried to find galaxy API root at %s but no 'available_versions' are available on %s�v1zv1/zv2/�v2z1Found API version '%s' with Galaxy server %s (%s)�, zPGalaxy action %s requires API versions '%s' but only '%s' are available on %s %s)�_available_api_versions�display�vvvv�
api_server�name�_call_galaxyrr*�
ValueError�KeyError�endswith�_urljoinr+�get�list�keys�join�set�intersection�__name__)
�selfr r!�n_urlr6�data�errZnew_errr9Zcommon_versions)r5�versionsr$r%r&SsN

.
����z-g_connect.<locals>.decorator.<locals>.wrappedr$)r5r&�rR)r5r%�	decoratorRs8zg_connect.<locals>.decoratorr$)rRrTr$rSr%�	g_connectKs:rUcCs<t|�}d}z
|j}Wnty(Yn0d|j|p6dfS)z* Gets the cache ID for the URL specified. Nz%s:%s�)r�portrC�hostname)�url�url_inforWr$r$r%�get_cache_id�s
r[cCshd}tj�|�sXt�dt|��t|d��t�|d�Wd�n1sN0Yt�|�j	}|tj
@r�t�dt|��dSt|dd�� }t|��d	d
�}Wd�n1s�0Yzt
�|�}Wnty�d}Yn0t|t��r|�dd�|k�rdt�dt|��d|i}t|d
d��(}|�tt
�|�d	d
��Wd�n1�sZ0Y|S)zR Loads the cache file requested if possible. The file must not be world writable. �z/Creating Galaxy API response cache file at '%s'�wi�NzKGalaxy cache has world writable access (%s), ignoring it as a cache source.�rb��mode�surrogate_or_strict��errors�versionz:Galaxy cache file at '%s' has an invalid version, clearing�wb)�os�path�isfiler>r?r�open�chmod�stat�st_mode�S_IWOTH�warning�read�json�loadsrCr)�dictrG�writer�dumps)Zb_cache_pathZ
cache_versionZ
cache_mode�fdZjson_valr7r$r$r%�_load_cache�s.*
�.
8rvcGsd�dd�|dD��S)N�/css$|]}|rt|dd��d�VqdS)rarbrwN)r�strip)�.0�ar$r$r%�	<genexpr>��z_urljoin.<locals>.<genexpr>)rV)rJ)r r$r$r%rF�srFcs eZdZdZ�fdd�Z�ZS)r*z( Error for bad Galaxy server responses. c	sJtt|��|�|j|_|��|_zt|���}t	�
|�}WnttfyVi}Yn0|j�
d�}d|vr�|�d|j�}|�dd�}d||j||f}n�d|v�r|�dg�}	|	s�ig}	g}
|	D]F}|�d	�p�|�d
�p�|j}|�d�p�d}
d|j||
f}|
�|�q�d|d
�|
�f}n|�d|j�}d||j|f}t|�|_dS)Nrwr;�message�codeZUnknownz(%s (HTTP Code: %d, Message: %s Code: %s)�v3rcZdetail�titlez%(HTTP Code: %d, Message: %s Code: %s)z%s %sr<�defaultz%s (HTTP Code: %d, Message: %s))�superr*�__init__r~r+�geturlrYrrorprq�AttributeErrorrC�splitrGr.�appendrJrr})rNZ
http_errorr}Zhttp_msgZerr_infoZ	url_splitZ
galaxy_msgr~Zfull_error_msgrcZ
message_lines�errorZ	error_msgZ
error_codeZmessage_line��	__class__r$r%r��s6


zGalaxyError.__init__)rM�
__module__�__qualname__�__doc__r��
__classcell__r$r$r�r%r*�sr*�CollectionMetadata)�	namespacerA�created_str�modified_strc@seZdZdd�ZdS)�CollectionVersionMetadatac		Cs4||_||_||_||_||_||_||_||_dS)a�
        Contains common information about a collection on a Galaxy server to smooth through API differences for
        Collection and define a standard meta info for a collection.

        :param namespace: The namespace name.
        :param name: The collection name.
        :param version: The version that the metadata refers to.
        :param download_url: The URL to download the collection.
        :param artifact_sha256: The SHA256 of the collection artifact for later verification.
        :param dependencies: A dict of dependencies of the collection.
        :param signatures_url: The URL to the specific version of the collection.
        :param signatures: The list of signatures found at the signatures_url.
        N)r�rArd�download_url�artifact_sha256�dependencies�signatures_url�
signatures)	rNr�rArdr�r�r�r�r�r$r$r%r��sz"CollectionVersionMetadata.__init__N)rMr�r�r�r$r$r$r%r��sr�c	@s�eZdZdZddddddded�df	dd�Zd	d
�Zdd�Zd
d�Zdd�Z	e
egd��dd���Ze
edddd�ed�dEdd��ZdFdd�Zedd��Zedg�d d!��Zedg�dGd"d#��Zedg�dHd$d%��Zedg�dId&d'��Zedg�d(d)��Zedg�d*d+��Zedg�d,d-��Zedg�d.d/��Zedg�d0d1��Zedg�d2d3��Zedg�d4d5��Zed6d7g�d8d9��Zed6d7g�dJd;d<��Z ed6d7g�d=d>��Z!ed6d7g�d?d@��Z"ed6d7g�dAdB��Z#ed6d7g�dCdD��Z$dS)K�	GalaxyAPIzM This class is meant to be used as a API client for an Ansible Galaxy server NTF�inf�<c
Cs�||_||_||_||_||_||_||_||_|p6i|_||_	||_
ttj
dd�}
t|
dd�tj�|
d�|_|	r�t�>tj�|j�r�t�dt|j��t�|j�Wd�n1s�0Yd|_|
s�t|j�|_t�d|j|jf�dS)Nrarbi�r_sapi.jsonzClearing cache file (%s)z$Validate TLS certificates for %s: %s)�galaxyrA�username�password�tokenr@�validate_certsr1r=�	_priority�_server_timeoutr�CZGALAXY_CACHE_DIRrrfrgrJ�
_b_cache_pathr�existsr>r?r�remove�_cacherv�debug)rNr�rArYr�r�r�r��available_api_versionsZclear_response_cacheZno_cache�priorityr1Zb_cache_dirr$r$r%r�s.
*zGalaxyAPI.__init__cCs
t|j�S)z3Render GalaxyAPI as a native string representation.)rrA�rNr$r$r%�__str__3szGalaxyAPI.__str__cCs
t|j�S)z9Render GalaxyAPI as a unicode/text string representation.)rrAr�r$r$r%�__unicode__8szGalaxyAPI.__unicode__cCsdj||j|j|jd�S)z9Render GalaxyAPI as an inspectable string representation.z><{instance!s} "{name!s}" @ {url!s} with priority {priority!s}>)�instancerAr�rY)�formatrAr�r@r�r$r$r%�__repr__=s
��zGalaxyAPI.__repr__cCs(t||j�stS|j|jkp&|j|jkS)z:Return whether the instance priority is higher than other.)r)r��NotImplementedr�rA)rNZother_galaxy_apir$r$r%�__lt__Hs

�zGalaxyAPI.__lt__)r:r;rcCs|jSr)r=r�r$r$r%r�Ssz GalaxyAPI.available_api_versions���()ZretriesZ
delay_baseZdelay_threshold)Zbackoff_iteratorr3c	
Cs�t|�}	t|�}
|s|	j}t|	j�}|�r"|j�r"|j�|
i�}d}
d}||vrttj�||d|
�}tj�	�|k}d|vp�d|v}|r�|s�||}|�
d�r�d|vr�dd	dii}nd	di}g|d
<|d
D]}|d
�|�q�n|d
}|S|�s"tj�	�}|tjdd�7}|�
|
�dd
�||<|�p*i}|j|||d�z4t�d|�tt|�||j|||jt�dd�}Wnlt�y�}zt||��WYd}~nFd}~0t�y�}z$td|t|�f|d��WYd}~n
d}~00t|��dd�}zt�|�}Wn*t�y&td|jt|�f��Yn0|�r�|j�r�|j|
|}d}dD]}||v�rL|}�qh�qL|�r�d|d<|�d
g�}||D]}|�|��q�n||d
<|S)Nz%Y-%m-%dT%H:%M:%SZF�expiresZpage�offset�	paginatedz/v3/�links�next�resultsr\)Zdays)r�r�)�requiredzCalling Galaxy at %s�safe)rPr��headersr5r1�
http_agentZfollow_redirectsz8Unknown error when attempting to call Galaxy at '%s': %s�r(rarbz5Failed to parse Galaxy response from '%s' as JSON:
%s)rPr�T) rr[rgr
�queryr��
setdefault�datetime�strptimeZutcnowrGr�Z	timedelta�strftime�_add_auth_tokenr>r?rrr�r�rrr*�	ExceptionrrrorprqrCrY)rNrYr r�r5�
auth_requiredr6r7�	cache_keyrZZcache_idr��server_cacheZiso_datetime_formatZvalidr�Zis_paginated_urlZ
path_cache�res�result�resp�eZ	resp_datarPZ
paginated_key�keyr�r$r$r%rBYs�


�

�
��

zGalaxyAPI._call_galaxycCsDd|vrdS|js*|r*td�ttj����|jr@|�|j���dS)NZ
AuthorizationzMNo access token or username set. A token can be set with --api-key or at {0}.)r�rr�rr�ZGALAXY_TOKEN_PATH�updater�)rNr�rY�
token_typer�r$r$r%r��s
�zGalaxyAPI._add_auth_tokencCsLt|jdd��*}|�tt�|j�dd��Wd�n1s>0YdS)Nrer_rarb)rir�rsrrprtr�)rNrur$r$r%�
_set_cache�szGalaxyAPI._set_cacher:c
Cs�t|j|jdd�d}td|i�}zt|||jdt�|jd�}Wndtyp}zt	|d��WYd}~n@d}~0t
y�}z td	t|�|d
��WYd}~n
d}~00t
�t|��dd��}|S)
z2
        Retrieve an authentication token
        r:�tokensrw�github_token�POST)rPr�r5r�r1z$Attempting to authenticate to galaxyNz$Unable to authenticate to galaxy: %sr�rarb)rFr@r�rrr�rr�rr*r�rrrprqrro)rNr�rYr r�r�rPr$r$r%�authenticate�s*zGalaxyAPI.authenticatecCs�t|j|jdd�d}|||r$|ndd�}|r:||d<n"|�d�r\|td�dd	�|d<|j|t|�d
d�}|�dd	�r�|dS|S)
z(
        Post an import request
        r:�importsrwrV)�github_user�github_repoZgithub_referenceZalternate_role_namezansible-roler\Nr��r r5r�)rFr@r��
startswith�lenrBrrG)rNr�r�Z	reference�	role_namerYr rPr$r$r%�create_import_task�s
�

zGalaxyAPI.create_import_taskcCsdt|j|jdd�}|dur*d||f}n(|durJ|durJd|||f}ntd��|�|�}|dS)z5
        Check the status of an import task.
        r:r�Nz%s?id=%dz %s?github_user=%s&github_repo=%sz/Expected task_id or github_user and github_repor�)rFr@r�rrB)rN�task_idr�r�rYrPr$r$r%�get_import_task�s
zGalaxyAPI.get_import_taskcCs�ttt|���}z>|�d�}d�|dd��}|d}|rLt�d||f�Wntyltd|��Yn0t|j	|j
ddd||f�}|�|�}t|d	�dkr�|d	dSd
S)z&
        Find a role by name.
        �.r���z$- downloading role '%s', owned by %szAInvalid role name (%s). Specify role as format: username.rolenamer:�rolesz?owner__username=%s&name=%sr�N)
r�urlquoterr�rJr>r�rrFr@r�rBr�)rNr��notify�partsZ	user_namerYrPr$r$r%�lookup_role_by_name�s 

�
zGalaxyAPI.lookup_role_by_namec

Cs�g}z�t|j|jdd||d�}|�|�}|d}|�dd�du}t|j�}d|j|jf}|s�t||d�}|�|�}||d7}|�dd�du}q\Wn<ty�}	z$t	�
d||t|	�f�WYd}	~	n
d}	~	00|S)	z�
        Fetch the list of related items for the given role.
        The url comes from the 'related' field of the role.
        r:r�z
?page_size=50r��	next_linkNz%s://%s/zSUnable to retrieve role (id=%s) data (%s), but this is not fatal so we continue: %s)rFr@r�rBrGr�scheme�netlocr�r>rnr)
rNZrelatedZrole_idr�rYrP�donerZZbase_urlr�r$r$r%�fetch_role_relateds(�


�zGalaxyAPI.fetch_role_relatedc
Cs�z�t|j|jd|d�}|�|�}d|vr4|d}n|}d}d|vrT|�dd�du}|s�t|j|d�}|�|�}||d7}|�dd�du}qT|WSty�}z td|t|�f��WYd}~n
d}~00dS)	z4
        Fetch the list of items specified.
        r:z
?page_sizer�Tr�r�Nz"Failed to download the %s list: %s)rFr@r�rBrGr�rr)rNZwhatrYrPr�r�r�r$r$r%�get_list2s"


zGalaxyAPI.get_listc	Ks�t|j|jdddd�}|r4|dttt|���7}|�dd�}|�dd�}|�dd�}|�d	d�}|r�t|t�r�|�	d
�}|dd�
|�7}|r�t|t�r�|�	d
�}|d
d�
|�7}|r�|d|7}|r�|d|7}|�|�}|S)Nr:�searchr��?z&autocomplete=�tags�	platforms�	page_size�author�,z&tags_autocomplete=�+z&platforms_autocomplete=z
&page_size=%sz&username_autocomplete=%s)rFr@r�rr�rrGr)rr�rJrB)	rNr�r!Z
search_urlr�r�r�r�rPr$r$r%�search_rolesJs&


zGalaxyAPI.search_rolescCs>t|j|jdd�d}t||||d��}|j||dd�}|S)Nr:�notification_secretsrw)�sourcer�r��secretr�r�)rFr@r�rrB)rNr�r�r�r�rYr rPr$r$r%�
add_secreths�zGalaxyAPI.add_secretcCs&t|j|jdd�}|j|dd�}|S)Nr:r�T)r��rFr@r�rB)rNrYrPr$r$r%�list_secretstszGalaxyAPI.list_secretscCs.t|j|jdd|�d}|j|ddd�}|S)Nr:r�rwT�DELETE�r�r5r�)rNZ	secret_idrYrPr$r$r%�
remove_secretzszGalaxyAPI.remove_secretcCs2t|j|jddd||f�}|j|ddd�}|S)Nr:Z
removerolez?github_user=%s&github_repo=%sTr�r�r�)rNr�r�rYrPr$r$r%�delete_role�s

�zGalaxyAPI.delete_roler;rc
	Cs&t�d||j|jf�t|dd�}tj�|�sBtdt|���nt	�
|�s\tdt|���t|d��"}t|�
�tjd�}Wd�n1s�0Yt||d	d
�d��\}}|t|�d�}d
|jvr�t|j|jd
dd�d}nt|j|jdd�d}|j|||ddd|j|jfd�}	|	dS)z�
        Publishes a collection to a Galaxy server and returns the import task URI.

        :param collection_path: The path to the collection tarball to publish.
        :return: The import task URI that contains the import results.
        z,Publishing collection artifact '%s' to %s %srarbz2The collection path specified '%s' does not exist.zThe collection path specified '%s' is not a tarball, use 'ansible-galaxy collection build' to create a proper release artifact.r^)Z	hash_funcNzapplication/octet-stream)�filenameZ	mime_type)�sha256�file)zContent-typezContent-lengthrZ	artifacts�collectionsrwr;r�Tz+Error when publishing collection to %s (%s))r r�r5r�r6Ztask)r>rAr@rrfrgr�rr�tarfileZ
is_tarfilerirro�hashlibrrr�r�rFrB)
rNZcollection_pathZb_collection_pathZcollection_tarrZcontent_typeZb_form_datar�rOr�r$r$r%�publish_collection�s:
�0����

��zGalaxyAPI.publish_collectionrc

Csd}d}d|jvr,t|j|jdd|d�}nt|j|jdd|d�}t�d|�t��}d	}|d
ksxt��||k�r2z|j|ddd
|d�}WnTty�}z<|jdkr��t�d|�t�	|�WYd}~q^WYd}~n
d}~00|�
dd�}|�
dd��r�q2t�d||f�t�	|�td|d�}q^|dk�rLtdt
|���|�
dg�D]h}	|	d}
|
��dk�r�t�d|	d�n8|
��dk�r�t�d|	d�nt�d|
|	df��qX|dk�rt
|d�
d d!��}t
|d�
d"d#|��}td$||f��dS)%aH
        Waits until the import process on the Galaxy server has completed or the timeout is reached.

        :param task_id: The id of the import task to wait for. This can be parsed out of the return
            value for GalaxyAPI.publish_collection.
        :param timeout: The timeout in seconds, 0 is no timeout.
        ZwaitingNrzimports/collectionsrwr;zcollection-importsz1Waiting until Galaxy import task %s has completedr�rr4Tz,Error when getting import task results at %s)r5r�r6r8zJGalaxy import process has not started, wait %s seconds before trying again�stateZfinished_atzMGalaxy import process has a status of %s, wait %d seconds before trying again�g�?zUTimeout while waiting for the Galaxy import process to finish, check progress at '%s'�messages�levelr�zGalaxy import error message: %sr}rnz!Galaxy import warning message: %szGalaxy import message: %s - %sZfailedr~ZUNKNOWN�descriptionz&Unknown error, see %s for more detailsz+Galaxy import process failed: %s (Code: %s))r�rFr@r>�timerBr*r+Zvvv�sleeprG�minrr�lowerr�rn)
rNr�r1rrPZfull_url�start�waitr�r}rr~rr$r$r%�wait_import_task�s`	
��
�


"�

�
�zGalaxyAPI.wait_import_taskc
Cs�d|jvr|jd}ddg}n|jd}ddg}t|j|d||d�}d	|||j|jf}|j||d
�}i}|D]\}}	|�|	d�||<qnt||fi|��S)z�
        Gets the collection information from the Galaxy server about a specific Collection.

        :param namespace: The collection namespace.
        :param name: The collection name.
        return: CollectionMetadata about the collection.
        r)r�Z
created_at)r�Z
updated_atr;)r�Zcreated)r��modifiedrrwz=Error when getting the collection info for %s.%s from %s (%s))r6N)r�rFr@rArBrGr�)
rNr�rA�api_pathZ	field_mapZinfo_urlr6rP�metadataZ	api_fieldr$r$r%�get_collection_metadata�s$	

�
��z!GalaxyAPI.get_collection_metadatac
	Cs�|j�d|j�d��}|j|d||d|dg}t|�}d||||j|jf}|j||dd�}|��|�d	�png}	t|d
d|dd|d
|d|dd|dd|d|	�S)at
        Gets the collection information from the Galaxy server about a specific Collection version.

        :param namespace: The collection namespace.
        :param name: The collection name.
        :param version: Version of the collection to get the information for.
        :return: CollectionVersionMetadata about the collection at the version requested.
        rr;rrRrw�HError when getting collection version metadata for %s.%s:%s from %s (%s)T�r6r7r�r�rAZ
collectionrdr�Zartifactrrr�Zhref)r�rGr@rFrArBr�r��
rNr�rArdrZ	url_pathsZn_collection_urlr6rPr�r$r$r%�get_collection_version_metadatas
��z)GalaxyAPI.get_collection_version_metadatac
Cs2d}d|jvr&|jd}ddg}d}n|jd}dg}d|jvrDdnd}t|j|d	||d
d|tf�}t|�}|j}	|j�r*|j�t|�i�}
|
�di�}z|�	||�j
}Wn4ty�}
z|
jd
krȂgWYd}
~
Sd}
~
00|�
d||fd�}||k�r*||d||f<|j|
v�r"|
|	=|��d|||j|jf}z|j||d|	d�}Wn8t�y�}
z|
jd
k�rt�gWYd}
~
Sd}
~
00d|v�r�d}nd}g}|dd�||D�7}|}|D]}|�
|i�}�q�|�s�q&n$|�rt|t|�j�}|�|j|�}|jt|dd�|d|	d�}�q�|��|S)z�
        Gets a list of available versions for a collection on a Galaxy server.

        :param namespace: The collection namespace.
        :param name: The collection name.
        :return: A list of versions that are available.
        Frr�r�Tr;�limitr�rrRz/?%s=%drr8Nz%s.%szGError when getting available collection versions for %s.%s from %s (%s))r6r7r�rPr�cSsg|]}|d�qS)rdr$)ry�vr$r$r%�
<listcomp>ur|z5GalaxyAPI.get_collection_versions.<locals>.<listcomp>rarb)r�rFr@�COLLECTION_PAGE_SIZErrgr�r�r[rr�r*r+rGr�rArBr�replacer)rNr�rAZ
relative_linkrZpagination_pathZpage_size_nameZversions_urlZversions_url_infor�r�Zmodified_cacheZ
modified_daterQZcached_modified_dater6rPZresults_keyrRr�rgr$r$r%�get_collection_versions3sj	




�
�
z!GalaxyAPI.get_collection_versionsc

Cs�|j�d|j�d��}|j|d||d|dg}t|�}d||||j|jf}|j||dd�}|��z|d	}	Wn:ty�t�	d
|j�d|�d|�d
|���gYS0dd�|	D�SdS)aG
        Gets the collection signatures from the Galaxy server about a specific Collection version.

        :param namespace: The collection namespace.
        :param name: The collection name.
        :param version: Version of the collection to get the information for.
        :return: A list of signature strings.
        rr;rrRrwrTrr�zServer z has not signed r��:cSsg|]}|d�qS)Z	signaturer$)ryZsignature_infor$r$r%r�r|z7GalaxyAPI.get_collection_signatures.<locals>.<listcomp>N)
r�rGr@rFrArBr�rDr>r?rr$r$r%�get_collection_signatures�s
�$
z#GalaxyAPI.get_collection_signatures)NNNFNFN)NF)NN)NNN)T)r)%rMr�r�r��floatr�r�r�r�r��propertyrUr�rrr3rBr�r'r�r�r�r�r�r�r�r�r�r�r�rrrrrr!r#r$r$r$r%r�st�
$
��Y











-
A

 



W
r�)LZ
__future__rrr�typeZ
__metaclass__rr��	functoolsrrprfr0rkrr
�	threading�httprZhttp.clientrrZurllib.errorrr	�urllib.parser
r�rrr
rZansiblerr�Zansible.errorsrZansible.galaxy.user_agentrZansible.module_utils.apirrZansible.module_utils.sixrZansible.module_utils._textrrrZansible.module_utils.urlsrrZansible.utils.displayrZansible.utils.hashingrZansible.utils.pathrr>�LockrrZTOO_MANY_REQUESTSZBAD_GATEWAYr,r'r3rUr[rvrFr*�
namedtupler�r��total_orderingr�r$r$r$r%�<module>s\�D
"*