Mini Shell

Direktori : /proc/self/root/opt/imh-python/lib/python3.9/site-packages/rads/
Upload File :
Current File : //proc/self/root/opt/imh-python/lib/python3.9/site-packages/rads/shared.py

"""Backwards compat for rads.shared"""
import rads

# pylint: disable=unused-import
from . import (
    SYS_USERS,
    SYS_MYSQL_USERS,
    STAFF_GROUPS,
)
from .compat import deprecated


@deprecated('rads.cpuser_safe')
def is_t1_safe(username):
    """deprecated"""
    return rads.cpuser_safe(user=username)


@deprecated('rads.QuotaCtl().fsquota')
def acct_safe_size(user, max_mb=10240, **__):
    """deprecated"""
    return rads.QuotaCtl().getquota(user=user) < max_mb * 2 ** 20


@deprecated('rads.SECURE_USER')
def get_secure_username():
    """deprecated"""
    return rads.SECURE_USER


@deprecated('rads.is_cpuser')
def is_cpanel_user(username):
    """deprecated"""
    return rads.is_cpuser(username)


@deprecated('rads.all_cpusers')
def get_users():
    """deprecated"""
    return rads.all_cpusers()


@deprecated('rads.get_homedir')
def get_homedir_path(username):
    """deprecated"""
    try:
        return rads.get_homedir(username)
    except rads.CpuserError:
        return None  # mimic old behavior


@deprecated('rads.cpuser_suspended')
def is_suspended(user):
    """deprecated"""
    return rads.cpuser_suspended(user)


@deprecated('Use rads.get_primary_domain')
def get_primary_domain(username):
    """deprecated"""
    try:
        return rads.get_primary_domain(username)
    except rads.CpuserError:
        return None  # mimic old behavior

Zerion Mini Shell 1.0