
    M/e                     ,   d Z ddlZddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z
 ddlmZ dd	lmZ  ej                  e      Zd
ej$                  dej&                  de
j(                  ddfdZd
ej$                  dej&                  dej,                  ddfdZdej&                  dej,                  d
ej$                  ddfdZdej&                  dej,                  d
ej$                  ddfdZdej&                  dej,                  d
ej$                  ddfdZy)zUpdaters run at renewal    N)configuration)errors)
interfaces)storage)disco)	selection)enhancementsconfiglineagepluginsreturnc                    | j                   rt        j                  d       y	 t        j                  | |      }|rt        |||        t        |||        yy# t
        j                  $ r }t        j                  d|       Y d}~yd}~ww xY w)as  Run updaters that the plugin supports

    :param config: Configuration object
    :type config: certbot.configuration.NamespaceConfig

    :param lineage: Certificate lineage object
    :type lineage: storage.RenewableCert

    :param plugins: List of plugins
    :type plugins: certbot._internal.plugins.disco.PluginsRegistry

    :returns: `None`
    :rtype: None
    z"Skipping updaters in dry-run mode.Nz4Could not choose appropriate plugin for updaters: %s)
dry_runloggerdebugplug_selget_unprepared_installerr   Errorerror_run_updaters_run_enhancement_updaters)r
   r   r   	installeres        ;/usr/lib/python3/dist-packages/certbot/_internal/updater.pyrun_generic_updatersr      s|      ~~9:55fgF	 gy&1!'9f=  << KQOs   A B+BBr   c                     | j                   rt        j                  d       y| j                  s+t	        |t
        j                        r|j                  |       t        |||        y)a  Helper function to run deployer interface method if supported by the used
    installer plugin.

    :param config: Configuration object
    :type config: certbot.configuration.NamespaceConfig

    :param lineage: Certificate lineage object
    :type lineage: storage.RenewableCert

    :param installer: Installer object
    :type installer: interfaces.Installer

    :returns: `None`
    :rtype: None
    z*Skipping renewal deployer in dry-run mode.N)	r   r   r   disable_renew_updates
isinstancer   RenewDeployerrenew_deploy_run_enhancement_deployers)r
   r   r   s      r   run_renewal_deployerr"   ,   sQ    " ~~AB''Jy7A7O7O-Qw'w	6:    c                 v    |j                   s-t        |t        j                        r|j	                  |        yyy)a:  Helper function to run the updater interface methods if supported by the
    used installer plugin.

    :param lineage: Certificate lineage object
    :type lineage: storage.RenewableCert

    :param installer: Installer object
    :type installer: interfaces.Installer

    :returns: `None`
    :rtype: None
    N)r   r   r   GenericUpdatergeneric_updates)r   r   r
   s      r   r   r   G   s5     ''i!:!:;%%g. < (r#   c                     |j                   ryt        j                  D ]-  }t        ||d         s|d   s t	        ||d         |        / y)a  Iterates through known enhancement interfaces. If the installer implements
    an enhancement interface and the enhance interface has an updater method, the
    updater method gets run.

    :param lineage: Certificate lineage object
    :type lineage: storage.RenewableCert

    :param installer: Installer object
    :type installer: interfaces.Installer

    :param config: Configuration object
    :type config: certbot.configuration.NamespaceConfig
    Nclassupdater_functionr   r	   _INDEXr   getattrr   r   r
   enhs       r   r   r   Z   sT      ##"" AiW.37I3J7GIs#567@Ar#   c                     |j                   ryt        j                  D ]-  }t        ||d         s|d   s t	        ||d         |        / y)a  Iterates through known enhancement interfaces. If the installer implements
    an enhancement interface and the enhance interface has an deployer method, the
    deployer method gets run.

    :param lineage: Certificate lineage object
    :type lineage: storage.RenewableCert

    :param installer: Installer object
    :type installer: interfaces.Installer

    :param config: Configuration object
    :type config: certbot.configuration.NamespaceConfig
    Nr(   deployer_functionr*   r-   s       r   r!   r!   q   sT      ##"" BiW.37J3K8GIs#678ABr#   )__doc__loggingcertbotr   r   r   certbot._internalr   certbot._internal.pluginsr   plugin_discor   r   certbot.pluginsr	   	getLogger__name__r   NamespaceConfigRenewableCertPluginsRegistryr   	Installerr"   r   r   r!    r#   r   <module>r?      sE     !   % ; ; (			8	$>!>!> >I^I^ >".">">>CG>:;!>!> ;I^I^ ;$.$8$8;=A;6/700 /Z=Q=Q /'77/<@/&Aw'<'< AI]I] A&3&C&CAHLA.B(=(= B*J^J^ B'4'D'DBIMBr#   