From 6fb6cfdea6ec31a69e749ddb638051c39256e7f3 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Tue, 21 Oct 2014 12:00:53 -0700 Subject: Also allow a dict to be used When a dict is passed in for 'ssh_authorized_keys' just extract the keys from the values of the dict (and discard the keys). --- cloudinit/distros/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cloudinit/distros') diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py index d30098eb..762529a6 100644 --- a/cloudinit/distros/__init__.py +++ b/cloudinit/distros/__init__.py @@ -391,10 +391,12 @@ class Distro(object): keys = kwargs['ssh_authorized_keys'] if isinstance(keys, (basestring, str)): keys = [keys] + if isinstance(keys, dict): + keys = list(keys.values()) if not isinstance(keys, (tuple, list, set)): util.multi_log("Invalid type detected for" " 'ssh_authorized_keys', expected list, string" - " or set.") + " , dict, or set.") else: keys = set(keys) or [] ssh_util.setup_user_keys(keys, name, options=None) -- cgit v1.2.3