[populate_sshFingerprint] Ne pas présuposer que la valeur d'un attribut est une string

This commit is contained in:
Valentin Samir 2014-02-18 21:36:52 +01:00
parent ad335866ea
commit 63895c98d4

View file

@ -85,7 +85,7 @@ def publish_keys():
validation=check_keys(keys)
machines=get_machines()
for machine in machines:
sshkeys_old=[key.value for key in machine.get('sshFingerprint',[])]
sshkeys_old=[str(key) for key in machine.get('sshFingerprint',[])]
sshkeys_new=[key.decode('UTF-8') for algo,key in keys.items() if validation[algo]]
if not set(sshkeys_old)==set(sshkeys_new):
machine['sshFingerprint']=sshkeys_new