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

�
�Udac@`s�ddlmZmZmZeZddlmZddlm	Z	e
de
ddde�de
ddded	e��Zd
Z
dddddd
�Zd�Zd�Zdd�Zd�ZdS(i(tabsolute_importtdivisiontprint_function(t	fetch_url(t	urlencodethetzner_userttypetstrtrequiredthetzner_passwordtno_logshttps://robot-ws.your-server.detGETi
cC`sy|jd|jd<|jd|jd<t||d|d|d|d|�\}}y|j�}	Wn#tk
r�|jd	d�}	nX|	s�|jd
dj|��ny�|j|	j	d��}
d
|
kr=|r|
d
d|kr|
|
d
dfSn|jd
dj|
d
d|
d
d|
d
d��n|
dfSWn*t
k
rt|jd
dj|��nXdS(s;
    Make general request to Hetzner's JSON robot API.
    Rturl_usernameR	turl_passwordtmethodttimeouttdatatheaderstbodytmsgs Cannot retrieve content from {0}tutf8terrortcodesRequest failed: {0} {1} ({2})tstatustmessages(Cannot decode content retrieved from {0}N(tparamsRtreadtAttributeErrortpoptNonet	fail_jsontformatt	from_jsontdecodet
ValueError(tmoduleturlRRRRt
accept_errorstresptinfotcontenttresult((s@/usr/lib/python2.7/site-packages/ansible/module_utils/hetzner.pytfetch_url_jsons,-

cC`sWdjt|�}t||�\}}d|krO|jddj|��n|dS(s�
    Get information record of failover IP.

    See https://robot.your-server.de/doc/webservice/en.html#get-failover-failover-ip
    s{0}/failover/{1}tfailoverRsCannot interpret result: {0}(RtBASE_URLR*R(R#tipR$R)R((s@/usr/lib/python2.7/site-packages/ansible/module_utils/hetzner.pytget_failover_record?s
cC`st||�dS(s�
    Get current routing target of failover IP.

    The value ``None`` represents unrouted.

    See https://robot.your-server.de/doc/webservice/en.html#get-failover-failover-ip
    tactive_server_ip(R.(R#R-((s@/usr/lib/python2.7/site-packages/ansible/module_utils/hetzner.pytget_failoverLsi�c	
C`s�djt|�}|dkrKt||ddd|ddg�\}}nXidd6}td	|�}t||dd
d|dt|�d|ddg�\}}|dk	r�|tfS|d
d	tfSdS(sB
    Set current routing target of failover IP.

    Return a pair ``(value, changed)``. The value ``None`` for ``value`` represents unrouted.

    See https://robot.your-server.de/doc/webservice/en.html#post-failover-failover-ip
    and https://robot.your-server.de/doc/webservice/en.html#delete-failover-failover-ip
    s{0}/failover/{1}RtDELETERR%tFAILOVER_ALREADY_ROUTEDs!application/x-www-form-urlencodedsContent-typeR/tPOSTRRR+N(RR,RR*tdictRtFalsetTrue(	R#R-tvalueRR$R)RRR((s@/usr/lib/python2.7/site-packages/ansible/module_utils/hetzner.pytset_failoverWs,	
	
cC`std|d|rdnd�S(sh
    Create result dictionary for failover IP's value.

    The value ``None`` represents unrouted.
    R7tstatetroutedtunrouted(R4(R7((s@/usr/lib/python2.7/site-packages/ansible/module_utils/hetzner.pytget_failover_state}sN(t
__future__RRRRt
__metaclass__tansible.module_utils.urlsRt+ansible.module_utils.six.moves.urllib.parseRR4R6tHETZNER_DEFAULT_ARGUMENT_SPECR,RR*R.R0R8R<(((s@/usr/lib/python2.7/site-packages/ansible/module_utils/hetzner.pyt<module>
s"	
	&

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