Consquences de la possibilit de mettre des dates de restart.
darcs-hash:20051001225512-41617-b2840fa818496a89130cf0b72e654ee213d32071.gz
This commit is contained in:
parent
201e09064a
commit
fcfb66cadf
1 changed files with 25 additions and 16 deletions
|
@ -43,16 +43,24 @@ class base_reconfigure :
|
||||||
def __init__(self,to_do=[]) :
|
def __init__(self,to_do=[]) :
|
||||||
if not to_do :
|
if not to_do :
|
||||||
if debug : print 'Lecture services à redémarrer dans la base LDAP'
|
if debug : print 'Lecture services à redémarrer dans la base LDAP'
|
||||||
to_do = db.services_to_restart()
|
|
||||||
auto = 1
|
auto = 1
|
||||||
# Développements nécessaires
|
to_do = {}
|
||||||
for service,args in to_do.items() :
|
# Création de la liste de ce qu'il y a à faire
|
||||||
|
for serv in db.services_to_restart() :
|
||||||
# Services spéciaux portant sur plusieurs machines
|
# Services spéciaux portant sur plusieurs machines
|
||||||
to_add = self.__service_develop.get(service,[])
|
to_add = self.__service_develop.get(serv.nom,[])
|
||||||
if to_add :
|
if to_add :
|
||||||
for s in to_add :
|
for nom in to_add :
|
||||||
db.services_to_restart(s,args)
|
for t in serv.start :
|
||||||
db.services_to_restart('-' + service)
|
db.services_to_restart(nom,serv.args,t)
|
||||||
|
if time() > t :
|
||||||
|
to_do[nom] = serv.args
|
||||||
|
db.services_to_restart('-' + serv.nom)
|
||||||
|
else :
|
||||||
|
for t in serv.start :
|
||||||
|
if time() > t :
|
||||||
|
to_do[serv.nom] = serv.args
|
||||||
|
break
|
||||||
else :
|
else :
|
||||||
auto = 0
|
auto = 0
|
||||||
if debug : print 'Services à redémarrer imposés (non lecture de la base LDAP)'
|
if debug : print 'Services à redémarrer imposés (non lecture de la base LDAP)'
|
||||||
|
@ -79,8 +87,8 @@ class base_reconfigure :
|
||||||
reste = db.services_to_restart()
|
reste = db.services_to_restart()
|
||||||
if reste :
|
if reste :
|
||||||
print "Reste à faire :"
|
print "Reste à faire :"
|
||||||
for item in reste.items() :
|
for s in reste :
|
||||||
print '\t%s(%s)' % item
|
print '\t%s' % s
|
||||||
else :
|
else :
|
||||||
print "Plus rien à faire"
|
print "Plus rien à faire"
|
||||||
|
|
||||||
|
@ -131,6 +139,10 @@ class rouge(base_reconfigure) :
|
||||||
from gen_confs.switchs import switch
|
from gen_confs.switchs import switch
|
||||||
self._do(switch(chambres))
|
self._do(switch(chambres))
|
||||||
|
|
||||||
|
def exemptions(self) :
|
||||||
|
from exemptions import exemptions
|
||||||
|
self._do(exemptions())
|
||||||
|
|
||||||
class zamok(base_reconfigure) :
|
class zamok(base_reconfigure) :
|
||||||
# Tout est dans le parent
|
# Tout est dans le parent
|
||||||
pass
|
pass
|
||||||
|
@ -161,10 +173,6 @@ class komaz(base_reconfigure) :
|
||||||
def blacklist(self) :
|
def blacklist(self) :
|
||||||
self.__fw().blacklist()
|
self.__fw().blacklist()
|
||||||
|
|
||||||
def exemptions(self) :
|
|
||||||
from exemptions import exemptions
|
|
||||||
self._do(exemptions())
|
|
||||||
|
|
||||||
class sila(base_reconfigure) :
|
class sila(base_reconfigure) :
|
||||||
def bl_carte_etudiant(self) :
|
def bl_carte_etudiant(self) :
|
||||||
from gen_confs.squid import squid_carte
|
from gen_confs.squid import squid_carte
|
||||||
|
@ -276,12 +284,13 @@ if __name__ == '__main__' :
|
||||||
elif opt == '--remove' :
|
elif opt == '--remove' :
|
||||||
for serv in val.split('&') :
|
for serv in val.split('&') :
|
||||||
print 'Supression de %s' % serv
|
print 'Supression de %s' % serv
|
||||||
db.services_to_restart('-%s' % serv)
|
db.services_to_restart('--%s' % serv)
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
elif opt == '--list' :
|
elif opt == '--list' :
|
||||||
print 'Services à redémarrer :'
|
print 'Services à redémarrer :'
|
||||||
print db.services_to_restart()
|
for s in db.services_to_restart() :
|
||||||
|
print '\t%s' % s
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
elif opt == '--reconnect' :
|
elif opt == '--reconnect' :
|
||||||
|
@ -310,7 +319,7 @@ if __name__ == '__main__' :
|
||||||
arg = []
|
arg = []
|
||||||
|
|
||||||
print 'Ajout de %s (%s)' % ( serv, arg )
|
print 'Ajout de %s (%s)' % ( serv, arg )
|
||||||
db.services_to_restart(serv, arg)
|
db.services_to_restart(serv, arg )
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
elif opt =='-h' or opt == '--help' :
|
elif opt =='-h' or opt == '--help' :
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue