HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //lib/python3.6/site-packages/firewall/server/__pycache__/decorators.cpython-36.pyc
3

��go�@s�dZddddgZddlZddlZddlZddlmZddlmZdd	lm	Z	dd
l
mZddlmZddl
mZGd
d�dej�Zedd��Zedd��Zdd�ZdS)z>This module contains decorators for use with and without D-Bus�FirewallDBusException�handle_exceptions�dbus_handle_exceptions�dbus_service_method�N)�
DBusException)�	decorator)�config)�
FirewallError)�errors)�logc@seZdZdZdejjZdS)rz%s.ExceptionN)�__name__�
__module__�__qualname__�__doc__r�dbusZDBUS_INTERFACEZ_dbus_error_name�rr� /usr/lib/python3.6/decorators.pyr+scOsdy
|||�Stk
rD}ztjtj��tj|�WYdd}~Xntk
r^tj�YnXdS)zTDecorator to handle exceptions and log them. Used if not conneced
    to D-Bus.
    N)r	r�debug1�	traceback�
format_exc�error�	Exception�	exception)�func�args�kwargsrrrrr/s
cOs�y
|||�Stk
r�}zdtjt|��}|tjtjtjtjgkrRtj	t|��ntj
tj��tj
t|��tt|���WYdd}~XnZtk
r�}z
|�WYdd}~Xn6tk
r�}ztj�tt|���WYdd}~XnXdS)z�Decorator to handle exceptions, log and report them into D-Bus

    :Raises DBusException: on a firewall error code problems.
    N)r	�get_code�strr
ZALREADY_ENABLEDZNOT_ENABLEDZZONE_ALREADY_SETZALREADY_SETrZwarningrrrrrrrr)rrrr�codeZexrrrr<s

cOs|jdd�tjj||�S)zAdd sender argument for D-BusZsender_keywordZsender)�
setdefaultrZservice�method)rrrrrrTs)r�__all__rZdbus.servicerZdbus.exceptionsrrZfirewallrZfirewall.errorsr	r
Zfirewall.core.loggerrrrrrrrrr�<module>s