Anons79 Mini Shell

Directory : /proc/self/root/lib/python2.7/site-packages/ansible/module_utils/docker/
Upload File :
Current File : //proc/self/root/lib/python2.7/site-packages/ansible/module_utils/docker/common.pyc

�
�Udac@`s�ddlmZmZmZeZddlZddlZddlZddl	Z	ddl
mZddlm
Z
ddlmZmZmZddlmZmZddlmZddlmZdd	lmZmZeZeZeZ e!Z"y�dd
l#m$Z$ddl%m&Z'ddl(m)Z)m*Z*m+Z+dd
l,m-Z-ddl%m.Z.e
e'�e
d�kr�eZ ddl%m/Z0nAe
e'�e
d�kr�eZddl%m/Z0nddl%m0Z0Wn%e1k
r�Z2e3e2�Z"eZnXyddl4Z%eZ5Wne1k
reZ5nXyddl6Z%eZ7Wne1k
rKeZ7nXyddl#m8Z8Wn'e1k
r�de9fd��YZ8nXdZ:eZ;eZ<dZ=dZ>dZ?e@de@ddde:dedgfd d!g�d"e@ddde=ded#gf�d$e@dddd%ded&gfd d'g�d(e@dd)de?ded*gf�d+e@dd,d d-d.g�d/e@dd,d d0d1g�d2e@dd,d d3d4g�d5e@ddded6gf�d7e@dd8de;ded9gf�d:e@dd8de<ded;gfd d<g�d=e@dd8de��ZAgZBd/d2ggZCd>ZDd?ZEd@dAdBdCdDdEgZFer�e!Z'dFeGfdG��YZ0dHe9fdI��YZ)dJe9fdK��YZ*ndL�ZHedM�ZIdN�ZJdOeGfdP��YZKdQ�ZLdR�ZMdS�ZNdTZOdUZPdVZQdWe0fdX��YZRdY�ZSdZ�ZTd[eGfd\��YZUd]�ZVd^�ZWd_�ZXd`�ZYdS(ai(tabsolute_importtdivisiontprint_functionN(t	timedelta(tLooseVersion(t
AnsibleModuletenv_fallbacktmissing_required_lib(tMappingtSequence(tstring_types(turlparse(t
BOOLEANS_TRUEtBOOLEANS_FALSE(tSSLError(t__version__(tAPIErrortNotFoundtTLSParameterError(t	TLSConfig(tauths3.0.0(t	APIClients2.0.0(tClient(tRequestExceptionRcB`seZRS((t__name__t
__module__(((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pyRWssunix://var/run/docker.sockt	localhosts1.8.0i<tdocker_hostttypetstrtdefaulttfallbacktDOCKER_HOSTtaliasest
docker_urlttls_hostnametDOCKER_TLS_HOSTNAMEtapi_versiontautotDOCKER_API_VERSIONtdocker_api_versionttimeouttinttDOCKER_TIMEOUTtca_certtpathttls_ca_certtcacert_pathtclient_certttls_client_certt	cert_patht
client_keyttls_client_keytkey_pathtssl_versiontDOCKER_SSL_VERSIONttlstboolt
DOCKER_TLStvalidate_certstDOCKER_TLS_VERIFYt
tls_verifytdebugshttps://index.docker.io/v1/s[^@]+@[^@]+\.[^@]+tBtKBtMBtGBtTBtPBRcB`seZd�ZRS(cK`sdS(N((tselftkwargs((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pyt__init__�s(RRRG(((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pyR�sRcB`seZRS((RR(((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pyR�sRcB`seZRS((RR(((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pyR�scC`stjd|�rtStS(sACheck whether the given image name is in fact an image ID (hash).s^sha256:[0-9a-fA-F]{64}$(tretmatchtTruetFalse(tname((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pytis_image_name_id�scC`s |s
|Sttjd|��S(s:Check whether the given string is a valid docker tag name.s#^[a-zA-Z0-9_][a-zA-Z0-9_.-]{0,127}$(R9RHRI(ttagtallow_empty((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pytis_valid_tag�scC`sct|t�r)td�|j�D��St|ttf�r[g|D]}t|�^qES|SdS(s�Sanitize data object for return to Ansible.

    When the data object contains types such as docker.types.containers.HostConfig,
    Ansible will fail when these are returned via exit_json or fail_json.
    HostConfig is derived from dict, but its constructor requires additional
    arguments. This function sanitizes data structures by recursively converting
    everything derived from dict to dict and everything derived from list (and tuple)
    to a list.
    cs`s'|]\}}|t|�fVqdS(N(tsanitize_result(t.0tktv((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pys	<genexpr>�sN(t
isinstancetdicttitemstlistttupleRQ(tdataRT((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pyRQ�s

tDockerBaseClasscB`seZd�Zed�ZRS(cC`s
t|_dS(N(RKR>(RE((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pyRG�scC`sdS(N((REtmsgtpretty_print((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pytlog�s(RRRGRKR^(((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pyR[�s	cC`s`|ddkr\t|d�}d|jkrO|j|jjd� |d<q\||d<ndS(NR#Rt:(tNoneRtnetloctrindex(tresultt
parsed_url((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pytupdate_tls_hostname�s
 cK`s<yt|�}|SWn!tk
r7}|d|�nXdS(NsTLS config error: %s(RR(t
fail_functionRFt
tls_configtexc((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pyt_get_tls_config�s
cC`s�|ds|dr1|djdd�|d<n|dr|dr|dr|dr�td	|d|dfd
|ddtd|d
d|dd|�}n=td	|d|dfdtd|d
d|dd|�}td|dd|d|dd|d�S|dr}|dr}td
|dd|d
dtd|dd|�}td|dd|d|dd|d�S|dr�tdtd|d
d|dd|�}td|dd|d|dd|d�S|drW|drW|drWtd	|d|dfdtd|dd|�}td|dd|d|dd|d�S|dr�tdtd|dd|�}td|dd|d|dd|d�Std|dd|dd|d�S(NR8R=Rstcp://shttps://R2R5R/R0R,tverifytassert_hostnameR#R6Rftbase_urltversionR%R)(treplaceRiRJRVRK(RRfRg((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pytget_connect_params�st





	


	



	

	


	

s?Try `pip uninstall docker-py` followed by `pip install docker`.s.Use `pip install --upgrade docker` to upgrade.s�Use `pip install --upgrade docker-py` to upgrade. Hint: if you do not need Python 2.6 support, try `pip uninstall docker-py` instead, followed by `pip install docker`.tAnsibleDockerClientcB`s�eZdedddeddddd�
Zed�Zd�Zed��Z	e
d��Zd�Zdd�Z
d�Zdd�Zddd	�Zd
�Zed�Zd�Zd
d�Zdd�Zd�ZRS(cC`s|
p	i|_t�}|jt�|rD|j|�||_ng}|t7}|rg||7}ng}
|
t7}
|r�|
|7}
ntd|d|d|d|
d|�|_t	|�t	d�k}t	t
�|_tr
t
r
|jdtj�tjf�ntsY|r/td�}|d	}ntd
�}|d}|j|t�n|jt	|�kr�d}|s�|t7}n)t
t	d
�kr�|t7}n
|t7}|j|t
tj�tj|f�n|jjjd�|_|jj|_t|jd|j�|_y0t t!|�j"|j�|j#�d|_$WnGt%k
rq}|jd|�n$t&k
r�}|jd|�nXt	|j$�|_'|dk	r�|j't	|�kr�|jd|j$|f�q�n|dk	r|j)||	�ndS(Nt
argument_spectsupports_check_modetmutually_exclusivetrequired_togethertrequired_ifs2.0.0s�Cannot have both the docker-py and docker python modules (old and new version of Docker SDK for Python) installed together as they use the same namespace and cause a corrupt installation. Please uninstall both packages, and re-install only the docker-py or docker python module (for %s's Python %s). It is recommended to install the docker module if no support for Python 2.6 is required. Please note that simply uninstalling one of the modules can leave the other module in a broken state.sDocker SDK for Python: dockers9, for example via `pip install docker`. The error was: %ssGDocker SDK for Python: docker (Python >= 2.7) or docker-py (Python 2.6)sa, for example via `pip install docker` or `pip install docker-py` (Python 2.6). The error was: %ss\Error: Docker SDK for Python version is %s (%s's Python %s). Minimum version required is %s.s2.0R>Rft
ApiVersionsDocker API error: %ssError connecting: %ss9Docker API version is %s. Minimum version required is %s.(*tfail_resultsRVtupdatetDOCKER_COMMON_ARGStarg_spectDOCKER_MUTUALLY_EXCLUSIVEtDOCKER_REQUIRED_TOGETHERRtmoduleRtdocker_versiontdocker_py_versiontHAS_DOCKER_MODELStHAS_DOCKER_SSLADAPTERtfailtplatformtnodetsyst
executablet
HAS_DOCKER_PYRtHAS_DOCKER_ERRORt DOCKERPYUPGRADE_RECOMMEND_DOCKERt DOCKERPYUPGRADE_SWITCH_TO_DOCKERtDOCKERPYUPGRADE_UPGRADE_DOCKERtparamstgetR>t
check_modeRotauth_paramst_connect_paramstsuperRpRGRmtdocker_api_version_strRt	ExceptionR(R`t_get_minimal_versions(RERqRrRsRtRutmin_docker_versiontmin_docker_api_versiontoption_minimal_versionst%option_minimal_versions_ignore_paramsRwtmerged_arg_spectmutually_exclusive_paramstrequired_together_paramstNEEDS_DOCKER_PY2R\Rh((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pyRG#sp	





	




) cC`sdS(N((RER\R]((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pyR^xscK`s3|jj|�|jjd|t|j��dS(NR\(RwRxR}t	fail_jsonRQ(RER\RF((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pyR��scC`s�|dk	r0|tkrtS|tkr,tS|S|dk	r�tjj|�}|dk	r�|dkrytjj	|d�S|dkr�tjj	|d�S|dkr�tjj	|d�S|tkr�tS|tkr�tS|Sn|S(NR2scert.pemR/sca.pemR5skey.pem(
R`RRJR
RKtostenvironR�R-tjoin(t
param_nametparam_valuetenv_variablet
default_valuet	env_value((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pyt
_get_value�s*cC`s�|jd�t�}x'tD]}|jjj|�||<qW|jjjd�r�|jjjd�}|dkr�t|d<n|dkr�t|d<q�ntd|jd|ddt�d	|jd	|d	d
t	�d|jd|ddd
�d|jd|ddd�d|jd|ddd�d|jd|ddd�d|jd|ddd�d|jd|ddt�d|jd|ddt�d|jd|ddt
��
}t|�|S(NsGetting credentialstuse_tlstencryptR8RjR;RR R#R$R%R'R&R/R,tDOCKER_CERT_PATHR2R0R5R3R6R7R:R=t	tls_verfyR<R)R+(R^RVRyR}R�R�RJR�tDEFAULT_DOCKER_HOSTtDEFAULT_TLS_HOSTNAMER`tDEFAULT_TLStDEFAULT_TLS_VERIFYtDEFAULT_TIMEOUT_SECONDSRe(RER�tkeyR�Rc((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pyR��s8
	

			
cC`sitjdt|��}|rT|jd|jd|jd�|jd�f�n|jd|�dS(Ns!hostname.*doesn\'t match (\'.*\')s'You asked for verification that Docker daemons certificate's hostname matches %s. The actual certificate's hostname is %s. Most likely you need to set DOCKER_TLS_HOSTNAME or pass `tls_hostname` with a value of %s. You may also use TLS without verification by setting the `tls` parameter to true.R#isSSL Exception: %s(RHRIRR�R�tgroup(REterrorRI((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pyt_handle_ssl_error�s
	-c
	C`szt�|_xE|jjD]7}|dk	r@||kr@qq@nt�|j|<qW|jj|�x|jj�D]�\}}t}t}d|kr�|jt	|d�k}nd|kr�|j
t	|d�k}n|o�||d<|dstd|kr|d|�}n^|jjj|�dk	}|rsd|jj|krs|jj||jj|dk}n|rrd|kr�|d}n
d|f}|s�d}	|	|j
|d|f}	n�|sRd	}	t	|d�t	d
�kr�|	t7}	n,|jt	d
�kr|	t7}	n
|	t7}	|	ttj�tj|d|f}	n
d|f}	|j|	�qrqtqtWdS(NRR(t	supportedtdetect_usageRt	usage_msgs
set %s options?Docker API version is %s. Minimum version required is %s to %s.s\Docker SDK for Python version is %s (%s's Python %s). Minimum version required is %s to %s. s2.0.0s"Cannot %s with your configuration.(RVR�R}RqR`RxRWRJRRR(R�R�R�R�R�R�R~R�R�R�R�R�(
RER�t
ignore_paramstoptionRZtsupport_docker_pytsupport_docker_apitusedtusgR\((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pyR��sL	
'




)
cC`svy8|jd|�|jd|�}|jd�|SWn7tk
rN}dStk
rq}|jd|�nXdS(NsInspecting container Id %st	containersCompleted container inspectionsError inspecting container: %s(R^tinspect_containerRR`R�R�(REtcontainer_idRctdummyRh((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pytget_container_by_ids
cC`s9|dkrdS|}|jd�s2d|}nd}y�x�|jdt�D]}|jd|d�t|dt�r�||dkr�|}Pn|dj|�r�|}Pn|d|krN|}PqNqNWWnCtk
r�}|j|�n$t	k
r}|j
d|�nX|dkr(dS|j|d�S(sG
        Lookup a container and return the inspection results.
        t/tallstesting container: %stNamestIds#Error retrieving container list: %sN(R`t
startswitht
containersRJR^RURXRR�R�R�R�(RERLtsearch_nameRcR�Rh((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pyt
get_containers2
#cC`su|dkr|dkrdSd}|dkr�ygx`|j�D]R}|jd|d�||dkrs|}Pn|dj|�r>|}Pq>q>WWq�tk
r�}|j|�q�tk
r�}|jd|�q�Xn|dk	r�|d}n|dk	rqy1|jd|�|j|�}|jd�Wqqt	k
rJ}dStk
rm}|jd|�qqXn|S(	sE
        Lookup a network and return the inspection results.
        stesting network: %stNameR�s!Error retrieving network list: %ssInspecting network Id %ssCompleted network inspectionsError inspecting network: %sN(
R`tnetworksR^R�RR�R�R�tinspect_networkR(RERLt
network_idRctnetworkRhR�((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pytget_network5s:
c	C`s�|s
dS|jd||f�|j||�}|stj|�\}}|dkr|jd|�|j||�}|r�|jd�r�|td�}|jd|�|j||�}n|sd||f}|jd|�|j||�}qqnt|�dkr7|jd||f�nt|�dkr�y|j|dd	�}Wn[t	k
r�|jd
||f�dSt
k
r�}|jd||t|�f�nX|S|jd
||f�dS(
sV
        Lookup an image (by name and tag) and return the inspection results.
        sFind image %s:%ss	docker.iosCheck for docker.io image: %sslibrary/s%s/%sis0Registry returned more than one result for %s:%siR�sImage %s:%s not found.s!Error inspecting image %s:%s - %sN(R`R^t
_image_lookupRtresolve_repository_nameR�tlenR�t
inspect_imageRR�R(	RERLRNtimagestregistryt	repo_nametlookupt
inspectionRh((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pyt
find_image\s<
$cC`s�|s
dS|jd|�y|j|�}Wnztk
r{}|sf|jd|t|�f�n|jd|�dStk
r�}|jd|t|�f�nX|S(sL
        Lookup an image (by ID) and return the inspection results.
        sFind image %s (by ID)s!Error inspecting image ID %s - %ssImage %s not found.N(R`R^R�RR�RR�(REtimage_idtaccept_missing_imageR�Rh((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pytfind_image_by_id�s !cC`s�y|jd|�}Wn0tk
rH}|jd|t|�f�nX|}|r�d||f}d||f}g}x`|D]U}|jd�}	|jd�}
|	r�||	ks�|
r�||
kr�|g}Pq�q�Wn|S(s�
        Including a tag in the name parameter sent to the Docker SDK for Python images method
        does not work consistently. Instead, get the result set for name and manually check
        if the tag exists.
        RLs!Error searching for image %s - %ss%s:%ss%s@%stRepoTagstRepoDigests(R�R�R�RR�(RERLRNtresponseRhR�R�t
lookup_digesttimagettagstdigests((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pyR��s !
$	tlatestcC`sC|jd||f�|j||�}y�x�|j|d|dtdt�D]�}|j|dt�|jd�rN|jd�r�|jd�}|jd||jd	�|jd
�f�q�|jd||jd�f�qNqNWWn3tk
r }|jd||t|�f�nX|j||�}|||kfS(
s
        Pull an image
        sPulling image %s:%sRNtstreamtdecodeR]R�terrorDetails'Error pulling %s - code: %s message: %stcodetmessagesError pulling %s - %ssError pulling image %s:%s - %s(R^R�tpullRJR�R�R�R(RERLRNtold_tagtlineterror_detailRhtnew_tag((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pyt
pull_image�s (+$cC`s�|dkrdg}nx0|D](}t|t�s8dS|j|�}qWt|t�r�x[|D]}|jjdj|��qaWn1t|t�r�|r�|jjdj|��ndS(sw
        Checks result of client operation for warnings, and if present, outputs them.

        warnings_key should be a list of keys used to crawl the result dictionary.
        For example, if warnings_key == ['a', 'b'], the function will consider
        result['a']['b'] if these keys exist. If the result is a non-empty string, it
        will be reported as a warning. If the result is a list, every entry will be
        reported as a warning.

        In most cases (if warnings are returned at all), warnings_key should be
        ['Warnings'] or ['Warning']. The default value (if not specified) is ['Warnings'].
        tWarningsNsDocker warning: {0}(	R`RURR�R	R}twarntformatR
(RERctwarnings_keyR�twarning((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pytreport_warnings�s


 cK`s�|jtd�krxtj|�d}tj||�}|rx|j|j|jd|�di|d6�dt�Snt	t
|�j||�S(s�
        Get image digest by directly calling the Docker API when running Docker SDK < 4.0.0
        since prior versions did not support accessing private repositories.
        s4.0.0is/distribution/{0}/jsontheaderssX-Registry-Authtjson(RRRR�tget_config_headert_resultt_gett_urlRJR�Rptinspect_distribution(RER�RFR�theader((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pyR��s
N(RRR`RKtMIN_DOCKER_VERSIONRGR^R�tstaticmethodR�tpropertyR�R�R�R�R�R�R�R�R�R�R�R�(((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pyRp!s&		R
	)	
2	"'	-	cC`sEx>|j�D]0\}}||kr)tS|||kr
tSq
WtS(sY
    Compare two dictionaries for whether every entry of the first is in the second.
    (RWRKRJ(tavtbvR�tvalue((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pytcompare_dict_allow_more_present�scC`sa|dkrtS|dks(|dkr�||kr8tS|dkrHtS|dkrd|dkrdtSt|dkry|n|�dkS|dkr�||kS|dkr/|dkr�||kSd}xa|D]Y}x0|t|�kr|||kr|d7}q�W|t|�krtS|d7}q�WtSn.|dkra|dkrQ||kSt||�Sn�|d	kr�t|�}t|�}|dkr�||kS||kSn�|d
kr]xH|D]@}t}	x'|D]}
t||
�r�t}	Pq�q�W|	s�tSq�W|dkrYxK|D]@}
t}	x'|D]}t||
�r%t}	Pq%q%W|	stSqWntSdS(s
    Compare values a and b as described by method and datatype.

    Returns ``True`` if the values compare equal, and ``False`` if not.

    ``a`` is usually the module's parameter, while ``b`` is a property
    of the current object. ``a`` must not be ``None`` (except for
    ``datatype == 'value'``).

    Valid values for ``method`` are:
    - ``ignore`` (always compare as equal);
    - ``strict`` (only compare if really equal)
    - ``allow_more_present`` (allow b to have elements which a does not have).

    Valid values for ``datatype`` are:
    - ``value``: for simple values (strings, numbers, ...);
    - ``list``: for ``list``s or ``tuple``s where order matters;
    - ``set``: for ``list``s, ``tuple``s or ``set``s where order does not
      matter;
    - ``set(dict)``: for ``list``s, ``tuple``s or ``sets`` where order does
      not matter and which contain ``dict``s; ``allow_more_present`` is used
      for the ``dict``s, and these are assumed to be dictionaries of values;
    - ``dict``: for dictionaries of values.
    tignoreRtallow_more_presentiRXtstrictiRVtsets	set(dict)N(RJR`RKR�RR(tatbtmethodtdatatypetiRTtset_atset_bRtfoundR((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pytcompare_genericsh"


%






tDifferenceTrackercB`s\eZd�Zddd�Zd�Zed��Zd�Zd�Z	d�Z
d�ZRS(	cC`s
g|_dS(N(t_diff(RE((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pyRG^scC`s)|jjtd|d|d|��dS(NRLt	parametertactive(RtappendRV(RERLRR((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pytaddascC`s|jj|j�dS(N(Rtextend(REt
other_tracker((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pytmergehscC`st|j�dkS(Ni(R�R(RE((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pytemptykscC`sTt�}t�}x5|jD]*}|d||d<|d||d<qW||fS(s8
        Return texts ``before`` and ``after``.
        RRLR(RVR(REtbeforetaftertitem((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pytget_before_afteros		c`st�fd�|jD��S(sC
        Returns a boolean if a difference exists for name
        c3`s%|]}|d�kr|VqdS(RLN((RRtdiff(RL(sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pys	<genexpr>~s(tanyR(RERL((RLsF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pythas_difference_forzscC`sYg}xL|jD]A}t�}td|dd|d�||d<|j|�qW|S(sK
        Return differences in the docker_container legacy format.
        RR�RRL(RRVR(RERctentryR((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pyt!get_legacy_docker_container_diffs�s	
cC`s$g|jD]}|d^q
}|S(sK
        Return differences in the docker_container legacy format.
        RL(R(RER#Rc((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pytget_legacy_docker_diffs�s N(RRRGR`RRRRRR"R$R%(((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pyR]s					cC`st�}|dk	r{xc|j�D]R\}}|tkrCd}n!|tkrXd}nt|�}||t|�<q"Wn|S(s
    Go doesn't like Python booleans 'True' or 'False', while Ansible is just
    fine with them in YAML. As such, they need to be converted in cases where
    we pass dictionaries to the Docker API (e.g. docker_network's
    driver_options and docker_prune's filters).
    ttruetfalseN(RVR`RWRJRKR(RZRcRSRT((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pyt"clean_dict_booleans_for_docker_api�s			cC`s�t|t�s"td|��ntjd�}|j|�}|sYtd|��n|j�}i}x3|j�D]%\}}|rxt|�||<qxqxWt	|�}|j
|j|jddd	d
}|S(s-
    Return time duration in nanosecond.
    sMissing unit in duration - %ssw^(((?P<hours>\d+)h)?((?P<minutes>\d+)m(?!s))?((?P<seconds>\d+)s)?((?P<milliseconds>\d+)ms)?((?P<microseconds>\d+)us)?)$sInvalid time duration - %siii
iii@Bi�(
RURt
ValueErrorRHtcompileRIt	groupdictRWR*Rtmicrosecondstsecondstdays(ttime_strtregextpartsttime_paramsRLRtdeltattime_in_nanoseconds((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pytconvert_duration_to_nanosecond�s 	 cC`s�|s|jd�rd
St�}tdddddddddd�}dddg}x`|j�D]R\}}||krg|j|�d	kr�qgn||kr�t|j|��}|r�|||<q�q�|j|�r�|j|�||<|dkr_t||ttf�rBg||D]}t|�^q#||<q�dt||�g||<q�|dkr�yt	||�||<Wq�t
k
r�t
dj||���q�Xq�q�qgqgW|ddgkr�d	tfS|t
fS(s�
    Return dictionary of healthcheck parameters and boolean if
    healthcheck defined in image was requested to be disabled.
    ttesttintervalR)tstart_periodtretriess	CMD-SHELLsOCannot parse number of retries for healthcheck. Expected an integer, got "{0}".tNONEN(NN(R�R`RVRWR5RURYRXRR*R)R�RJRK(thealthcheckRctoptionstduration_optionsR�Rttimete((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pytparse_healthcheck�sD		*
!
cC`std�|j�D��S(sP
    Return a copy of the dictionary with all keys with value None omitted.
    cs`s-|]#\}}|dk	r||fVqdS(N(R`(RRRSRT((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pys	<genexpr>s(RVRW(td((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pytomit_none_from_dicts(Zt
__future__RRRRt
__metaclass__R�R�RHR�tdatetimeRtdistutils.versionRtansible.module_utils.basicRRRt/ansible.module_utils.common._collections_compatRR	tansible.module_utils.sixR
t+ansible.module_utils.six.moves.urllib.parseRt)ansible.module_utils.parsing.convert_boolRR
RJR�RKtHAS_DOCKER_PY_2tHAS_DOCKER_PY_3R`R�trequests.exceptionsRtdockerRR~t
docker.errorsRRRt
docker.tlsRRRRtImportErrorRhRt
docker.modelsR�tdocker.ssladapterR�RR�R�R�R�R�R�R�RVRyR{R|tDEFAULT_DOCKER_REGISTRYtEMAIL_REGEXt
BYTE_SUFFIXEStobjectRMRPRQR[ReRiRoR�R�R�RpRRRR(R5R@RB(((sF/usr/lib/python2.7/site-packages/ansible/module_utils/docker/common.pyt<module>s�







-$-$$-				
		K��		]9		!	7

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