From 62bc0ad79ac882cbef1b2f061e709ab781ccb80c Mon Sep 17 00:00:00 2001 From: Robey Pointer Date: Sun, 19 Jul 2009 20:26:44 -0700 Subject: [PATCH] ignore extra fields in a hosts file, since apparently some apps are putting comments on the same line (?). --- paramiko/hostkeys.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paramiko/hostkeys.py b/paramiko/hostkeys.py index 851d2b1..09922d4 100644 --- a/paramiko/hostkeys.py +++ b/paramiko/hostkeys.py @@ -53,9 +53,10 @@ class HostKeyEntry: @type line: str """ fields = line.split(' ') - if len(fields) != 3: + if len(fields) < 3: # Bad number of fields return None + fields = fields[:3] names, keytype, key = fields names = names.split(',')