diff options
author | Joshua Harlow <harlowja@yahoo-inc.com> | 2014-11-25 11:46:10 -0800 |
---|---|---|
committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2014-11-25 11:46:10 -0800 |
commit | 7b39b3976f94fd9ce9cbe39324ec14ad5a7c334e (patch) | |
tree | 0ebb51599a0024b2507811697bfe965e66ac29e1 /cloudinit/distros/__init__.py | |
parent | 7d20f3843bff0069b1ac9b2f0c6d346889789058 (diff) | |
parent | 1db41a6f5283d38dff6de0b0421d51eac869a39c (diff) | |
download | vyos-cloud-init-7b39b3976f94fd9ce9cbe39324ec14ad5a7c334e.tar.gz vyos-cloud-init-7b39b3976f94fd9ce9cbe39324ec14ad5a7c334e.zip |
Update with trunk and resolve conflicts
Diffstat (limited to 'cloudinit/distros/__init__.py')
-rw-r--r-- | cloudinit/distros/__init__.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py index 49014477..bf465442 100644 --- a/cloudinit/distros/__init__.py +++ b/cloudinit/distros/__init__.py @@ -388,8 +388,20 @@ class Distro(object): # Import SSH keys if 'ssh_authorized_keys' in kwargs: - keys = set(kwargs['ssh_authorized_keys']) or [] - ssh_util.setup_user_keys(keys, name, options=None) + # Try to handle this in a smart manner. + keys = kwargs['ssh_authorized_keys'] + if isinstance(keys, (basestring, str)): + keys = [keys] + if isinstance(keys, dict): + keys = list(keys.values()) + if keys is not None: + if not isinstance(keys, (tuple, list, set)): + LOG.warn("Invalid type '%s' detected for" + " 'ssh_authorized_keys', expected list," + " string, dict, or set.", type(keys)) + else: + keys = set(keys) or [] + ssh_util.setup_user_keys(keys, name, options=None) return True |