Pas grand chose
darcs-hash:20050913093956-41617-30d2e60f58893a6b26d19dd5d9535cd922bdac78.gz
This commit is contained in:
parent
cb1670c73e
commit
8bda246c6d
1 changed files with 5 additions and 8 deletions
|
@ -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') :
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue