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))
评论列表
文章目录