관리-도구
편집 파일: lve_control_hook.cpython-311.pyc
� �EBg� � �J � d dl Z d dlZd dlmZ d dlmZ G d� de� � ZdS )� N)�ModifyUserHook)�lve_supported_or_exitc �X � e Zd ZdZdZed� � � Zed� � � Zed� � � Z dS )�LveLifecycleHookzM Apply limits on user creation and remove limits on user destroy z/usr/sbin/lvectlc �T � t j | j |t |� � g� � S )z� This function doesn't return! Should be last call in code :param cmd: apply|destroy :param uid: lve id )� subprocess�call�LVECTL�str)�cls�cmd�uids �&py/lve_utils/hooks/lve_control_hook.py�exec_lvectl_cmdz LveLifecycleHook.exec_lvectl_cmd s# � � ��� �C��S���:�;�;�;� c �d � t j |� � j }| � d|� � d S )N�apply��pwd�getpwnam�pw_uidr )�self�username�owner�kwargsr s r �post_create_userz!LveLifecycleHook.post_create_user s0 � ��l�8�$�$�+�����W�c�*�*�*�*�*r c � � t j |� � j }| � d|� � | � d|� � d S )N�delete�destroyr )r r r r s r �pre_delete_userz LveLifecycleHook.pre_delete_user% sF � ��l�8�$�$�+�����X�s�+�+�+����Y��,�,�,�,�,r N) �__name__� __module__�__qualname__�__doc__r �classmethodr r r r � r r r r sv � � � � � �� � �F��<� <� �[�<� �+� +� ��+� �-� -� ��-� -� -r r )r r �clcommon.public_hooks.libr �clcommon.lib.cleditionr r r&