summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-09-24 20:49:29 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-09-24 20:49:29 -0700
commit56d0585fd7d9804b82a1eb22faff8a6554b100b8 (patch)
tree0d12ccd9cdd0629250d2dd28be9fcb1ef2a89a2a /cloudinit
parent12495e3e597541ad411a656c980b9e405c2a902d (diff)
downloadvyos-cloud-init-56d0585fd7d9804b82a1eb22faff8a6554b100b8.tar.gz
vyos-cloud-init-56d0585fd7d9804b82a1eb22faff8a6554b100b8.zip
Adjust the fingerprints to use this new
user normalization function instead of the previous 'user' extraction.
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/config/cc_ssh_authkey_fingerprints.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/cloudinit/config/cc_ssh_authkey_fingerprints.py b/cloudinit/config/cc_ssh_authkey_fingerprints.py
index 23f5755a..36d439d2 100644
--- a/cloudinit/config/cc_ssh_authkey_fingerprints.py
+++ b/cloudinit/config/cc_ssh_authkey_fingerprints.py
@@ -23,6 +23,7 @@ from prettytable import PrettyTable
from cloudinit import ssh_util
from cloudinit import util
+from cloudinit import distros
def _split_hash(bin_hash):
@@ -89,8 +90,9 @@ def handle(name, cfg, cloud, log, _args):
log.debug(("Skipping module named %s, "
"logging of ssh fingerprints disabled"), name)
- user_name = util.get_cfg_option_str(cfg, "user", "ubuntu")
hash_meth = util.get_cfg_option_str(cfg, "authkey_hash", "md5")
- extract = ssh_util.extract_authorized_keys
- (auth_key_fn, auth_key_entries) = extract(user_name, cloud.paths)
- _pprint_key_entries(user_name, auth_key_fn, auth_key_entries, hash_meth)
+ extract_func = ssh_util.extract_authorized_keys
+ (users, _groups) = distros.normalize_users_groups(cfg, cloud.distro)
+ for (user_name, _cfg) in users.items():
+ (auth_key_fn, auth_key_entries) = extract_func(user_name, cloud.paths)
+ _pprint_key_entries(user_name, auth_key_fn, auth_key_entries, hash_meth)