in files/default/rgw_webservice.py [0:0]
def user_quota_set(self, user, num, scope="user", qtype="size", region=None, zone=None, zone_region_prefix="client.radosgw"):
if region is not None and zone is not None:
cmd = ["sudo", "/bin/radosgw-admin", "quota", "set", "--conf", "/etc/ceph/ceph.conf", "--uid", "%s" % user, "--quota-scope", "%s" % scope]
else:
cmd = ["/usr/bin/radosgw-admin", "quota", "set", "--conf", "/etc/ceph/ceph.conf", "--uid", "%s" % user, "--quota-scope", "%s" % scope]
if qtype == "objects":
cmd.append("--max-objects")
else:
cmd.append("--max-size")
cmd.append("%s" % num)
if region is not None and zone is not None:
cmd.append("-n")
# NB: This should match '[client.radosgw...]' or something similar found in ceph.conf for the RGW section
cmd.append("%s.%s-%s" % (zone_region_prefix, region, zone))
return call(cmd)