Commit 28603c92 authored by Antoine Catton's avatar Antoine Catton

Avoid having None in known_hosts file.

parent d183095e
......@@ -43,8 +43,9 @@ class KnownHostsFile(dict):
def _dump(self):
with open(self._filename, 'w') as keyfile:
for key, value in self.items():
keyfile.write('%(host)s %(key)s\n' % {'host': key,
'key': value})
if key is not None and value is not None:
keyfile.write('%(host)s %(key)s\n' % {'host': key,
'key': value})
def __enter__(self):
self._load()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment