[bind.py] On ajoute un champs TXT pour les bornes avec leur position
Ignore-this: b9373720d6895036f6d72ef7f61b40db darcs-hash:20130107201656-3a55a-3286cd9e51c157918bdf3db6f157d2629585e529.gz
This commit is contained in:
parent
17d09862b8
commit
8817dc95b5
1 changed files with 3 additions and 1 deletions
|
@ -16,6 +16,7 @@ from iptools import AddrInNet, AddrInNets
|
|||
import ip6tools
|
||||
|
||||
import netaddr
|
||||
import ldap_crans
|
||||
|
||||
def short_name(fullhostname):
|
||||
return fullhostname.split(".")[0]
|
||||
|
@ -238,7 +239,6 @@ zone "%(NOM_zone)s" {
|
|||
self.anim.iter=len(self.machines)
|
||||
for machine in self.machines :
|
||||
self.anim.cycle()
|
||||
|
||||
# Calculs préliminaires
|
||||
try :
|
||||
nom , zone = machine.nom().split('.',1)
|
||||
|
@ -250,6 +250,8 @@ zone "%(NOM_zone)s" {
|
|||
# Le direct
|
||||
if zone in self.zones_direct :
|
||||
ligne = "%s\tIN\tA\t%s\n" % ( nom, machine.ip() )
|
||||
if isinstance(machine,ldap_crans.BorneWifi) and machine.position():
|
||||
ligne +="%s\tIN\tTXT\t\"LOC %s,%s\"\n" % (nom,machine.position()[0],machine.position()[1])
|
||||
direct[zone] = direct.get(zone, "") + ligne
|
||||
elif self.verbose and machine.nom() != "ftp.federez.net":
|
||||
warnings += u'Résolution directe ignorée (mid=%s) : zone non autoritaire (%s)\n' % ( machine.id().encode('iso-8859-1'), zone.encode('iso-8859-1') )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue