Façon plus jolie de tester l'existance d'un attribut lc_ldap
This commit is contained in:
parent
2c72dce85d
commit
2514cb0a18
2 changed files with 3 additions and 4 deletions
|
@ -244,7 +244,7 @@ class Zone(ZoneBase):
|
||||||
def add_aaaa_record(self, nom, machine):
|
def add_aaaa_record(self, nom, machine):
|
||||||
if self.ipv6:
|
if self.ipv6:
|
||||||
for ip in machine.get('ip6HostNumber', []):
|
for ip in machine.get('ip6HostNumber', []):
|
||||||
if len(machine['dnsIpv6'])<1 or machine['dnsIpv6'][0].value:
|
if machine.get('dnsIpv6', [True])[0]:
|
||||||
self.add(AAAA(nom, ip))
|
self.add(AAAA(nom, ip))
|
||||||
if self.ipv4:
|
if self.ipv4:
|
||||||
if nom == '@':
|
if nom == '@':
|
||||||
|
@ -376,7 +376,7 @@ class ZoneReverse(Zone):
|
||||||
nom = '.'.join(ip.value.reverse_dns.split('.')[:length])
|
nom = '.'.join(ip.value.reverse_dns.split('.')[:length])
|
||||||
if zone != self.zone_name:
|
if zone != self.zone_name:
|
||||||
continue
|
continue
|
||||||
if attr != 'ip6HostNumber' or len(machine['dnsIpv6'])<1 or machine['dnsIpv6'][0].value: # Hack pour envoyer le reverse vers l'adresse .v6 dans le cas où dnsIpv6 = False
|
if attr != 'ip6HostNumber' or machine.get('dnsIpv6', [True])[0]: # Hack pour envoyer le reverse vers l'adresse .v6 dans le cas où dnsIpv6 = False
|
||||||
self.add(PTR(nom, '%s.' % machine['host'][0]))
|
self.add(PTR(nom, '%s.' % machine['host'][0]))
|
||||||
else:
|
else:
|
||||||
rev_nom, rev_zone = str(machine['host'][0]).split('.', 1)
|
rev_nom, rev_zone = str(machine['host'][0]).split('.', 1)
|
||||||
|
|
|
@ -18,8 +18,7 @@ try:
|
||||||
if codes:
|
if codes:
|
||||||
sys.stdout.write(codes[0])
|
sys.stdout.write(codes[0])
|
||||||
else:
|
else:
|
||||||
droits = [str(d) for d in adh.get('droits', [])]
|
if imprimeur in adh['droits'] or nounou in adh['droits']:
|
||||||
if imprimeur in droits or nounou in droits:
|
|
||||||
code = digicode.gen_code(login)
|
code = digicode.gen_code(login)
|
||||||
sys.stdout.write(str(code))
|
sys.stdout.write(str(code))
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue