ó
Á£ô_c           @   s”   d  Z  d d l Z d d l m Z d d l m Z d d l m Z d d l j	 j
 Z
 e j e ƒ Z d „  Z d „  Z d „  Z d	 „  Z d
 „  Z d S(   s   Updaters run at renewaliÿÿÿÿN(   t   errors(   t
   interfaces(   t	   selectionc         C   s‡   |  j  r t j d ƒ d Sy t j |  | ƒ } Wn' t j k
 rY } t j d | ƒ d SX| rƒ t | | |  ƒ t	 | | |  ƒ n  d S(   s@  Run updaters that the plugin supports

    :param config: Configuration object
    :type config: interfaces.IConfig

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

    :param plugins: List of plugins
    :type plugins: `list` of `str`

    :returns: `None`
    :rtype: None
    s"   Skipping updaters in dry-run mode.Ns4   Could not choose appropriate plugin for updaters: %s(
   t   dry_runt   loggert   debugt   plug_selt   get_unprepared_installerR    t   Errort   warningt   _run_updaterst   _run_enhancement_updaters(   t   configt   lineaget   pluginst	   installert   e(    (    s=   /usr/lib/python2.7/site-packages/certbot/_internal/updater.pyt   run_generic_updaters   s    	c         C   sZ   |  j  r t j d ƒ d S|  j rF t | t j ƒ rF | j | ƒ n  t | | |  ƒ d S(   s…  Helper function to run deployer interface method if supported by the used
    installer plugin.

    :param config: Configuration object
    :type config: interfaces.IConfig

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

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

    :returns: `None`
    :rtype: None
    s*   Skipping renewal deployer in dry-run mode.N(	   R   R   R   t   disable_renew_updatest
   isinstanceR   t   RenewDeployert   renew_deployt   _run_enhancement_deployers(   R   R   R   (    (    s=   /usr/lib/python2.7/site-packages/certbot/_internal/updater.pyt   run_renewal_deployer&   s    	c         C   s2   | j  s. t | t j ƒ r. | j |  ƒ q. n  d S(   s;  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.IInstaller

    :returns: `None`
    :rtype: None
    N(   R   R   R   t   GenericUpdatert   generic_updates(   R   R   R   (    (    s=   /usr/lib/python2.7/site-packages/certbot/_internal/updater.pyR
   ?   s    	c         C   s\   | j  r d SxH t j D]= } t | | d ƒ r | d r t | | d ƒ |  ƒ q q Wd S(   s¸  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.IInstaller

    :param config: Configuration object
    :type config: interfaces.IConfig
    Nt   classt   updater_function(   R   t   enhancementst   _INDEXR   t   getattr(   R   R   R   t   enh(    (    s=   /usr/lib/python2.7/site-packages/certbot/_internal/updater.pyR   P   s
    	c         C   s\   | j  r d SxH t j D]= } t | | d ƒ r | d r t | | d ƒ |  ƒ q q Wd S(   sº  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.IInstaller

    :param config: Configuration object
    :type config: interfaces.IConfig
    NR   t   deployer_function(   R   R   R   R   R   (   R   R   R   R   (    (    s=   /usr/lib/python2.7/site-packages/certbot/_internal/updater.pyR   f   s
    	(   t   __doc__t   loggingt   certbotR    R   t   certbot._internal.pluginsR   R   t   certbot.plugins.enhancementsR   R   t	   getLoggert   __name__R   R   R   R
   R   R   (    (    (    s=   /usr/lib/python2.7/site-packages/certbot/_internal/updater.pyt   <module>   s   				