Current Dir: /snap/core22/2955/usr/lib/python3/dist-packages/cloudinit/sources/helpers/vmware/imc/__pycache__/

[FILE] boot_proto.cpython-310.pyc [ edit | delete | rename ]
[FILE] config.cpython-310.pyc [ edit | delete | rename ]
[FILE] config_custom_script.cpython-310.pyc [ edit | delete | rename ]
[FILE] config_file.cpython-310.pyc [ edit | delete | rename ]
[FILE] config_nic.cpython-310.pyc [ edit | delete | rename ]
[FILE] config_passwd.cpython-310.pyc [ edit | delete | rename ]
[FILE] config_source.cpython-310.pyc [ edit | delete | rename ]
[FILE] guestcust_error.cpython-310.pyc [ edit | delete | rename ]
[FILE] guestcust_event.cpython-310.pyc [ edit | delete | rename ]
[FILE] guestcust_state.cpython-310.pyc [ edit | delete | rename ]
[FILE] guestcust_util.cpython-310.pyc [ edit | delete | rename ]
[FILE] nic.cpython-310.pyc [ edit | delete | rename ]
[FILE] nic_base.cpython-310.pyc [ edit | delete | rename ]
[FILE] __init__.cpython-310.pyc [ edit | delete | rename ]

Viewing: /snap/core22/2955/usr/lib/python3/dist-packages/cloudinit/sources/helpers/vmware/imc/__pycache__/config_file.cpython-310.pyc

o

��i��@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


Upload File: