3
Ú¯a‹ ã @ sð d Z ddlZddlmZ ddlmZ ddlmZ ddlmZ ddlm Z
ddlmZ dd l
mZ ejeƒZejeje
jdd
œdd„Zejejejdd
œdd„Zejejejddœdd„Zejejejddœdd„Zejejejddœdd„ZdS )zUpdaters run at renewalé N)Ú
configuration)Úerrors)Ú
interfaces)Ústorage)Údisco)Ú selection)Úenhancements)ÚconfigÚlineageÚpluginsÚreturnc C st | j rtjdƒ dS ytj| |ƒ}W n. tjk
rR } ztjd|ƒ dS d}~X nX |rpt||| ƒ t ||| ƒ dS )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_selZget_unprepared_installerr ÚErrorÚerrorÚ
_run_updatersÚ_run_enhancement_updaters)r r
r Ú installerÚe© r ú/usr/lib/python3.6/updater.pyÚrun_generic_updaters s
r )r r
r r c C sB | j rtjdƒ dS | j r2t|tjƒr2|j|ƒ t||| ƒ dS )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 Z
RenewDeployerZrenew_deployÚ_run_enhancement_deployers)r r
r r r r Úrun_renewal_deployer, s
r )r
r r r c C s |j st|tjƒr|j| ƒ dS )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 ZGenericUpdaterZgeneric_updates)r
r r r r r r G s r c C sF |j r
dS x6tjD ],}t||d ƒr|d rt||d ƒ| ƒ qW dS )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ÚclassZupdater_function)r r Ú_INDEXr Úgetattr)r
r r Úenhr r r r Z s
r c C sF |j r
dS x6tjD ],}t||d ƒr|d rt||d ƒ| ƒ qW dS )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 Zdeployer_function)r r r r r )r
r r r! r r r r q s
r )Ú__doc__ZloggingZcertbotr r r Zcertbot._internalr Zcertbot._internal.pluginsr Zplugin_discor r Zcertbot.pluginsr Z getLoggerÚ__name__r ZNamespaceConfigZ
RenewableCertZPluginsRegistryr Z Installerr r r r r r r r Ú