From 1156c79c781585485f461903b06f0159868a61d7 Mon Sep 17 00:00:00 2001 From: Antoine Durand-Gasselin Date: Wed, 17 Jun 2009 01:10:31 +0200 Subject: [PATCH] [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 --- gestion/gen_confs/adherents.py | 30 +++++++++++++++--------------- gestion/gen_confs/generate.py | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/gestion/gen_confs/adherents.py b/gestion/gen_confs/adherents.py index 3a6f2059..c335a630 100644 --- a/gestion/gen_confs/adherents.py +++ b/gestion/gen_confs/adherents.py @@ -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 diff --git a/gestion/gen_confs/generate.py b/gestion/gen_confs/generate.py index 94883730..a8ca7c54 100644 --- a/gestion/gen_confs/generate.py +++ b/gestion/gen_confs/generate.py @@ -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))