change the description of data_quota and data_quota_volume

This commit is contained in:
zhongyehong 2016-05-09 12:04:19 +08:00
parent e72968fda2
commit c7d3f1e4df
3 changed files with 11 additions and 9 deletions

View File

@ -135,11 +135,13 @@
# default: ""
# ADMIN_EMAIL_ADDRESS=""
# DATA_QUOTA : whether enable the quota of data or not
# default: "NO"
# DATA_QUOTA=""
# DATA_QUOTA : whether enable the quota of data volume or not
# True or False, default: False
# DATA_QUOTA=False
# DATA_QUOTA_CMD : the cmd to set the data quota, the argument of it should be directory name
# and the quota value.
# DATA_QUOTA_CMD : the cmd to set the quota of a given directory. It accepts two arguments:
# arg1: the directory name, relative path from the data volume root, e.g, "/users/bob/data"
# arg2: the quota value in GB of string, e.g., "100"
# default: "gluster volume quota docklet-volume limit-usage %s %s"
# DATA_QUOTA_CMD=""
# DATA_QUOTA_CMD="gluster volume quota docklet-volume limit-usage %s %s"

View File

@ -51,7 +51,7 @@ def getenv(key):
elif key =="ADMIN_EMAIL_ADDRESS":
return os.environ.get("ADMIN_EMAIL_ADDRESS", "")
elif key =="DATA_QUOTA":
return os.environ.get("DATA_QUOTA", "NO")
return os.environ.get("DATA_QUOTA", "False")
elif key =="DATA_QUOTA_CMD":
return os.environ.get("DATA_QUOTA_CMD", "gluster volume quota docklet-volume limit-usage %s %s")
else:

View File

@ -311,14 +311,14 @@ class userManager:
return user
def set_nfs_quota_bygroup(self,groupname, quota):
if not data_quota == "YES":
if not data_quota == "True":
return
users = User.query.filter_by(user_group = groupname).all()
for user in users:
self.set_nfs_quota(user.username, quota)
def set_nfs_quota(self, username, quota):
if not data_quota == "YES":
if not data_quota == "True":
return
nfspath = "/users/%s/data" % username
try: