|
Server : Apache System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64 User : njnconst ( 1116) PHP Version : 8.4.18 Disable Function : NONE Directory : /opt/alt/python37/lib/python3.7/site-packages/clcommon/__pycache__/ |
Upload File : |
B
(
c| � @ sx d dl mZ d dl mZ d dl mZ d dlZd dlZd dlmZ d dlm Z m
Z
mZ e�d�Z
deee d �d
d�ZdS )
� )�absolute_import)�division)�print_functionN)�Optional)�get_mount_point�run_command�ExternalProgramFailedzuser quota on .+ \(.+\) is on�/home)�path�returnc
C s� t j�d�sdS yt| �}W n, ttfk
rH } z
d|� �S d}~X Y nX ydd|g}t|�}W n* tk
r� } zt|�}W dd}~X Y nX |�� }t �
|�s�|S dS )z�
Check if quotas enabled and initialised for specific path
:return: string message with giagnostick information if disabled; None if enabled
z
/sbin/quotaonzPackage "quota" not installedz$Error during mount point detection:
Nz-up)�osr
�isfiler �OSErrorr r �str�strip�USER_QUOTA_ON_PATTERN�search)r
Zmount_point�eZquotaon_cmdZquotaon_output� r �A/opt/alt/python37/lib/python3.7/site-packages/clcommon/clquota.py�check_quota_enabled s
r )r )Z
__future__r r r �rer �typingr Zclcommon.utilsr r r �compiler r r r r r r �<module> s