%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python37/lib/python3.7/site-packages/clcommon/__pycache__/
Upload File :
Create Path :
Current File : //opt/alt/python37/lib/python3.7/site-packages/clcommon/__pycache__/clquota.cpython-37.pyc

B

`�1bc�@snddlmZddlmZddlmZddlZddlZddlmZmZe�	d�Z
dd�Zdd
d�Zdd
d�Z
dS)�)�absolute_import)�division)�print_functionN)�run_command�ExternalProgramFailedzuser quota on .+ \(.+\) is oncCs:tj�|�d�dd�}tj�|�d�dd�}|�|�S)z�
    >>> is_subpath('/', '/home')
    True
    >>> is_subpath('/home', '/home')
    True
    >>> is_subpath('/', '/')
    True
    >>> is_subpath('/d', '/f')
    False
    �/z//)�os�path�abspath�replace�
startswith)r	Zsubpath�r
�A/opt/alt/python37/lib/python3.7/site-packages/clcommon/clquota.py�
is_subpathsr�/proc/mountscCsDt|�}d}x*|D]"}|�d�d}t||�r|}PqW|��|S)N� �)�open�splitr�close)r	Z_mounts�stream�mount_point�lineZmount_point_r
r
r�get_mount_point$s

r�/homec
Csptj�d�sdSt|�}ytdd|g�}Wn*tk
rT}zt|�}Wdd}~XYnX|��}t�	|�sl|SdS)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-upN)
rr	�isfilerrr�str�strip�USER_QUOTA_ON_PATTERN�search)r	rZquotaon_output�er
r
r�check_quota_enabled0s
r!)r)r)Z
__future__rrr�rerZclcommon.utilsrr�compilerrrr!r
r
r
r�<module>	s



Zerion Mini Shell 1.0