ok

Mini Shell

Direktori : /opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/lib/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/lib/__pycache__/config.cpython-311.pyc

�

)�f�����ddlmZddlmZddlmcmcmZddlZddl	Z	ddl
mZdZdZ
dZejd��ZdZd	ZGd
�de��Zd�Zd
�Zd�Zd�Zdefd�ZdS)�)�absolute_import)�	strtoboolN)�
clconfparsz/etc/sysconfig/lvestats2z/etc/sysconfig/cloudlinuxz/etc/sysconfig/lvestats.config/�hide_lve_more_than_maxuid�lvestats_notifications_offc�"�eZdZd�Zdd�Zd�ZdS)�ConfigErrorc�"�||_||_dS�N)�value�ex)�self�locationr
s   �~/builddir/build/BUILDROOT/lve-stats-4.2.8-1.el8.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/lib/config.py�__init__zConfigError.__init__s����
������N�c�z�|�t}|�t|����t|��dSr)�log�error�str�exit)r�log_�	exit_codes   r�log_and_exitzConfigError.log_and_exit s3���<��D��
�
�3�t�9�9�����Y�����rc��|jtur d|j�dt|j���d�Sd|j�dt|j���d�S)NzUnable to read config z (�)zUnable to parse config )r
�IOErrorrr)rs r�__str__zConfigError.__str__&sS���7�g����6:�j�j�j�#�d�g�,�,�,�,�O�O��8<�z�z�z�3�t�w�<�<�<�<�P�Pr)Nr)�__name__�
__module__�__qualname__rrr�rrr	r	sK�������������Q�Q�Q�Q�Qrr	c���	tj|��S#t$ru}|jdkr,|�d��st|dz��cYd}~St�d|t|����t||���d}~wtj$r<}t�t|����t||���d}~wwxYw)N�
z	.readonlyzConfig %s not loadable: %s)r�loadr�errno�endswith�_load_config_and_process_errorsrrrr	�configparser�ParsingError)r�ie�pes   rr)r)-s���	(���x�(�(�(���(�(�(�
�8�r�>�>�(�"3�"3�K�"@�"@�>�2�8�k�3I�J�J�J�J�J�J�J�J��	�	�.��#�b�'�'�B�B�B��(�B�'�'�'������$�(�(�(��	�	�#�b�'�'�����(�B�'�'�'�����(���s,��
C�1B�C�9B�C�"7C�Cc���|���}t|zdz}tj�|��r$t|��}|�|��|S)Nz.cfg)�strip�CONFIG_PATH_DIR�os�path�isfiler)�update)�config�plugin�plugin_cfg_path�
plugin_configs    r�read_plugin_configr9:sX��
�\�\�^�^�F�%��.��7�O�	�w�~�~�o�&�&�%�7��H�H�
��
�
�m�$�$�$��Mrc�*�tt��S)zb
    reads lvestats config. Throws ConfigError exception -- if any errors
    :return: config
    )r)�GLOBAL_CONFIG_LOCATIONr#rr�read_configr<Cs��
+�+A�B�B�Brc��tjd���}|�t��	|�dd�����dkS#t$rYn$tj$rYntj$rYnwxYwdS)zE
    Check global config parameter for normalize user CPU values
    F)�strict�
license_check�normalized_user_cpu�YT)	r*�ConfigParser�read�	CL_CONFIG�get�upperr�
NoOptionError�NoSectionError)r5s r�is_normalized_user_cpurIKs����
&�e�
4�
4�
4�F�
�K�K�	����

��z�z�/�+@�A�A�G�G�I�I�S�P�P���
�
�
����%�
�
�
����&�
�
�
���
�����4s�+A�
B
�)B
�9B
�	B
�returnc��t��}tt|�dd������rdSdS)zL
    The function returns max lve id according to option `use_big_uids`
    �use_big_uids�falsei���iʚ;)r<�boolrrE)�lvestats_configs r�get_max_lve_idrP`s?��
"�m�m�O��I�o�)�)�.�'�B�B�C�C�D�D���{��wr)�
__future__r�distutils.utilr�lvestats.lib.commons.logsetup�lib�commons�logsetupr1r*�clcommonrr;rDr0�
setup_loggingr�HIDE_MAX_UID_LVE_PARAMETER�USER_NOTIFICATIONS_OFF_MARKER�	Exceptionr	r)r9r<rI�intrPr#rr�<module>r]s<��'�&�&�&�&�&�$�$�$�$�$�$�0�0�0�0�0�0�0�0�0�0�0�0�	�	�	�	�����������4��'�	�3���h��T�"�"��8�� <��Q�Q�Q�Q�Q�)�Q�Q�Q�$
(�
(�
(����C�C�C����*	��	�	�	�	�	�	r

Zerion Mini Shell 1.0