[gen_confs/bind] Dans la méthode add_sshfp_record, on rattrape les exceptions du à des sshFingerprint mal formé
This commit is contained in:
parent
470fa70f14
commit
e579798fdc
1 changed files with 16 additions and 11 deletions
|
@ -254,17 +254,22 @@ class Zone(ZoneBase):
|
|||
|
||||
def add_sshfp_record(self, nom, machine):
|
||||
for sshkey in machine.get('sshFingerprint', []):
|
||||
algo_txt, key = str(sshkey).split()[:2]
|
||||
algo=config.sshfs_ralgo[algo_txt][1]
|
||||
for hash in config.sshfp_hash.keys():
|
||||
self.add(SSHFP(nom, hash, algo, key))
|
||||
if self.ipv4 and self.ipv6:
|
||||
if nom == '@':
|
||||
self.add(SSHFP("v4", hash, algo, key))
|
||||
self.add(SSHFP("v6", hash, algo, key))
|
||||
else:
|
||||
self.add(SSHFP("%s.v4" % nom, hash, algo, key))
|
||||
self.add(SSHFP("%s.v6" % nom, hash, algo, key))
|
||||
try:
|
||||
algo_txt, key = str(sshkey).split()[:2]
|
||||
algo=config.sshfs_ralgo[algo_txt][1]
|
||||
for hash in config.sshfp_hash.keys():
|
||||
self.add(SSHFP(nom, hash, algo, key))
|
||||
if self.ipv4 and self.ipv6:
|
||||
if nom == '@':
|
||||
self.add(SSHFP("v4", hash, algo, key))
|
||||
self.add(SSHFP("v6", hash, algo, key))
|
||||
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']:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue