From 8bda246c6d96de8363f9aaab57e731a661458a17 Mon Sep 17 00:00:00 2001 From: pauget Date: Tue, 13 Sep 2005 11:39:56 +0200 Subject: [PATCH] Pas grand chose darcs-hash:20050913093956-41617-30d2e60f58893a6b26d19dd5d9535cd922bdac78.gz --- gestion/ldap_crans.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/gestion/ldap_crans.py b/gestion/ldap_crans.py index 9e311f69..e0daca86 100755 --- a/gestion/ldap_crans.py +++ b/gestion/ldap_crans.py @@ -343,17 +343,14 @@ class crans_ldap : try : res = self.conn.search_s(lock_dn,2,'objectClass=lock')[0] l = res[1]['lockid'][0] - except : l = '' + except : l = '%s-1' % hostname if l != lockid : # C'est locké par un autre process que le notre # il tourne encore ? - try : - if l.split('-')[0] == hostname and os.system('ps %s > /dev/null 2>&1' % l.split('-')[1] ) : - # Il ne tourne plus - self.remove_lock(res[0]) # delock - return self.lock(item,valeur) # relock - except : - pass + if l.split('-')[0] == hostname and os.system('ps %s > /dev/null 2>&1' % l.split('-')[1] ) : + # Il ne tourne plus + self.remove_lock(res[0]) # delock + return self.lock(item,valeur) # relock raise EnvironmentError(u'Objet (%s=%s) locké, patienter.' % (item, valeur), l) else : if not hasattr(self,'_locks') :