File: //usr/lib/python3/dist-packages/certbot/plugins/__pycache__/dns_common.cpython-38.pyc
U
�]�. � @ s� d Z ddlZddlZddlmZ ddlZddlZddlm Z ddl
mZ ddl
mZ ddl
mZ ddl
mZ dd lmZ dd
lmZ ddlmZ e�e�Zej�ej�ej�ej�G dd
� d
ej���ZG dd� de �Z!dd� Z"dd� Z#dd� Z$dS )z*Common code for DNS Authenticator Plugins.� N)�sleep)�
challenges)�errors)�
interfaces)�
filesystem)�os)�ops)�util)�commonc s� e Zd ZdZ� fdd�Zed dd��Zdd� Zd d
� Zdd� Z d
d� Z
ejdd� �Z
ejdd� �Zejdd� �Zdd� Zd!dd�Zd"dd�Zedd� �Zed#dd��Z� ZS )$�DNSAuthenticatorz"Base class for DNS Authenticatorsc s t t| ��||� d| _d S )NF)�superr �__init__�_attempt_cleanup)�self�config�name�� __class__� �</usr/lib/python3/dist-packages/certbot/plugins/dns_common.pyr
s zDNSAuthenticator.__init__�
c C s |d|t dd� d S )N�propagation-secondszjThe number of seconds to wait for DNS to propagate before asking the ACME server to verify the DNS record.)�default�type�help)�int)�cls�addZdefault_propagation_secondsr r r �add_parser_arguments! s
�z%DNSAuthenticator.add_parser_argumentsc C s t jgS �N)r ZDNS01)r Z
unused_domainr r r �get_chall_pref) s zDNSAuthenticator.get_chall_prefc C s d S r r �r r r r �prepare, s zDNSAuthenticator.preparec C s| | � � d| _g }|D ]@}|j}|�|�}|�|j�}| �|||� |�|�|j�� qt �
d| �d�� t| �d�� |S )NTz/Waiting %d seconds for DNS changes to propagater )
�_setup_credentialsr �domain�validation_domain_name�
validation�account_key�_perform�append�response�logger�info�confr )r �achallsZ responses�achallr$ r% r&