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/memset.pyo

�
�Udac@swddlmZddlmZmZddlmZdefd��YZd
d�Z
d�Zd�Zd	�Z
d
S(i����(t	urlencode(topen_urlturllib_error(tjsontResponsecBs eZdZd�Zd�ZRS(s=
    Create a response object to mimic that of requests.
    cCsd|_d|_dS(N(tNonetcontenttstatus_code(tself((s?/usr/lib/python2.7/site-packages/ansible/module_utils/memset.pyt__init__&s	cCstj|j�S(N(RtloadsR(R((s?/usr/lib/python2.7/site-packages/ansible/module_utils/memset.pyR*s(t__name__t
__module__t__doc__R	R(((s?/usr/lib/python2.7/site-packages/ansible/module_utils/memset.pyR!s	c
Cs�t�}|dkr!t�}n|j�}t}d}t|�}idd6}d}dj||�}	yUt|	d|d|ddd	td
|�}
|
j	�j
d�|_|
j�|_
Wn�tjk
r�}y
|j}Wntk
r�d}nXt}|j	�j
d�|_||_
|j
dk	r`d
j|j
|j�d|j�d�}q�dj|j�d|j�d�}nX|dkr�|j�}n|||fS(s�
    Generic function which returns results back to calling function.

    Requires an API key and an API method to assemble the API URL.
    Returns response text to be analysed.
    s!application/x-www-form-urlencodedsContent-Typeshttps://api.memset.com/v1/json/s{0}{1}/tdatatheaderstmethodtPOSTtforce_basic_authturl_usernamesutf-8tutf8s.Memset API returned a {0} response ({1}, {2}).t
error_typeterrors(Memset API returned an error ({0}, {1}).N(RRtdicttcopytFalseRtformatRtTruetreadtdecodeRtgetcodeRRt	HTTPErrortcodetAttributeErrorR(
tapi_keyt
api_methodtpayloadtresponset
has_failedtmsgRRtapi_uri_basetapi_uritresptet	errorcode((s?/usr/lib/python2.7/site-packages/ansible/module_utils/memset.pytmemset_api_call.s8	
*


	/*cCsLt}|jdkrHx0|j�D]}|d|kr"t}q"q"Wn|S(sB
    Returns true if domain already exists, and false if not.
    i�i�tdomain(i�i�(RRRR(RR.texiststzone_domain((s?/usr/lib/python2.7/site-packages/ansible/module_utils/memset.pytcheck_zone_domainascCsqd}t}|jdkrgx1|j�D]#}|d|kr(|d7}q(q(W|dkrgt}qgn||fS(s@
    Returns true if zone already exists, and false if not.
    ii�i�tnicknamei(i�i�(RRRR(RtnametcounterR/tzone((s?/usr/lib/python2.7/site-packages/ansible/module_utils/memset.pyt
check_zoneoscCs�t}d\}}g}x2|D]*}|d|kr|j|d�qqWt|�}|dkrnd}n:|dkr�|d}t}n|dkr�d}d}n||||fS(	s:
    Returns the zone's id if it exists and is unique
    R2tidisNo matching zone foundisCZone ID could not be returned as duplicate zone names were detectedN(NN(RRtappendtlenR(t	zone_namet
current_zonestzone_existstzone_idR't	zone_listR5R4((s?/usr/lib/python2.7/site-packages/ansible/module_utils/memset.pytget_zone_id�s 
	
		N(t+ansible.module_utils.six.moves.urllib.parseRtansible.module_utils.urlsRRtansible.module_utils.basicRtobjectRRR-R1R6R?(((s?/usr/lib/python2.7/site-packages/ansible/module_utils/memset.pyt<module>s
3		

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