summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2014-10-21 12:23:09 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2014-10-21 12:23:09 -0700
commit477a5418d55d45ddad55fcaa16ab3ac53652fdb9 (patch)
tree53c858f8852143f6aa036296a115f62e0dc74ff0
parenta6336edea275c409791807d16c1575ebd6895c9c (diff)
downloadvyos-cloud-init-477a5418d55d45ddad55fcaa16ab3ac53652fdb9.tar.gz
vyos-cloud-init-477a5418d55d45ddad55fcaa16ab3ac53652fdb9.zip
Use LOG.warn and handle the None case as well
-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