Spade
Mini Shell
| Directory:~$ /proc/self/root/lib/python2.7/site-packages/certbot/plugins/ |
| [Home] [System Details] [Kill Me] |
�
���_c@s�dZddlZddlmZddlmZddlmZddlmZddlmZddl m
Z
dd lmZydd
l
mZWnek
r�dZnXeje�Zdefd��YZd
�ZdS(s;Common code for
DNS Authenticator Plugins built on
Lexicon.i����N(t HTTPError(tRequestException(tAny(tDict(tUnion(terrors(t
dns_common(tConfigResolvert
LexiconClientcBsDeZdZd�Zd�Zd�Zd�Zd�Zd�ZRS(sI
Encapsulates all communication with a DNS provider via Lexicon.
cCs
d|_dS(N(tNonetprovider(tself((sF/usr/lib/python2.7/site-packages/certbot/plugins/dns_common_lexicon.pyt__init__scCsx|j|�y#|jjddd|d|�WnAtk
rs}tjd|dt�tjdj |���nXdS( s�
Add a TXT record using the supplied information.
:param str domain: The domain to use to look up the managed zone.
:param str record_name: The record name (typically beginning with
'_acme-challenge.').
:param str record_content: The record content (typically the
challenge validation).
:raises errors.PluginError: if an error occurs communicating with
the DNS Provider API
ttypetTXTtnametcontents'Encountered error adding TXT
record: %stexc_infosError adding TXT record: {0}N(
t_find_domain_idR
t
create_recordRtloggertdebugtTrueRtPluginErrortformat(Rtdomaintrecord_nametrecord_contentte((sF/usr/lib/python2.7/site-packages/certbot/plugins/dns_common_lexicon.pytadd_txt_record"s
#cCs�y|j|�Wn-tjk
r@}tjd|dt�dSXy#|jjddd|d|�Wn)tk
r�}tjd|dt�nXdS( s�
Delete a TXT record using the supplied information.
:param str domain: The domain to use to look up the managed zone.
:param str record_name: The record name (typically beginning with
'_acme-challenge.').
:param str record_content: The record content (typically the
challenge validation).
:raises errors.PluginError: if an error occurs communicating with
the DNS Provider API
s7Encountered error finding domain_id during deletion:
%sRNR
RRRs)Encountered error deleting TXT record: %s( RRRRRRR
t
delete_recordR(RRRRR((sF/usr/lib/python2.7/site-packages/certbot/plugins/dns_common_lexicon.pytdel_txt_record3s #cCs�tj|�}x�|D]�}yFt|jd�rD||jjd<n||j_|jj�dSWqtk
r�}|j||�}|r�|�q�qt k
r�}|j
||�}|r�|�q�qXqWtjdj
||���dS(s�
Find the domain_id for a given domain.
:param str domain: The domain for which to find the domain_id.
:raises errors.PluginError: if the domain_id cannot be found.
toptionsRNsAUnable to determine zone identifier for {0} using
zone names: {1}(Rtbase_domain_name_guessesthasattrR
R
RtauthenticateRt_handle_http_errort Exceptiont_handle_general_errorRRR(RRtdomain_name_guessestdomain_nameRtresult((sF/usr/lib/python2.7/site-packages/certbot/plugins/dns_common_lexicon.pyRHs$
cCstjdj||��S(Ns/Error
determining zone identifier for {0}:
{1}.(RRR(RRR(((sF/usr/lib/python2.7/site-packages/certbot/plugins/dns_common_lexicon.pyR$lscCs2t|�jd�s.tjdj||��SdS(NsNo
domain founds9Unexpected error determining zone identifier for {0}:
{1}(tstrt
startswithRRRR (RRR(((sF/usr/lib/python2.7/site-packages/certbot/plugins/dns_common_lexicon.pyR&ps
( t__name__t
__module__t__doc__RRRRR$R&(((sF/usr/lib/python2.7/site-packages/certbot/plugins/dns_common_lexicon.pyRs $ cCsii|d6}|j|�ts0|j|�n5i}|j|�|||<t�j|�j�}|S(so
Convenient function to build a Lexicon 2.x/3.x config object.
:param str lexicon_provider_name: the name of the lexicon provider to
use
:param dict lexicon_options: options specific to lexicon
:param dict provider_options: options specific to provider
:return: configuration to apply to the provider
:rtype: ConfigurationResolver or dict
t
provider_name(tupdateRt with_dicttwith_env(tlexicon_provider_nametlexicon_optionstprovider_optionstconfigtprovider_config((sF/usr/lib/python2.7/site-packages/certbot/plugins/dns_common_lexicon.pytbuild_lexicon_configws
(R.tloggingtrequests.exceptionsRRtacme.magic_typingRRRtcertbotRtcertbot.pluginsRtlexicon.configRtImportErrorR t getLoggerR,RtobjectRR8(((sF/usr/lib/python2.7/site-packages/certbot/plugins/dns_common_lexicon.pyt<module>s
]