/
proc
/
self
/
root
/
lib
/
python3
/
dist-packages
/
certbot_apache
/
_internal
/
__pycache__
/
Upload File
HOME
� E��c� � �F � d Z ddlZddlZddlZddlZddlZddlmZ ddlmZ ddlm Z ddlm Z ddlmZ ddlZddl mZ dd l mZ dd lmZ ej e� � Zdede e fd �Zdede e fd�Zdedefd�Zdedeeef fd�Zdededeeef fd�Zdefd�Zdedee defd�Zde e deeef fd�Zde e de e fd�Zde e de e fd�Z de e dede e fd �Z!de e defd!�Z"d"edefd#�Z#dS )$z- Utility functions for certbot-apache plugin � N)�Dict)�Iterable)�List)�Optional)�Tuple)�errors)�util)�os�mod_name�returnc �: � dddgi}|� | g � � S )a Get known module dependencies. .. note:: This does not need to be accurate in order for the client to run. This simply keeps things clean if the user decides to revert changes. .. warning:: If all deps are not included, it may cause incorrect parsing behavior, due to enable_mod's shortcut for updating the parser's currently defined modules (`.ApacheParser.add_mod`) This would only present a major problem in extremely atypical configs that use ifmod for the missing deps. �ssl�setenvif�mime)�get)r �depss �F/usr/lib/python3/dist-packages/certbot_apache/_internal/apache_util.py�get_mod_depsr s+ � � � �F�#��D� �8�8�H�b�!�!�!� � vhost_pathc �^ � | r| � d� � sdS t | � � d S )z�Get file path from augeas_vhost_path. Takes in Augeas path and returns the file name :param str vhost_path: Augeas virtual host path :returns: filename of vhost :rtype: str z/files/Nr )� startswith�_split_aug_path�r s r � get_file_pathr ) s9 � � � �Z�2�2�9�=�=� ��t��:�&�&�q�)�)r c �, � t | � � d S )z�Get the Augeas path for a vhost with the file path removed. :param str vhost_path: Augeas virtual host path :returns: Augeas path to vhost relative to the containing file :rtype: str � )r r s r �get_internal_aug_pathr : s � � �:�&�&�q�)�)r c �: � | dd� }g }t j � |� � sM|� d� � \ }}}|� |� � t j � |� � �M|d� t |� � � � fS )a: Splits an Augeas path into a file path and an internal path. After removing "/files", this function splits vhost_path into the file path and the remaining Augeas path. :param str vhost_path: Augeas virtual host path :returns: file path and internal Augeas path :rtype: `tuple` of `str` � N�/)r �path�exists� rpartition�append�join�reversed)r � file_path� internal_path�_�internal_path_parts r r r F s� � � �1�2�2��I�!�M� �g�n�n�Y�'�'� 1�+4�+?�+?��+D�+D�(� �1�(����/�0�0�0� �g�n�n�Y�'�'� 1� �c�h�h�x� �6�6�7�7�7�7r �filepath�varnamec �� � i }t j || � � � � � }t |� � D ]�\ }}|dk rFt |� � |dz k r0||dz � d� � }|d ||d <