/
proc
/
self
/
root
/
proc
/
self
/
root
/
usr
/
lib
/
python3
/
dist-packages
/
certbot_apache
/
_internal
/
__pycache__
/
Upload File
HOME
� E��c� � � � d Z ddlZddlmZ ddlmZ ddlmZ ddlmZ ddl m Z ddl mZ dd lm Z dd lmZ ej e� � Z G d� dej � � ZdS ) zH Distribution specific override class for Debian family (Ubuntu/Debian) � N)�apache_util)�configurator)� OsOptions)�VirtualHost)�errors)�util)� filesystem)�osc �t � � e Zd ZdZ edddd�� � Zdeddf� fd �Zddede ddfd �Z dede ddfd�Z� xZS )�DebianConfiguratorz1Debian specific ApacheConfigurator override class�a2enmod�a2dismodT)�enmod�dismod�handle_modules�handle_sites�vhost�returnNc � �� |j rdS | j j �dt j � |j � � ��}t j � t j � |� � � � s!t � � � |� � S | j � d|� � t j |j |� � n�# t $ r�}t j � |� � r*t! j |� � |j k r d|_ Y d}~dS t$ � d||j |j � � d}t+ j |� |j |� � � � �d}~ww xY wd|_ t$ � d|j � � | xj d|j z z c_ dS ) a� Enables an available site, Apache reload required. .. note:: Does not make sure that the site correctly works or that all modules are enabled appropriately. :param vhost: vhost to enable :type vhost: :class:`~certbot_apache._internal.obj.VirtualHost` :raises .errors.NotSupportedError: If filesystem layout is not supported. Nz/sites-enabled/FTz)Could not symlink %s to %s, got error: %szmEncountered error while trying to enable a newly created VirtualHost located at {0} by linking to it from {1}zEnabling available site: %szEnabled site %s )�enabled�parser�rootr �path�basename�filep�isdir�dirname�super�enable_site�reverter�register_file_creation�symlink�OSError�islinkr �realpath�logger�error�strerrorr �NotSupportedError�format�info� save_notes)�selfr �enabled_path�err� errstring� __class__s ��J/usr/lib/python3/dist-packages/certbot_apache/_internal/override_debian.pyr zDebianConfigurator.enable_site s� �� � �=� ��4� ��)�)�)���)�)�%�+�6�6�6�8�� �w�}�}�R�W�_�_�\�:�:�;�;� .� �7�7�&�&�u�-�-�-�� �,�,�U�L�A�A�A� K��J�u�{�L�1�1�1�1��� K� K� K��w�~�~�l�+�+� � �0C��1� 1� %��1,� 1,� !%�� ��t�t�t�t�t��L�L�;�\���S�\� +� +� +�2�I� �*�9�+;�+;�E�K�<H�,J� ,J� K� K� K����� K���� �� ����1�5�;�?�?�?����.���<�<����ts �7C � F �AE;�%AE;�;F F�mod_name�tempc � � t j � | j j d� � }t j � | j j d� � }t j � |� � rt j � |� � st j d|z � � �t j |� � }|D ]�}|dz | j j vrq| � ||� � | j � |� � d|�d|��}|s| xj |t j z z c_ t � |� � ��| � ||� � | j � |� � |s| xj d|z z c_ t � d|� � | j � � � d S ) a� Enables module in Apache. Both enables and reloads Apache so module is active. :param str mod_name: Name of the module to enable. (e.g. 'ssl') :param bool temp: Whether or not this is a temporary action. :raises .errors.NotSupportedError: If the filesystem layout is not supported. :raises .errors.MisconfigurationError: If a2enmod or a2dismod cannot be run. zmods-availablezmods-enabledzIUnsupported directory layout. You may try to enable mod %s and try again.�_modulezEnabled dependency of z module - zEnabled %s module in Apache zEnabled Apache %s moduleN)r r �joinr r r r r) r �get_mod_deps�modules�_enable_mod_debian�add_modr, �linesepr&