Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
scripts
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Leo Colisson
scripts
Commits
a75223c7
Commit
a75223c7
authored
Mar 03, 2017
by
Leo Colisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Put a different quota for a club
parent
4fd4122e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
gestion/config/config.py
gestion/config/config.py
+6
-0
gestion/gen_confs/adherents.py
gestion/gen_confs/adherents.py
+19
-1
No files found.
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
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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