ok
Direktori : /opt/cloudlinux/venv/lib/python3.11/site-packages/ssa/internal/__pycache__/ |
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/ssa/internal/__pycache__/utils.cpython-311.pyc |
� ��f$= � � � d Z ddlZddlZddlZddlZddlZddlZddlmc m Z ddlmZ ddl mZ ddlmZmZ ddlmZ ddlmZmZmZmZmZmZmZ ddlmZmZ dd lmZ ddlZdd l m!Z! ddl"m#Z# ddl$m%Z% dd l&m'Z'm(Z(m)Z)m*Z* ddl+m,Z, ddl-m.Z. ddl+m/Z/ ddl0m1Z1 ddl2m3Z3 ej4 d� � Z5 edddg� � Z6de7de6fd�Z8dee7 fd�Z9dee7 fd�Z:dCd�Z;dDde7d e<de7fd!�Z=d"e7de7fd#�Z>d$e7dd%fd&�Z?de7fd'�Z@dEd)e7de7fd*�ZAde7fd+�ZBd,eCdeDfd-�ZEd.e7dee7 fd/�ZFde<fd0�ZGde<fd1�ZHde<fd2�ZId3e<ddfd4�ZJde<fd5�ZKde7fd6�ZLd7e7d8ee7ef de<fd9�ZMd:� ZNedFd;eCddfd<�� � ZOe dGd?eCd@eCd;eCddfdA�� � ZPd>ZQdB� ZRdS )Hz> This module contains helpful utility functions for SSA Agent � N)� namedtuple)�contextmanager)�date� timedelta)�LooseVersion)�socket�fromfd�AF_UNIX�SOCK_STREAM�AF_INET�AF_INET6� SOCK_DGRAM)�Optional�Union)�urlparse)�AtexitIntegration)�LoggingIntegration)�Feature)�is_panel_feature_supported�get_cp_description�is_throttling_supported�is_wp2_environment)�get_kmodlve_module_version)�get_cl_edition_readable)�get_rhn_systemid_value� )� sentry_dsn)�SSAError�utils�URL�domain_name�uri_path�url�returnc � � t | � � }|j r d|j � �nd}|j r|j � |� �nd}t |j � dd� � |� � S )z� Split URL into domain_name and uripath including query string :param url: URL of format protocol://domain/path;parameters?query#fragment :return: namedtuple URL(domain_name, uripath) �?� �/zwww.)r �query�pathr �netloc�replace)r# � fragments�qs�uris �I/opt/cloudlinux/venv/lib64/python3.11/site-packages/ssa/internal/utils.py� url_splitr1 3 sl � � �� � �I�"+�/� 9� �Y�_� � � �r�B�%.�^� <�Y�^� !�R� !� !� !��C��y��'�'���3�3�S�9�9�9� c � � t d� � S )z"Get version of alt-php-ssa packagez/usr/share/clos_ssa/version��pkg_version� r2 r0 �ssa_versionr7 ? s � ��4�5�5�5r2 c � � t d� � S )z#Get version of alt-php-xray packagez/usr/share/alt-php-xray/versionr4 r6 r2 r0 �xray_versionr9 C s � ��8�9�9�9r2 c �� �� dt dt dt fd�} d� ��fd�}d� }dd �}t � � pd }t t j t j �� � }t |�� � }t j t | |d ||g�� � t j � � 5 }d |� � i|_ ||� � n# t $ r Y nw xY wddd� � dS # 1 swxY w Y dS )u� Initialize Sentry client shutdown_timeout=0 disables Atexit integration as stated in docs: 'it’s easier to disable it by setting the shutdown_timeout to 0' https://docs.sentry.io/platforms/python/default-integrations/#atexit On the other hand, docs say, that 'Setting this value too low will most likely cause problems for sending events from command line applications' https://docs.sentry.io/error-reporting/configuration/?platform=python#shutdown-timeout �event�hintr$ c �@ � | d � ddi� � | S )z� Add extra data into sentry event :param event: original event :param hint: additional data caught :return: updated event �extrazssa.versionz 0.4-10.el8)�update)r; r<