Classe BorneWifi.

darcs-hash:20060302161125-68412-22a95570d131e655f5570a08a92a3135604ba32e.gz
This commit is contained in:
glondu 2006-03-02 17:11:25 +01:00
parent be3d9b49b0
commit 962e284d11
4 changed files with 8 additions and 9 deletions

View file

@ -10,7 +10,7 @@ Utilis
import sys, os, commands import sys, os, commands
sys.path.append('/usr/scripts/gestion') sys.path.append('/usr/scripts/gestion')
from ldap_crans import crans from ldap_crans import crans, BorneWifi
from gen_confs import gen_config from gen_confs import gen_config
# définition de la classe # définition de la classe
@ -162,7 +162,7 @@ class autostatus(gen_config) :
continue continue
# les bornes # les bornes
if m.canal() : if isinstance(m, BorneWifi):
# C'est une borne # C'est une borne
info = filter(lambda x: not x.startswith("<"), m.info()) info = filter(lambda x: not x.startswith("<"), m.info())
if info: if info:

View file

@ -28,7 +28,7 @@ sys.path.append('/usr/scripts/gestion')
import syslog import syslog
import pwd import pwd
from lock import * from lock import *
from ldap_crans import crans_ldap, ann_scol, machine, crans, invite, hostname from ldap_crans import crans_ldap, ann_scol, Machine, crans, invite, hostname
from affich_tools import * from affich_tools import *
from commands import getstatusoutput from commands import getstatusoutput
from iptools import AddrInNet from iptools import AddrInNet
@ -675,8 +675,7 @@ class firewall_komaz(firewall_crans) :
self.anim.cycle() self.anim.cycle()
sanctions = entite.blacklist_actif() sanctions = entite.blacklist_actif()
if 'upload' in sanctions or 'warez' in sanctions or 'p2p' in sanctions or 'autodisc' in sanctions : if 'upload' in sanctions or 'warez' in sanctions or 'p2p' in sanctions or 'autodisc' in sanctions :
from ldap_crans import machine if isinstance(entite, Machine):
if entite.__class__ == machine:
blacklist+=[entite] blacklist+=[entite]
else: else:
blacklist+=entite.machines() blacklist+=entite.machines()

View file

@ -5,7 +5,7 @@
import sys, smtplib, commands import sys, smtplib, commands
sys.path.append('/usr/scripts/gestion') sys.path.append('/usr/scripts/gestion')
from ldap_crans import smtpserv, crans, crans_ldap, machine, adherent, club from ldap_crans import smtpserv, crans, crans_ldap, Machine, adherent, club
from whos import machine_details, adher_details, club_details from whos import machine_details, adher_details, club_details
from gen_confs import gen_config from gen_confs import gen_config
from affich_tools import cprint, OK, anim from affich_tools import cprint, OK, anim
@ -45,7 +45,7 @@ Subject: %(Subject)s
for res in results : for res in results :
if res.dn in vus : continue if res.dn in vus : continue
vus.append(res.dn) vus.append(res.dn)
if res.__class__ == machine : if isinstance(res, Machine):
details.append(machine_details(res)) details.append(machine_details(res))
elif res.__class__ == adherent : elif res.__class__ == adherent :
details.append(adher_details(res)) details.append(adher_details(res))

View file

@ -18,7 +18,7 @@ import string, sys, os, commands, smtplib
sys.path.append('/usr/scripts/gestion') sys.path.append('/usr/scripts/gestion')
from hptools import hpswitch, sw_chbre from hptools import hpswitch, sw_chbre
from ldap_crans import crans_ldap from ldap_crans import crans_ldap, BorneWifi
from annuaires import chbre_prises, uplink_prises, reverse, bat_manuels, all_switchs from annuaires import chbre_prises, uplink_prises, reverse, bat_manuels, all_switchs
from random import shuffle from random import shuffle
from gen_confs import * from gen_confs import *
@ -307,7 +307,7 @@ exit
adm=0 adm=0
autres=0 autres=0
for m in crans_prises["%s%s" % (bat.upper(), annu_prise)] : for m in crans_prises["%s%s" % (bat.upper(), annu_prise)] :
if m.canal() : wifi+=1 if isinstance(m, BorneWifi): wifi += 1
elif m.Nom().find('.adm.crans.org')!=-1 : adm+=1 elif m.Nom().find('.adm.crans.org')!=-1 : adm+=1
else : autres+=1 else : autres+=1
if autres==0 and adm==0 : if autres==0 and adm==0 :