Possibilit de voir les clients wifi sur zamok pour les admins
darcs-hash:20041015214010-d1718-56eecf5692eb519313a5578784d298c7c2a2d1c3.gz
This commit is contained in:
parent
606cef9064
commit
2b74e4cfa1
1 changed files with 15 additions and 11 deletions
|
@ -48,6 +48,7 @@ except:
|
|||
from ldap_crans import is_actif , crans_ldap, ann_scol, crans, hostname
|
||||
from affich_tools import *
|
||||
from hptools import sw_chbre
|
||||
import user_tests
|
||||
import popen2
|
||||
|
||||
limit_aff_details = 1
|
||||
|
@ -596,10 +597,12 @@ def borne_etat(borne) :
|
|||
def borne_clients(borne) :
|
||||
"""Renvoie la liste des adresses MAC associées à la borne"""
|
||||
macs = []
|
||||
# Sur nectaris uniquement dans un premier temps
|
||||
if hostname == 'nectaris':
|
||||
# Uniquement possible pour les admins et si on a la clef
|
||||
for clef in ["/etc/wifi/ssh/wifi","/usr/scripts/gestion/clef-wifi"]:
|
||||
if os.path.isfile(clef) and user_tests.isadm():
|
||||
try:
|
||||
wl = popen2.Popen3("ssh -o StrictHostKeyChecking=no -i /etc/wifi/ssh/wifi root@%s wl assoclist 2> /dev/null" % borne)
|
||||
wl = popen2.Popen3("ssh -o StrictHostKeyChecking=no -i %s root@%s wl assoclist 2> /dev/null" % (clef,
|
||||
borne))
|
||||
wl.tochild.close()
|
||||
for line in wl.fromchild.readlines():
|
||||
# Chaque ligne est de la forme
|
||||
|
@ -607,6 +610,7 @@ def borne_clients(borne) :
|
|||
macs.append(line.split(" ")[1].strip())
|
||||
except:
|
||||
pass
|
||||
break # Pas la peine d'essayer une autre clef
|
||||
return macs
|
||||
|
||||
def prise_etat(chbre) :
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue