From 35284818a9039ce3077e1f8a9f54212a3c3184b8 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Tue, 15 Oct 2013 09:05:50 -0500 Subject: [PATCH] Handle ssh key files that may only have a type/key specified If a specified key did not have a comment, it would be ignored as an invalid key. Fixes #4513 --- library/system/authorized_key | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/system/authorized_key b/library/system/authorized_key index 98f97eeb22..f200a9ee25 100644 --- a/library/system/authorized_key +++ b/library/system/authorized_key @@ -207,6 +207,11 @@ def parsekey(raw_key): # this line is just 'type key user@host' (type,key,comment) = key_parts options = None + elif len(key_parts) == 2: + # assuming just a type/key with no comment + (type,key) = key_parts + comment = "" + options = None else: # invalid key, maybe a comment? return None