From df72690e6cbf4033e96d99af8f4f18c3bcafa8bb Mon Sep 17 00:00:00 2001 From: Scott Gilbert Date: Thu, 16 Jan 2014 12:14:37 -0600 Subject: [PATCH] Allow keystring passed to authorized_key to contain blank lines and comments --- system/authorized_key | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/system/authorized_key b/system/authorized_key index ee613a90422..c9b178c3742 100644 --- a/system/authorized_key +++ b/system/authorized_key @@ -341,7 +341,9 @@ def enforce_state(module, params): state = params.get("state", "present") key_options = params.get("key_options", None) - key = key.split('\n') + # extract indivial keys into an array, skipping blank lines and comments + key = [s for s in key.splitlines() if s and not s.startswith('#')] + # check current state -- just get the filename, don't create file do_write = False