Commit a75223c7 authored by Leo Colisson's avatar Leo Colisson

Put a different quota for a club

parent 4fd4122e
...@@ -93,6 +93,12 @@ quota_soft = 8000000 ...@@ -93,6 +93,12 @@ quota_soft = 8000000
quota_hard = 10000000 quota_hard = 10000000
fquota_soft = 0 fquota_soft = 0
fquota_hard = 0 fquota_hard = 0
quota_soft_club = 20000000
quota_hard_club = 23000000
fquota_soft_club = 0
fquota_hard_club = 0
# Shell # Shell
login_shell = '/bin/zsh' login_shell = '/bin/zsh'
club_login_shell = '/usr/bin/rssh' club_login_shell = '/usr/bin/rssh'
......
...@@ -116,12 +116,14 @@ class home: ...@@ -116,12 +116,14 @@ class home:
anim('\t' + args) anim('\t' + args)
try: try:
login, oldLogin, oldHome = args.split(",") login, oldLogin, oldHome = args.split(",")
is_club = False
if login: if login:
res = CONN.search("login=%s" % (login,)) res = CONN.search("login=%s" % (login,))
if res['adherent']: if res['adherent']:
adh = res['adherent'][0] adh = res['adherent'][0]
gid = config.gid gid = config.gid
elif res['club']: elif res['club']:
is_club = True
adh = res['club'][0] adh = res['club'][0]
gid = config.club_gid gid = config.club_gid
home = adh.home() home = adh.home()
...@@ -158,7 +160,23 @@ class home: ...@@ -158,7 +160,23 @@ class home:
os.symlink(home, symlink) os.symlink(home, symlink)
### Quota ### Quota
status, output = commands.getstatusoutput('/usr/sbin/setquota -u %s %s %s %s %s -a' % (uid, config.quota_soft, config.quota_hard, config.fquota_soft, config.fquota_hard) ) if is_club:
quota_soft = config.quota_soft
quota_hard = config.quota_hard
fquota_soft = config.fquota_soft
fquota_hard = config.fquota_hard
else:
quota_soft = config.quota_soft_club
quota_hard = config.quota_hard_club
fquota_soft = config.fquota_soft_club
fquota_hard = config.fquota_hard_club
status, output = commands.getstatusoutput(
'/usr/sbin/setquota -u %s %s %s %s %s -a' % (
uid,
quota_soft,
quota_hard,
fquota_soft,
fquota_hard))
if status: if status:
print WARNING print WARNING
if self.debug: if self.debug:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment