HEX
Server: Apache
System: Linux a16-asgard6.hospedagemuolhost.com.br 5.14.0-570.52.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 15 06:39:08 EDT 2025 x86_64
User: maoristu4c3dbd03 (1436)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/lib64/python3.9/site-packages/rhsmlib/dbus/__pycache__/util.cpython-39.opt-1.pyc
a

X�Zh��@s�ddlZddlZddlZddlZddlZddlZddlmZddl	m
Z
e�e�Z
gd�Zejdd��Zejdd��Zd	d
�Zdd�ZdS)
�N)�
exceptions)�
DBusSender)�dbus_handle_exceptions�dbus_handle_sender�dbus_service_method�dbus_service_signalc	Os�d}d|vr|d}nt|�dkr*|d}t��f}|durD|�|�z0||i|��W|durd|��Wd�Sn|dur�|��0Wd�n1s�0YdS)z�
    Decorator to handle sender argument
    :param func: method with implementation of own logic of D-Bus method
    :param args: arguments of D-Bus method
    :param kwargs: keyed arguments of D-Bus method
    :return: result of D-Bus method
    N�senderr���)�lenrZset_cmd_lineZreset_cmd_line)�func�args�kwargsrZdbus_sender�r�7/usr/lib64/python3.9/site-packages/rhsmlib/dbus/util.pyr"s"


��rc	
Os�z||i|��WSty�}z�t�|�t��d}d}d}t�|dt|��}d|vr\d}t|d�rl|j	}t
�t|�j
||d��}t�|��|��WYd	}~n
d	}~00d	S)
zO
    Decorator to handle exceptions, log them, and wrap them if necessary.
    ��errorz^HTTP error (.*): �z7Ignoring request to auto-attach. It is disabled for orgZwarning�severity)�	exceptionr�messageN)�	Exception�logr�sys�exc_info�re�sub�str�hasattrr�json�dumps�type�__name__rZRHSM1DBusException�with_traceback)	rrr
�errZtracer�pattern�err_msgZ	error_msgrrrr?s&

��rcOs|�dd�tjj|i|��S)NZsender_keywordr)�
setdefault�dbus�service�method�rr
rrrr_srcOstjj|i|��S)zT
    Decorator used for signal
    :param args:
    :param kwargs:
    :return:
    )r'r(�signalr*rrrrfsr)Zloggingr�	decoratorZdbus.servicer'rrZrhsmlib.dbusrZrhsmlib.client_inforZ	getLoggerr!r�__all__rrrrrrrr�<module>s