port(TCP|UDP)(in|out) est dsormais une liste. Je ferai le changement de
syntaxe dans le schma au prochain dump/restauration de la base. darcs-hash:20060327003949-68412-6475d4ba6f2cf144789a90915fd72e1df374910e.gz
This commit is contained in:
parent
0626631ac9
commit
9e10f8584c
5 changed files with 32 additions and 43 deletions
|
@ -1046,7 +1046,8 @@ class base_classes_crans(crans_ldap):
|
|||
|
||||
# Formate les entrées de l'historique de la forme champ+diff-diff
|
||||
for champ in ['droits', 'controle', 'paiement', 'carteEtudiant',
|
||||
'mailAlias', 'hostAlias', 'exempt', 'nvram']:
|
||||
'mailAlias', 'hostAlias', 'exempt', 'nvram',
|
||||
'portTCPin', 'portTCPout', 'portUDPin', 'portUDPout']:
|
||||
if champ in self.modifs:
|
||||
if champ == 'controle':
|
||||
# Ce n'est pas pareil que self._init_data.get('controle', [''])
|
||||
|
@ -2546,7 +2547,8 @@ class Machine(base_classes_crans):
|
|||
self.services_to_restart('ragnarok-dhcp')
|
||||
else:
|
||||
self.services_to_restart('rouge-dhcp')
|
||||
if 'ports' in self.modifs:
|
||||
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()])
|
||||
|
||||
|
@ -2632,17 +2634,11 @@ class Machine(base_classes_crans):
|
|||
|
||||
def __port(self, ports, champ):
|
||||
if ports == None:
|
||||
return self._data.get(champ, [''])[0]
|
||||
return self._data.get(champ, [])
|
||||
|
||||
ports = preattr(ports)[1]
|
||||
if ports and self._data.get(champ) != ports:
|
||||
self._data[champ] = [ports]
|
||||
if 'ports' not in self.modifs:
|
||||
self.modifs.setdefault('ports', None)
|
||||
elif self._data.has_key(champ):
|
||||
self._data.pop(champ)
|
||||
if 'ports' not in self.modifs:
|
||||
self.modifs.setdefault('ports', None)
|
||||
ports = map(int, ports)
|
||||
ports.sort()
|
||||
self._set(champ, map(str, ports))
|
||||
|
||||
|
||||
class MachineFixe(Machine):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue