On note un service comme redmarr uniquement si c'est effectivement le cas

darcs-hash:20040902092157-d1718-acf85ce4d7223916633910643a4ceedcf9dd23e8.gz
This commit is contained in:
bernat 2004-09-02 11:21:57 +02:00
parent ae62a7f13d
commit c1cfb3c8ae
2 changed files with 13 additions and 12 deletions

View file

@ -104,24 +104,22 @@ if 'switch' in to_do.keys() :
# Les services suivants ont besoin de la liste des machines
# On va donc la lire une seule fois pour leur passer ensuite
restartlater = []
if 'firewall' in to_do.keys() :
# Quand sila et komaz liront la base LDAP
# db.services_to_restart('firewall-komaz')
# db.services_to_restart('firewall-sila')
from gen_confs.firewall import firewall
inst.append(firewall())
db.services_to_restart('-firewall')
inst.append([firewall(),"firewall"])
if 'dns' in to_do.keys() :
db.services_to_restart('-dns')
from gen_confs.bind import dns
inst.append(dns())
inst.append([dns(),"dns"])
if 'dhcp' in to_do.keys() :
from gen_confs.dhcpd import dhcp
inst.append(dhcp())
db.services_to_restart('-dhcp')
inst.append([dhcp(),"dhcp"])
##### On fait ce qu'il reste à faire
@ -145,13 +143,16 @@ if inst :
print OK
#### Reconfiguration des services
for i in inst :
i.debug = debug
i.machines = machines
i[0].debug = debug
i[0].machines = machines
try :
i.reconfigure()
i[0].reconfigure()
if auto : db.services_to_restart('-%s' % i[1])
except :
sys.stderr.write('Erreur dans le service %s\n' % i)
sys.stderr.write('Erreur dans le service %s\n' % i[1])
if debug :
print 'Non traité ici mais signalé dans la base LDAP : \n\t', db.services_to_restart()

View file

@ -52,7 +52,7 @@ class switch(gen_config) :
a = self.db.search('chbre=%s' % chbre)['adherent']
action = ''
for adh in a :
if (((ann_scol in adh.paiement()) or ((ann_scol-1) in adh.paiement and localtime()[1]==9)) and 'bloq' not in adh.blacklist_actif()) :
if (((ann_scol in adh.paiement()) or ((ann_scol-1) in adh.paiement() and localtime()[1]==9)) and 'bloq' not in adh.blacklist_actif()) :
# Il faut activer la prise
anim('\tactivation chbre %s' % chbre)
action = 'enable'