[gen_confs/bind] Dans la méthode add_sshfp_record, on rattrape les exceptions du à des sshFingerprint mal formé

This commit is contained in:
Valentin Samir 2014-02-21 18:05:02 +01:00
parent 470fa70f14
commit e579798fdc

View file

@ -254,6 +254,7 @@ class Zone(ZoneBase):
def add_sshfp_record(self, nom, machine):
for sshkey in machine.get('sshFingerprint', []):
try:
algo_txt, key = str(sshkey).split()[:2]
algo=config.sshfs_ralgo[algo_txt][1]
for hash in config.sshfp_hash.keys():
@ -265,6 +266,10 @@ class Zone(ZoneBase):
else:
self.add(SSHFP("%s.v4" % nom, hash, algo, key))
self.add(SSHFP("%s.v6" % nom, hash, algo, key))
# KeyError is l'algo dans ldap n'est pas connu
# TypeError si la clef n'est pas bien en base64
except (KeyError, TypeError):
pass
def add_machine(self, machine):
for host in machine['host']: