ok
Direktori : /opt/alt/python37/lib/python3.7/site-packages/clcommon/__pycache__/ |
Current File : //opt/alt/python37/lib/python3.7/site-packages/clcommon/__pycache__/clquota.cpython-37.pyc |
B E!wd| � @ 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