Your IP : 18.220.98.157


Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/cllimits/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/cllimits/__pycache__/domain_lib.cpython-311.pyc

�

_{�g$��`�ddlmZddlmZddlmZGd�de��ZGd�d��ZdS)	�)�cpapi)�FormattedException)�NotSupportedc��eZdZdS)�DomainExceptionN)�__name__�
__module__�__qualname__���py/cllimits/domain_lib.pyrrs�������Drrc� �eZdZd�Zd�Zd�ZdS)�Domainc��d|_dS)N)�_userdomain_cache)�selfs r
�__init__zDomain.__init__s��!%����rc���|j�@	ttjd�����|_n#t$r
i|_YnwxYw|j�|d��S)z~
        Retrive main domain for supplied user
        :param username: User name
        :return: Domain name or N/A
        N)�cplogin�dns)�keylszN/A)r�dictr�cpinfor�get)r�usernames  r
�get_user_domainzDomain.get_user_domainsu���!�)�
,�)-�e�l�AS�.T�.T�.T�)U�)U��&�&���
,�
,�
,�)+��&�&�&�
,�����%�)�)�(�E�:�:�:s�'1�A�Ac���	tj|��}|r|Sn@#ttjjf$r"}tt
|����|�d}~wwxYwtdd|id����)zn
        Retrive username by domain
        :param domain_name: Domain name
        :return: Username
        NzThere is no domain '%(domain)s'�domain)�message�context)r�domain_owner�IOError�cpapiexceptionsrr�str)r�domain_namer�es    r
�get_user_name_by_domainzDomain.get_user_name_by_domain$s���	1��)�+�6�6�H��
 ���
 ����.�;�<�	1�	1�	1�!�#�a�&�&�)�)�q�0�����	1�����*K�+3�[�*A�C�C�D�D�	Ds��A�A�AN)rr	r
rrr'rrr
rrsF������&�&�&�;�;�;�
D�
D�
D�
D�
DrrN)�clcommonr�clcommon.clexceptionr�clcommon.cpapirrrrrr
�<module>r+s���������3�3�3�3�3�3�'�'�'�'�'�'�	�	�	�	�	�(�	�	�	�D�D�D�D�D�D�D�D�D�Dr

?>