[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:
Antoine Durand-Gasselin 2009-06-17 01:10:31 +02:00
parent 186f0ecacd
commit 1156c79c78
2 changed files with 16 additions and 16 deletions

View file

@ -1,5 +1,5 @@
#! /usr/bin/env python #! /usr/bin/env python
# -*- coding: iso8859-15 -*- # -*- coding: iso-8859-15 -*-
# Copyright (C) Frédéric Pauget # Copyright (C) Frédéric Pauget
# Licence : GPLv2 # Licence : GPLv2
@ -25,7 +25,7 @@ class del_user:
""" Suppression des fichiers d'un compte utilisateur """ """ Suppression des fichiers d'un compte utilisateur """
debug = True debug = True
def __init__(self, args): def __init__(self, args):
self.args = args self.args = args
@ -45,7 +45,7 @@ class del_user:
import traceback import traceback
traceback.print_exc() traceback.print_exc()
def delete_vert(self): def delete_fx(self):
cprint(u'Archivage fichiers utilisateur', 'gras') cprint(u'Archivage fichiers utilisateur', 'gras')
for args in self.args: for args in self.args:
anim('\t' + args) anim('\t' + args)
@ -82,8 +82,8 @@ class del_user:
traceback.print_exc() traceback.print_exc()
def reconfigure(self): def reconfigure(self):
if hostname == "vert": if hostname == "fx":
self.delete_vert() self.delete_fx()
elif hostname == "rouge": elif hostname == "rouge":
self.delete_directory(u"Suppression des fichiers index de dovecot", self.delete_directory(u"Suppression des fichiers index de dovecot",
"/var/dovecot-indexes/%s") "/var/dovecot-indexes/%s")
@ -115,7 +115,7 @@ class home:
if stat[4] != int(uid) or stat[5] != config.gid: if stat[4] != int(uid) or stat[5] != config.gid:
# Le home n'est pas pas à la bonne personne # Le home n'est pas pas à la bonne personne
raise OSError('home existant') raise OSError('home existant')
### Quota ### Quota
status, output = commands.getstatusoutput('/usr/sbin/edquota -p pauget %s' % login ) status, output = commands.getstatusoutput('/usr/sbin/edquota -p pauget %s' % login )
if status: if status:
@ -124,7 +124,7 @@ class home:
sys.stderr.write(output+'\n') sys.stderr.write(output+'\n')
else: else:
print OK print OK
### Mail ### Mail
os.mkdir(home + '/Mail', 0700) os.mkdir(home + '/Mail', 0700)
os.chown(home + '/Mail', int(uid), config.gid) os.chown(home + '/Mail', int(uid), config.gid)
@ -133,22 +133,22 @@ class home:
except: except:
print ERREUR print ERREUR
if self.debug: if self.debug:
import traceback import traceback
traceback.print_exc() traceback.print_exc()
class mail_bienvenue: class mail_bienvenue:
debug = True debug = True
def __init__(self, mails): def __init__(self, mails):
self.mails = mails self.mails = mails
def reconfigure(self): def reconfigure(self):
cprint(u'Envoi mail de bienvenue', 'gras') cprint(u'Envoi mail de bienvenue', 'gras')
for mail in self.mails: for mail in self.mails:
anim('\t' + mail) anim('\t' + mail)
try: try:
From = "respbats@crans.org" From = "respbats@crans.org"
To = mail To = mail
if To.find('@') == -1: To += '@crans.org' if To.find('@') == -1: To += '@crans.org'
@ -164,7 +164,7 @@ class mail_bienvenue:
class mail_ajout_droits: class mail_ajout_droits:
debug = True debug = True
def __init__(self, args): def __init__(self, args):
self.args = args self.args = args
@ -174,7 +174,7 @@ class mail_ajout_droits:
login = arg.split(":")[0] login = arg.split(":")[0]
Droit = arg.split(":")[1] Droit = arg.split(":")[1]
anim('\t' + login) anim('\t' + login)
try: try:
From = "root@crans.org" From = "root@crans.org"
To = login To = login
if To.find('@') == -1: To += '@crans.org' if To.find('@') == -1: To += '@crans.org'
@ -194,10 +194,10 @@ class mail_ajout_droits:
import traceback import traceback
traceback.print_exc() traceback.print_exc()
class ML_ens: class ML_ens:
debug = True debug = True
def __init__(self, mails): def __init__(self, mails):
self.mails = mails self.mails = mails

View file

@ -185,7 +185,7 @@ class zamok(base_reconfigure):
self._do(del_user(args)) self._do(del_user(args))
class vert(base_reconfigure): class fx(base_reconfigure):
def home(self, args): def home(self, args):
from adherents import home from adherents import home
self._do(home(args)) self._do(home(args))