[radius_auth] partial hostname

Ignore-this: eff2c986b3f0d4cd57b255a74cf748c

darcs-hash:20120510105724-ce021-5d351971a6bc8964ae03e3438294e77cde37c046.gz
This commit is contained in:
Daniel Stan 2012-05-10 12:57:24 +02:00
parent d31dc13990
commit e15b3beb71

View file

@ -92,7 +92,7 @@ if __name__ == '__main__' :
# On logue la prise sur laquelle a lieu la tentative
openlog("radius_auth.py")
switch = os.getenv("NAS_IDENTIFIER", "").replace('"', '')
switch = os.getenv("NAS_IDENTIFIER", "").replace('"', '').split('.')[0]
prise = (len(switch) == 6 and (switch[3] + switch[5]) or (switch + "-"))
prise += "%02d" % int(os.getenv("NAS_PORT", 0))
syslog("%s -> %s [%s]" % (prise, mac, msg))