On note un service comme redmarr uniquement si c'est effectivement le cas
darcs-hash:20040902092157-d1718-acf85ce4d7223916633910643a4ceedcf9dd23e8.gz
This commit is contained in:
parent
ae62a7f13d
commit
c1cfb3c8ae
2 changed files with 13 additions and 12 deletions
|
@ -104,24 +104,22 @@ if 'switch' in to_do.keys() :
|
||||||
|
|
||||||
# Les services suivants ont besoin de la liste des machines
|
# Les services suivants ont besoin de la liste des machines
|
||||||
# On va donc la lire une seule fois pour leur passer ensuite
|
# On va donc la lire une seule fois pour leur passer ensuite
|
||||||
|
|
||||||
|
restartlater = []
|
||||||
if 'firewall' in to_do.keys() :
|
if 'firewall' in to_do.keys() :
|
||||||
# Quand sila et komaz liront la base LDAP
|
# Quand sila et komaz liront la base LDAP
|
||||||
# db.services_to_restart('firewall-komaz')
|
# db.services_to_restart('firewall-komaz')
|
||||||
# db.services_to_restart('firewall-sila')
|
# db.services_to_restart('firewall-sila')
|
||||||
from gen_confs.firewall import firewall
|
from gen_confs.firewall import firewall
|
||||||
inst.append(firewall())
|
inst.append([firewall(),"firewall"])
|
||||||
db.services_to_restart('-firewall')
|
|
||||||
|
|
||||||
if 'dns' in to_do.keys() :
|
if 'dns' in to_do.keys() :
|
||||||
db.services_to_restart('-dns')
|
|
||||||
from gen_confs.bind import dns
|
from gen_confs.bind import dns
|
||||||
inst.append(dns())
|
inst.append([dns(),"dns"])
|
||||||
|
|
||||||
if 'dhcp' in to_do.keys() :
|
if 'dhcp' in to_do.keys() :
|
||||||
from gen_confs.dhcpd import dhcp
|
from gen_confs.dhcpd import dhcp
|
||||||
inst.append(dhcp())
|
inst.append([dhcp(),"dhcp"])
|
||||||
db.services_to_restart('-dhcp')
|
|
||||||
|
|
||||||
##### On fait ce qu'il reste à faire
|
##### On fait ce qu'il reste à faire
|
||||||
|
|
||||||
|
@ -145,13 +143,16 @@ if inst :
|
||||||
print OK
|
print OK
|
||||||
|
|
||||||
#### Reconfiguration des services
|
#### Reconfiguration des services
|
||||||
|
|
||||||
for i in inst :
|
for i in inst :
|
||||||
i.debug = debug
|
i[0].debug = debug
|
||||||
i.machines = machines
|
i[0].machines = machines
|
||||||
try :
|
try :
|
||||||
i.reconfigure()
|
i[0].reconfigure()
|
||||||
|
if auto : db.services_to_restart('-%s' % i[1])
|
||||||
except :
|
except :
|
||||||
sys.stderr.write('Erreur dans le service %s\n' % i)
|
sys.stderr.write('Erreur dans le service %s\n' % i[1])
|
||||||
|
|
||||||
|
|
||||||
if debug :
|
if debug :
|
||||||
print 'Non traité ici mais signalé dans la base LDAP : \n\t', db.services_to_restart()
|
print 'Non traité ici mais signalé dans la base LDAP : \n\t', db.services_to_restart()
|
||||||
|
|
|
@ -52,7 +52,7 @@ class switch(gen_config) :
|
||||||
a = self.db.search('chbre=%s' % chbre)['adherent']
|
a = self.db.search('chbre=%s' % chbre)['adherent']
|
||||||
action = ''
|
action = ''
|
||||||
for adh in a :
|
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
|
# Il faut activer la prise
|
||||||
anim('\tactivation chbre %s' % chbre)
|
anim('\tactivation chbre %s' % chbre)
|
||||||
action = 'enable'
|
action = 'enable'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue