[ldap_crans/rid] On vire le patch sale, le rid est en place. Patch de whos pour afficher chaque machine suivant sa plage d'ip
Ignore-this: b93e7269facc6b9bbe0f294a8a03b6ca darcs-hash:20130126102158-afe24-b175fb636cd40276baa02542a5b075e0e54065e1.gz
This commit is contained in:
parent
b5b98ffaa3
commit
bfd4e48d99
2 changed files with 15 additions and 18 deletions
|
@ -1322,16 +1322,6 @@ class BaseClasseCrans(CransLdap):
|
|||
champ = c.args[0]['info'].split(':')[0]
|
||||
raise RuntimeError(u'Entrée en double dans le champ %s' % champ)
|
||||
|
||||
# l'ip change, le rid aussi...
|
||||
if 'ipHostNumber' in self.modifs:
|
||||
try:
|
||||
rid = ridtools.Rid(ipv4 = self._data["ipHostNumber"][0])
|
||||
except ValueError:
|
||||
pass
|
||||
else:
|
||||
self.rid('%d' % rid)
|
||||
|
||||
|
||||
### Génération de la liste de services à redémarrer
|
||||
# Quasiement tout est traité dans les classes filles.
|
||||
if hasattr(self, "_blacklist_restart"):
|
||||
|
|
|
@ -56,6 +56,7 @@ from ldap_crans import is_actif, crans_ldap, ann_scol, AssociationCrans, hostnam
|
|||
from ldap_crans import MachineCrans, MachineWifi, BorneWifi
|
||||
from ldap_crans import Adherent
|
||||
from affich_tools import *
|
||||
from config import rid
|
||||
import user_tests
|
||||
import subprocess, commands
|
||||
|
||||
|
@ -227,7 +228,8 @@ def machines_brief(machines) :
|
|||
"""
|
||||
Formatage sous forme d'un tableau des propriétés de la liste de machine :
|
||||
* mid
|
||||
* type (fixe ou wifi, born)
|
||||
* rid
|
||||
* type (serveur, adm, fil, wifi, adm, borne)
|
||||
* nom
|
||||
* adresse IP
|
||||
* adresse MAC
|
||||
|
@ -254,13 +256,13 @@ def machines_brief(machines) :
|
|||
p = coul(p,'rouge')
|
||||
|
||||
# Données
|
||||
data.append([m.id() , t, m.nom().split('.')[0], p, a.chbre(), bl])
|
||||
data.append([m.id(), m.rid() , t, m.nom().split('.')[0], p, a.chbre(), bl])
|
||||
|
||||
return u"Le propriétaire en rouge signale un problème administratif, en bleu une inscription gratuite\n" + \
|
||||
tableau(data,
|
||||
titre = [u'mid', u'Type', u'Nom de machine', u'Propriétaire', u'Chbre', u'Limitation'],
|
||||
largeur = [5, 4, 18, '*', 5, 10],
|
||||
alignement = ['d', 'c', 'c', 'c', 'g', 'c'])
|
||||
titre = [u'mid', u'rid', u'Type', u'Nom de machine', u'Propriétaire', u'Chbre', u'Limitation'],
|
||||
largeur = [5, 5, 13, 18, '*', 5, 10],
|
||||
alignement = ['d', 'd', 'c', 'c', 'c', 'g', 'c'])
|
||||
|
||||
def clubs_brief(clubs) :
|
||||
"""
|
||||
|
@ -899,9 +901,14 @@ def _hist(clas) :
|
|||
def __bases_machines(m) :
|
||||
""" Retourne [ type de la machines, blacklist ] """
|
||||
#Type
|
||||
if isinstance(m, MachineWifi): t = 'wifi'
|
||||
elif isinstance(m, BorneWifi): t = 'born'
|
||||
else : t='fixe'
|
||||
t = 'inconnu'
|
||||
for tp, (start, end) in rid.iteritems():
|
||||
if start <= int(m.rid()) <= end:
|
||||
t = tp
|
||||
break
|
||||
|
||||
if isinstance(m, BorneWifi):
|
||||
t = "borne"
|
||||
|
||||
# Déconnectée ?
|
||||
b = m.blacklist_actif()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue