0ׄ d dl Z d dlmZmZmZ d dlmZ d dlmZm Z d dl mZ d dlm Z mZ G d de Z G d d e Z G d de Z G d d ZdS ) N)DictOptionalTuple)FormattedException)ExternalProgramFailedrun_command)exec_utility)is_quota_activeis_quota_supportedc e Zd ZdS )ClQuotaExceptionN)__name__ __module____qualname__ py/cllimits/clquota_lib.pyr r s Dr r c $ e Zd ZdZd fd Z xZS )UnexpectedClQuotaErrorzU Raised when we get output from cl-quota that cannot be parsed properly. Nc Z dd|dd}t | d S )NzUnexpected response got from %(util)s. Raw response from cl-quota: '%(raw_response)s'.Please, contact CloudLinux support for help in resolving this issue.Quota)utilraw_responsemessagecontextsuper__init__)selfr broken_exc_message __class__s r r zUnexpectedClQuotaError.__init__ sF *p 3:<)X)XZ Z +,,,,,r Nr r r __doc__r __classcell__r" s @r r r sG - - - - - - - - - -r r c " e Zd ZdZ fdZ xZS )QuotaDisabledExceptionz= Raised when quotas are disabled in system globally. c X dddid}t | d S )N%(util)s is disabledr r r r )r disabled_exc_messager" s r r zQuotaDisabledException.__init__( s: +A,2G+< > > -.....r r$ r' s @r r) r) $ sB / / / / / / / / /r r) c r e Zd ZdZdZd Zd Zd Zd ZddZ d Z d Zd Zd Z d Zd Zd Zd Zd Zd ZdS ) ClQuotaLibz/usr/bin/cl-quotaz/usr/sbin/repquotac > d | _ d | _ d | _ d | _ d S r# )_inode_user_limits_inode_package_dict_is_clquota_present_is_clquota_activatedr s r r zClQuotaLib.__init__2 s, IMIM #' %)"""r c \ | j t | j | j | _ | j S )zb Get quota presence flag :return: True/False - quotas present/not present )r2 r _CL_QUOTA_PATH_REPQUOTA_PATHr4 s r is_clquota_presentzClQuotaLib.is_clquota_present<