summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/distros/__init__.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py
index 7b05226a..83c2eebf 100644
--- a/cloudinit/distros/__init__.py
+++ b/cloudinit/distros/__init__.py
@@ -393,13 +393,14 @@ class Distro(object):
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"
- ", dict, or set.")
- else:
- keys = set(keys) or []
- ssh_util.setup_user_keys(keys, name, options=None)
+ 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