Si la machine est celle d'un adhrent gratuit, il n'y a pas de services redmarrer
a permet d'viter de rgnerer, par exemple, la chane MAC-IP sur des serveurs qui ne verront de toute faon jamais cette IP. darcs-hash:20080910001106-ffbb2-7371927139b14d0cbeb8eb409e210d5de240fe94.gz
This commit is contained in:
parent
0109427ab8
commit
a512ab5f33
1 changed files with 47 additions and 43 deletions
|
@ -2909,58 +2909,62 @@ class Machine(BaseClasseCrans):
|
|||
# Enregistrement
|
||||
self._save()
|
||||
|
||||
# Clef IPsec
|
||||
if 'ipsec' in self.modifs:
|
||||
ret += coul(u'Clef IPsec de la machine : %s\n' % self.ipsec(), 'cyan')
|
||||
self.services_to_restart('conf_wifi_ng')
|
||||
# Si le proprio ne paie pas de cotisation, il n'y a pas de services à
|
||||
# redémarrer (config automatique pour le vlan inscriptions)
|
||||
if not isinstance(self.proprietaire(), Adherent) or self.proprietaire().adherentPayant():
|
||||
|
||||
# Reconfiguration firewalls et dhcps
|
||||
if reconf_ip:
|
||||
self.services_to_restart('macip', reconf_ip)
|
||||
self.services_to_restart('classify', reconf_ip)
|
||||
if isinstance(self, MachineWifi):
|
||||
self.services_to_restart('ragnarok-dhcp')
|
||||
else:
|
||||
self.services_to_restart('rouge-dhcp')
|
||||
if 'portTCPin' in self.modifs or 'portTCPout' in self.modifs or \
|
||||
'portUDPin' in self.modifs or 'portUDPout' in self.modifs:
|
||||
self.services_to_restart('komaz-ports', [self.ip()])
|
||||
self.services_to_restart('mail_modif', ['ip=%s' % self.ip()])
|
||||
# Clef IPsec
|
||||
if 'ipsec' in self.modifs:
|
||||
ret += coul(u'Clef IPsec de la machine : %s\n' % self.ipsec(), 'cyan')
|
||||
self.services_to_restart('conf_wifi_ng')
|
||||
|
||||
# Reconfiguration DNS ?
|
||||
if 'host' in self.modifs or 'ipHostNumber' in self.modifs or 'hostAlias' in self.modifs:
|
||||
self.services_to_restart('dns')
|
||||
# Reconfiguration firewalls et dhcps
|
||||
if reconf_ip:
|
||||
self.services_to_restart('macip', reconf_ip)
|
||||
self.services_to_restart('classify', reconf_ip)
|
||||
if isinstance(self, MachineWifi):
|
||||
self.services_to_restart('ragnarok-dhcp')
|
||||
else:
|
||||
self.services_to_restart('rouge-dhcp')
|
||||
if 'portTCPin' in self.modifs or 'portTCPout' in self.modifs or \
|
||||
'portUDPin' in self.modifs or 'portUDPout' in self.modifs:
|
||||
self.services_to_restart('komaz-ports', [self.ip()])
|
||||
self.services_to_restart('mail_modif', ['ip=%s' % self.ip()])
|
||||
|
||||
# Reconfiguration bornes wifi ?
|
||||
if 'canal' in self.modifs or 'puissance' in self.modifs or 'nvram' in self.modifs or 'hotspot' in self.modifs:
|
||||
self.services_to_restart('conf_wifi_ng')
|
||||
# Reconfiguration DNS ?
|
||||
if 'host' in self.modifs or 'ipHostNumber' in self.modifs or 'hostAlias' in self.modifs:
|
||||
self.services_to_restart('dns')
|
||||
|
||||
# Reconfiguration clients wifi ?
|
||||
if isinstance(self, MachineWifi) or isinstance(self, BorneWifi) \
|
||||
and ('ipHostNumber' in self.modifs or 'host' in self.modifs or 'macAddress' in self.modifs):
|
||||
self.services_to_restart('conf_wifi_ng')
|
||||
# Reconfiguration bornes wifi ?
|
||||
if 'canal' in self.modifs or 'puissance' in self.modifs or 'nvram' in self.modifs or 'hotspot' in self.modifs:
|
||||
self.services_to_restart('conf_wifi_ng')
|
||||
|
||||
# Regénération blackliste nécessaire ?
|
||||
bl = self.blacklist_actif()
|
||||
if bl and ('ipHostNumber' in self.modifs or 'host' in self.modifs):
|
||||
for s in bl:
|
||||
self.services_to_restart(s, [self.ip()])
|
||||
# Reconfiguration clients wifi ?
|
||||
if isinstance(self, MachineWifi) or isinstance(self, BorneWifi) \
|
||||
and ('ipHostNumber' in self.modifs or 'host' in self.modifs or 'macAddress' in self.modifs):
|
||||
self.services_to_restart('conf_wifi_ng')
|
||||
|
||||
# Regénération de l'autostatus et mail de changmement ?
|
||||
if self.proprietaire().__class__ == AssociationCrans:
|
||||
self.services_to_restart('autostatus')
|
||||
self.services_to_restart('mail_modif', ['ip=%s' % self.ip()])
|
||||
# Regénération blackliste nécessaire ?
|
||||
bl = self.blacklist_actif()
|
||||
if bl and ('ipHostNumber' in self.modifs or 'host' in self.modifs):
|
||||
for s in bl:
|
||||
self.services_to_restart(s, [self.ip()])
|
||||
|
||||
# Synchronisation avec la base pgsql pour les exemptions
|
||||
if 'exempt' in self.modifs or ('ipHostNumber' in self.modifs and self.exempt()):
|
||||
self.services_to_restart('surveillance_exemptions')
|
||||
# Regénération de l'autostatus et mail de changmement ?
|
||||
if self.proprietaire().__class__ == AssociationCrans:
|
||||
self.services_to_restart('autostatus')
|
||||
self.services_to_restart('mail_modif', ['ip=%s' % self.ip()])
|
||||
|
||||
if 'exempt' in self.modifs:
|
||||
self.services_to_restart('mail_modif', ['ip=%s' % self.ip()])
|
||||
# Synchronisation avec la base pgsql pour les exemptions
|
||||
if 'exempt' in self.modifs or ('ipHostNumber' in self.modifs and self.exempt()):
|
||||
self.services_to_restart('surveillance_exemptions')
|
||||
|
||||
# Synchronisation avec la base pgsql pour la liste des machines
|
||||
if 'ipHostNumber' in self.modifs:
|
||||
self.services_to_restart('surveillance_machines')
|
||||
if 'exempt' in self.modifs:
|
||||
self.services_to_restart('mail_modif', ['ip=%s' % self.ip()])
|
||||
|
||||
# Synchronisation avec la base pgsql pour la liste des machines
|
||||
if 'ipHostNumber' in self.modifs:
|
||||
self.services_to_restart('surveillance_machines')
|
||||
|
||||
# Remise à zéro
|
||||
self.modifs = {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue