[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]
|
champ = c.args[0]['info'].split(':')[0]
|
||||||
raise RuntimeError(u'Entrée en double dans le champ %s' % champ)
|
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
|
### Génération de la liste de services à redémarrer
|
||||||
# Quasiement tout est traité dans les classes filles.
|
# Quasiement tout est traité dans les classes filles.
|
||||||
if hasattr(self, "_blacklist_restart"):
|
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 MachineCrans, MachineWifi, BorneWifi
|
||||||
from ldap_crans import Adherent
|
from ldap_crans import Adherent
|
||||||
from affich_tools import *
|
from affich_tools import *
|
||||||
|
from config import rid
|
||||||
import user_tests
|
import user_tests
|
||||||
import subprocess, commands
|
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 :
|
Formatage sous forme d'un tableau des propriétés de la liste de machine :
|
||||||
* mid
|
* mid
|
||||||
* type (fixe ou wifi, born)
|
* rid
|
||||||
|
* type (serveur, adm, fil, wifi, adm, borne)
|
||||||
* nom
|
* nom
|
||||||
* adresse IP
|
* adresse IP
|
||||||
* adresse MAC
|
* adresse MAC
|
||||||
|
@ -254,13 +256,13 @@ def machines_brief(machines) :
|
||||||
p = coul(p,'rouge')
|
p = coul(p,'rouge')
|
||||||
|
|
||||||
# Données
|
# 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" + \
|
return u"Le propriétaire en rouge signale un problème administratif, en bleu une inscription gratuite\n" + \
|
||||||
tableau(data,
|
tableau(data,
|
||||||
titre = [u'mid', u'Type', u'Nom de machine', u'Propriétaire', u'Chbre', u'Limitation'],
|
titre = [u'mid', u'rid', u'Type', u'Nom de machine', u'Propriétaire', u'Chbre', u'Limitation'],
|
||||||
largeur = [5, 4, 18, '*', 5, 10],
|
largeur = [5, 5, 13, 18, '*', 5, 10],
|
||||||
alignement = ['d', 'c', 'c', 'c', 'g', 'c'])
|
alignement = ['d', 'd', 'c', 'c', 'c', 'g', 'c'])
|
||||||
|
|
||||||
def clubs_brief(clubs) :
|
def clubs_brief(clubs) :
|
||||||
"""
|
"""
|
||||||
|
@ -899,9 +901,14 @@ def _hist(clas) :
|
||||||
def __bases_machines(m) :
|
def __bases_machines(m) :
|
||||||
""" Retourne [ type de la machines, blacklist ] """
|
""" Retourne [ type de la machines, blacklist ] """
|
||||||
#Type
|
#Type
|
||||||
if isinstance(m, MachineWifi): t = 'wifi'
|
t = 'inconnu'
|
||||||
elif isinstance(m, BorneWifi): t = 'born'
|
for tp, (start, end) in rid.iteritems():
|
||||||
else : t='fixe'
|
if start <= int(m.rid()) <= end:
|
||||||
|
t = tp
|
||||||
|
break
|
||||||
|
|
||||||
|
if isinstance(m, BorneWifi):
|
||||||
|
t = "borne"
|
||||||
|
|
||||||
# Déconnectée ?
|
# Déconnectée ?
|
||||||
b = m.blacklist_actif()
|
b = m.blacklist_actif()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue