PHP WebShell

Текущая директория: /usr/lib/python3/dist-packages/cloudinit/sources/helpers/vmware/imc/__pycache__

Просмотр файла: config_file.cpython-310.pyc

o

x[h��@s<ddlZddlZddlmZe�e�ZGdd�dee�ZdS)�N)�ConfigSourcec@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�
ConfigFilez>ConfigFile module to load the content from a specified source.cCs|�|�dS)N)�_loadConfigFile)�self�filename�r�R/usr/lib/python3/dist-packages/cloudinit/sources/helpers/vmware/imc/config_file.py�__init__szConfigFile.__init__cCsX|��}|��}|�d�sd|vrd}nd}|r t�d||�nt�d|�|||<dS)z�
        Inserts a Key Value pair.

        Keyword arguments:
        key -- The key to insert
        val -- The value to insert for the key

        �-z|-FTzADDED KEY-VAL :: '%s' = '%s'z+ADDED KEY-VAL :: '%s' = '*****************'N)�strip�
startswith�logger�debug)r�key�val�canLogrrr�
_insertKeys	zConfigFile._insertKeycCsrt�d|�t��}t|_|�|�|��|��D]}t�	d|�|�
|�D]\}}|�|d||�q'qdS)a%
        Parses properties from the specified config file.

        Any previously available properties will be removed.
        Sensitive data will not be logged in case the key starts
        from '-'.

        Keyword arguments:
        filename - The full path to the config file.
        zParsing the config file %s.zFOUND CATEGORY = '%s'�|N)r
�info�configparser�ConfigParser�str�optionxform�read�clear�sectionsr�itemsr)rr�config�categoryr�valuerrrr/s
��zConfigFile._loadConfigFilecst�fdd�|D��S)z�
        Return the total count of keys that start with the specified prefix.

        Keyword arguments:
        prefix -- prefix of the key
        csg|]	}|���r|�qSr)r)�.0r��prefixrr�
<listcomp>Osz4ConfigFile.get_count_with_prefix.<locals>.<listcomp>)�len)rr"rr!r�get_count_with_prefixHsz ConfigFile.get_count_with_prefixN)�__name__�
__module__�__qualname__�__doc__r	rrr%rrrrrsr)	r�logging�2cloudinit.sources.helpers.vmware.imc.config_sourcer�	getLoggerr&r
�dictrrrrr�<module>s



Выполнить команду


Для локальной разработки. Не используйте в интернете!