[generate/adherents.py] les homes sont sur fx
Ignore-this: d26a9180392edeba4afcbb033659adea Il faudra sans doute croner generate sur fx darcs-hash:20090616231031-bd074-0a6d71e510fdf512d5cb7f030f54ab7a19d43f2e.gz
This commit is contained in:
parent
186f0ecacd
commit
1156c79c78
2 changed files with 16 additions and 16 deletions
|
@ -1,5 +1,5 @@
|
|||
#! /usr/bin/env python
|
||||
# -*- coding: iso8859-15 -*-
|
||||
# -*- coding: iso-8859-15 -*-
|
||||
|
||||
# Copyright (C) Frédéric Pauget
|
||||
# Licence : GPLv2
|
||||
|
@ -25,7 +25,7 @@ class del_user:
|
|||
""" Suppression des fichiers d'un compte utilisateur """
|
||||
|
||||
debug = True
|
||||
|
||||
|
||||
def __init__(self, args):
|
||||
self.args = args
|
||||
|
||||
|
@ -45,7 +45,7 @@ class del_user:
|
|||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
def delete_vert(self):
|
||||
def delete_fx(self):
|
||||
cprint(u'Archivage fichiers utilisateur', 'gras')
|
||||
for args in self.args:
|
||||
anim('\t' + args)
|
||||
|
@ -82,8 +82,8 @@ class del_user:
|
|||
traceback.print_exc()
|
||||
|
||||
def reconfigure(self):
|
||||
if hostname == "vert":
|
||||
self.delete_vert()
|
||||
if hostname == "fx":
|
||||
self.delete_fx()
|
||||
elif hostname == "rouge":
|
||||
self.delete_directory(u"Suppression des fichiers index de dovecot",
|
||||
"/var/dovecot-indexes/%s")
|
||||
|
@ -115,7 +115,7 @@ class home:
|
|||
if stat[4] != int(uid) or stat[5] != config.gid:
|
||||
# Le home n'est pas pas à la bonne personne
|
||||
raise OSError('home existant')
|
||||
|
||||
|
||||
### Quota
|
||||
status, output = commands.getstatusoutput('/usr/sbin/edquota -p pauget %s' % login )
|
||||
if status:
|
||||
|
@ -124,7 +124,7 @@ class home:
|
|||
sys.stderr.write(output+'\n')
|
||||
else:
|
||||
print OK
|
||||
|
||||
|
||||
### Mail
|
||||
os.mkdir(home + '/Mail', 0700)
|
||||
os.chown(home + '/Mail', int(uid), config.gid)
|
||||
|
@ -133,22 +133,22 @@ class home:
|
|||
|
||||
except:
|
||||
print ERREUR
|
||||
if self.debug:
|
||||
if self.debug:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
|
||||
class mail_bienvenue:
|
||||
debug = True
|
||||
|
||||
|
||||
def __init__(self, mails):
|
||||
self.mails = mails
|
||||
|
||||
|
||||
def reconfigure(self):
|
||||
cprint(u'Envoi mail de bienvenue', 'gras')
|
||||
for mail in self.mails:
|
||||
anim('\t' + mail)
|
||||
try:
|
||||
try:
|
||||
From = "respbats@crans.org"
|
||||
To = mail
|
||||
if To.find('@') == -1: To += '@crans.org'
|
||||
|
@ -164,7 +164,7 @@ class mail_bienvenue:
|
|||
|
||||
class mail_ajout_droits:
|
||||
debug = True
|
||||
|
||||
|
||||
def __init__(self, args):
|
||||
self.args = args
|
||||
|
||||
|
@ -174,7 +174,7 @@ class mail_ajout_droits:
|
|||
login = arg.split(":")[0]
|
||||
Droit = arg.split(":")[1]
|
||||
anim('\t' + login)
|
||||
try:
|
||||
try:
|
||||
From = "root@crans.org"
|
||||
To = login
|
||||
if To.find('@') == -1: To += '@crans.org'
|
||||
|
@ -194,10 +194,10 @@ class mail_ajout_droits:
|
|||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
|
||||
|
||||
class ML_ens:
|
||||
debug = True
|
||||
|
||||
|
||||
def __init__(self, mails):
|
||||
self.mails = mails
|
||||
|
||||
|
|
|
@ -185,7 +185,7 @@ class zamok(base_reconfigure):
|
|||
self._do(del_user(args))
|
||||
|
||||
|
||||
class vert(base_reconfigure):
|
||||
class fx(base_reconfigure):
|
||||
def home(self, args):
|
||||
from adherents import home
|
||||
self._do(home(args))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue