summaryrefslogtreecommitdiff
path: root/cloudinit/distros
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2014-10-21 12:00:53 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2014-10-21 12:00:53 -0700
commit6fb6cfdea6ec31a69e749ddb638051c39256e7f3 (patch)
treee851e80e019bdfa7b7b5f25e5b83a117316de851 /cloudinit/distros
parente88f6ed4c46fcb1069fe899606a8b6d95411c13f (diff)
downloadvyos-cloud-init-6fb6cfdea6ec31a69e749ddb638051c39256e7f3.tar.gz
vyos-cloud-init-6fb6cfdea6ec31a69e749ddb638051c39256e7f3.zip
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).
Diffstat (limited to 'cloudinit/distros')
-rw-r--r--cloudinit/distros/__init__.py4
1 files changed, 3 insertions, 1 deletions
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)