From 7e49046d6cbcfd23f464c042a86acae4fbb9ca54 Mon Sep 17 00:00:00 2001 From: bernat Date: Fri, 22 Apr 2005 17:44:44 +0200 Subject: [PATCH] On n'utilise plus de locks, c'est gr au niveau de generate... darcs-hash:20050422154444-d1718-0f49610b7858ec6d104e1411fdec723f3e3bb4a6.gz --- gestion/wifi-update.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/gestion/wifi-update.py b/gestion/wifi-update.py index 55032904..1ff12541 100755 --- a/gestion/wifi-update.py +++ b/gestion/wifi-update.py @@ -52,7 +52,6 @@ sys.path.append('/usr/scripts/gestion') # LDAP from ldap_crans import crans_ldap -from lock import * # Divers from iptools import AddrInNet @@ -202,15 +201,8 @@ class UpdateFactory(protocol.ServerFactory): def getSAD_lock(self, getre, delre, host): # ETAPE 2 - # On essaie d'obtenir le lock - def delLockAndRaise(f): - remove_lock('gen_confs.wifi') - return f - - d = wait_lock('gen_confs.wifi', 'locked by wifi-update') - d.addCallback(lambda _: getSAD_script(self, getre, delre, host)) - d.addErrback(delLockAndRaise) - return d + # Plus de lock pour le moment... + return getSAD_script(self, getre, delre, host)) def getSAD_script(self, getre, delre, host): # ETAPE 3 @@ -230,7 +222,7 @@ class UpdateFactory(protocol.ServerFactory): # Il ne devrait n'y en avoir qu'un, mais... for f in os.listdir('retry'): result = result + file('retry/%s' % f).read() - remove_lock('gen_confs.wifi') + # remove_lock('gen_confs.wifi') return result else: # Il n'y a rien dans le répertoire retry @@ -255,7 +247,7 @@ class UpdateFactory(protocol.ServerFactory): for f in delre: os.remove(f) - remove_lock('gen_confs.wifi') + # remove_lock('gen_confs.wifi') if len(result) > 5: print "We send the following script to %s :" % host print result