volume.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:charm-glusterfs 作者: openstack 项目源码 文件源码
def quota_list(vol_name: str) -> Result:
    """
    Return a list of quotas on the volume if any
    Enable bitrot detection and remediation on the volume
    volume: String.  The volume to operate on.
    :return: List of Quota's on the volume
    :raises: GlusterError if the command fails to run
    """
    cmd = ["gluster", "volume", "quota", vol_name, "list", "--xml"]
    try:
        output = subprocess.check_output(cmd, stderr=subprocess.PIPE)
        quota_list_result = parse_quota_list(output.decode('utf-8'))
        return quota_list_result
    except subprocess.CalledProcessError as e:
        log("subprocess failed stdout: {} stderr: {} returncode: {}".format(
            e.stdout, e.stderr, e.returncode), ERROR)
        return Err("Volume quota list command failed with error: {}".format(
            e.stderr))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号