do not crash in final console-conf screen if no host keys are read (mostly dry-run mode)

This commit is contained in:
Michael Hudson-Doyle 2017-04-05 14:26:28 +12:00
parent eea4240bac
commit 618c4e6e72
1 changed files with 2 additions and 0 deletions

View File

@ -89,6 +89,8 @@ The {keytype} host key fingerprints is:
def host_key_info():
fingerprints = host_key_fingerprints()
if len(fingerprints) == 0:
return []
if len(fingerprints) == 1:
[(keytype, fingerprint)] = fingerprints
return single_host_key_tmpl.format(keytype=keytype, fingerprint=fingerprint)