Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Leo Colisson
scripts
Commits
a75223c7
Commit
a75223c7
authored
Mar 03, 2017
by
Leo Colisson
Browse files
Put a different quota for a club
parent
4fd4122e
Changes
2
Hide whitespace changes
Inline
Side-by-side
gestion/config/config.py
View file @
a75223c7
...
...
@@ -93,6 +93,12 @@ quota_soft = 8000000
quota_hard
=
10000000
fquota_soft
=
0
fquota_hard
=
0
quota_soft_club
=
20000000
quota_hard_club
=
23000000
fquota_soft_club
=
0
fquota_hard_club
=
0
# Shell
login_shell
=
'/bin/zsh'
club_login_shell
=
'/usr/bin/rssh'
...
...
gestion/gen_confs/adherents.py
View file @
a75223c7
...
...
@@ -116,12 +116,14 @@ class home:
anim
(
'
\t
'
+
args
)
try
:
login
,
oldLogin
,
oldHome
=
args
.
split
(
","
)
is_club
=
False
if
login
:
res
=
CONN
.
search
(
"login=%s"
%
(
login
,))
if
res
[
'adherent'
]:
adh
=
res
[
'adherent'
][
0
]
gid
=
config
.
gid
elif
res
[
'club'
]:
is_club
=
True
adh
=
res
[
'club'
][
0
]
gid
=
config
.
club_gid
home
=
adh
.
home
()
...
...
@@ -158,7 +160,23 @@ class home:
os
.
symlink
(
home
,
symlink
)
### 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
:
print
WARNING
if
self
.
debug
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment