From 11590c5f3ff32b2bf34fb08fff058be138810b9f Mon Sep 17 00:00:00 2001 From: pauget Date: Sun, 3 Oct 2004 18:04:57 +0200 Subject: [PATCH] Il faut tre nounou pour dtruire un compte nounou. darcs-hash:20041003160457-41617-d3c455c88c3bf72e4c8d17bce6fde95ec898f398.gz --- gestion/ldap_crans.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/gestion/ldap_crans.py b/gestion/ldap_crans.py index 4511dc06..1e25ef88 100755 --- a/gestion/ldap_crans.py +++ b/gestion/ldap_crans.py @@ -21,9 +21,6 @@ else: rw_uri = 'ldaps://zamok.crans.org:636/' smtpserv = "localhost" - -# TODO : - # Interdire la modif des comptes nounou import smtplib, sre, os, random, string, time, sys import ldap, ldap.modlist @@ -940,17 +937,21 @@ class base_proprietaire(base_classes_crans) : def delete(self,comment='') : """Destruction du proprietaire""" - done = 0 + for m in self.machines() : # Destruction machines m.delete(comment) self._delete(self.dn,comment) - if self.compte() : - args = self._data['uid'][0] + ',' - args+= self._data['homeDirectory'][0] - self.services_to_restart('del_user',[ args ] ) + try : + if self.compte() : + args = self._data['uid'][0] + ',' + args+= self._data['homeDirectory'][0] + self.services_to_restart('del_user',[ args ] ) + except : + # Si ne peux avoir de compte + pass def save(self) : """