/usr/lib/python2.6/site-packages/cloudinit/config
NameSizeModeActions
cc_apt_configure.py96000644editdlrm
cc_apt_configure.pyc90130644editdlrm
cc_apt_configure.pyo90130644editdlrm
cc_apt_pipelining.py21110644editdlrm
cc_apt_pipelining.pyc16430644editdlrm
cc_apt_pipelining.pyo16430644editdlrm
cc_bootcmd.py17820644editdlrm
cc_bootcmd.pyc12950644editdlrm
cc_bootcmd.pyo12950644editdlrm
cc_byobu.py28860644editdlrm
cc_byobu.pyc21850644editdlrm
cc_byobu.pyo21850644editdlrm
cc_ca_certs.py38720644editdlrm
cc_ca_certs.pyc33960644editdlrm
cc_ca_certs.pyo33960644editdlrm
cc_chef.py57180644editdlrm
cc_chef.pyc40270644editdlrm
cc_chef.pyo40270644editdlrm
cc_debug.py28690644editdlrm
cc_debug.pyc24440644editdlrm
cc_debug.pyo24440644editdlrm
cc_disable_ec2_metadata.py13120644editdlrm
cc_disable_ec2_metadata.pyc8730644editdlrm
cc_disable_ec2_metadata.pyo8730644editdlrm
cc_disk_setup.py252740644editdlrm
cc_disk_setup.pyc225600644editdlrm
cc_disk_setup.pyo225600644editdlrm
cc_emit_upstart.py17070644editdlrm
cc_emit_upstart.pyc11430644editdlrm
cc_emit_upstart.pyo11430644editdlrm
cc_final_message.py23480644editdlrm
cc_final_message.pyc18600644editdlrm
cc_final_message.pyo18600644editdlrm
cc_foo.py24530644editdlrm
cc_foo.pyc4880644editdlrm
cc_foo.pyo4880644editdlrm
cc_growpart.py96020644editdlrm
cc_growpart.pyc89280644editdlrm
cc_growpart.pyo89280644editdlrm
cc_grub_dpkg.py23440644editdlrm
cc_grub_dpkg.pyc15430644editdlrm
cc_grub_dpkg.pyo15430644editdlrm
cc_keys_to_console.py19430644editdlrm
cc_keys_to_console.pyc13000644editdlrm
cc_keys_to_console.pyo13000644editdlrm
cc_landscape.py29910644editdlrm
cc_landscape.pyc24760644editdlrm
cc_landscape.pyo24760644editdlrm
cc_locale.py13580644editdlrm
cc_locale.pyc8010644editdlrm
cc_locale.pyo8010644editdlrm
cc_mcollective.py37600644editdlrm
cc_mcollective.pyc18400644editdlrm
cc_mcollective.pyo18400644editdlrm
cc_migrator.py31190644editdlrm
cc_migrator.pyc27490644editdlrm
cc_migrator.pyo27490644editdlrm
cc_mounts.py84830644editdlrm
cc_mounts.pyc61530644editdlrm
cc_mounts.pyo61530644editdlrm
cc_package_update_upgrade_install.py35230644editdlrm
cc_package_update_upgrade_install.pyc29370644editdlrm
cc_package_update_upgrade_install.pyo29370644editdlrm
cc_phone_home.py36660644editdlrm
cc_phone_home.pyc24790644editdlrm
cc_phone_home.pyo24790644editdlrm
cc_power_state_change.py51210644editdlrm
cc_power_state_change.pyc49340644editdlrm
cc_power_state_change.pyo49340644editdlrm
cc_puppet.py51660644editdlrm
cc_puppet.pyc30550644editdlrm
cc_puppet.pyo30550644editdlrm
cc_resizefs.py56970644editdlrm
cc_resizefs.pyc47680644editdlrm
cc_resizefs.pyo47680644editdlrm
cc_resolv_conf.py36810644editdlrm
cc_resolv_conf.pyc22130644editdlrm
cc_resolv_conf.pyo22130644editdlrm
cc_rightscale_userdata.py35750644editdlrm
cc_rightscale_userdata.pyc20740644editdlrm
cc_rightscale_userdata.pyo20740644editdlrm
cc_rsyslog.py34120644editdlrm
cc_rsyslog.pyc18480644editdlrm
cc_rsyslog.pyo18480644editdlrm
cc_runcmd.py13480644editdlrm
cc_runcmd.pyc8420644editdlrm
cc_runcmd.pyo8420644editdlrm
cc_salt_minion.py23150644editdlrm
cc_salt_minion.pyc14130644editdlrm
cc_salt_minion.pyo14130644editdlrm
cc_scripts_per_boot.py13690644editdlrm
cc_scripts_per_boot.pyc8060644editdlrm
cc_scripts_per_boot.pyo8060644editdlrm
cc_scripts_per_instance.py13770644editdlrm
cc_scripts_per_instance.pyc8200644editdlrm
cc_scripts_per_instance.pyo8200644editdlrm
cc_scripts_per_once.py13650644editdlrm
cc_scripts_per_once.pyc8040644editdlrm
cc_scripts_per_once.pyo8040644editdlrm
cc_scripts_user.py13880644editdlrm
cc_scripts_user.pyc7880644editdlrm
cc_scripts_user.pyo7880644editdlrm
cc_scripts_vendor.py13980644editdlrm
cc_scripts_vendor.pyc9240644editdlrm
cc_scripts_vendor.pyo9240644editdlrm
cc_seed_random.py31610644editdlrm
cc_seed_random.pyc27670644editdlrm
cc_seed_random.pyo27670644editdlrm
cc_set_hostname.py14600644editdlrm
cc_set_hostname.pyc9320644editdlrm
cc_set_hostname.pyo9320644editdlrm
cc_set_passwords.py55550644editdlrm
cc_set_passwords.pyc40100644editdlrm
cc_set_passwords.pyo40100644editdlrm
cc_ssh.py52250644editdlrm
cc_ssh.pyc41040644editdlrm
cc_ssh.pyo41040644editdlrm
cc_ssh_authkey_fingerprints.py36480644editdlrm
cc_ssh_authkey_fingerprints.pyc35070644editdlrm
cc_ssh_authkey_fingerprints.pyo35070644editdlrm
cc_ssh_import_id.py30390644editdlrm
cc_ssh_import_id.pyc21910644editdlrm
cc_ssh_import_id.pyo21910644editdlrm
cc_timezone.py13160644editdlrm
cc_timezone.pyc7690644editdlrm
cc_timezone.pyo7690644editdlrm
cc_update_etc_hosts.py23910644editdlrm
cc_update_etc_hosts.pyc15090644editdlrm
cc_update_etc_hosts.pyo15090644editdlrm
cc_update_hostname.py16270644editdlrm
cc_update_hostname.pyc11660644editdlrm
cc_update_hostname.pyo11660644editdlrm
cc_users_groups.py12650644editdlrm
cc_users_groups.pyc7920644editdlrm
cc_users_groups.pyo7920644editdlrm
cc_write_files.py35540644editdlrm
cc_write_files.pyc32310644editdlrm
cc_write_files.pyo32310644editdlrm
cc_yum_add_repo.py39440644editdlrm
cc_yum_add_repo.pyc30260644editdlrm
cc_yum_add_repo.pyo30260644editdlrm
__init__.py19700644editdlrm
__init__.pyc13490644editdlrm
__init__.pyo13490644editdlrm
Edit: /usr/lib/python2.6/site-packages/cloudinit/config/cc_ssh_authkey_fingerprints.py (3648B)
# vi: ts=4 expandtab # # Copyright (C) 2012 Yahoo! Inc. # # Author: Joshua Harlow # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3, as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . import base64 import hashlib from prettytable import PrettyTable # Ensure this is aliased to a name not 'distros' # since the module attribute 'distros' # is a list of distros that are supported, not a sub-module from cloudinit import distros as ds from cloudinit import ssh_util from cloudinit import util def _split_hash(bin_hash): split_up = [] for i in xrange(0, len(bin_hash), 2): split_up.append(bin_hash[i:i + 2]) return split_up def _gen_fingerprint(b64_text, hash_meth='md5'): if not b64_text: return '' # TBD(harlowja): Maybe we should feed this into 'ssh -lf'? try: hasher = hashlib.new(hash_meth) hasher.update(base64.b64decode(b64_text)) return ":".join(_split_hash(hasher.hexdigest())) except (TypeError, ValueError): # Raised when b64 not really b64... # or when the hash type is not really # a known/supported hash type... return '?' def _is_printable_key(entry): if any([entry.keytype, entry.base64, entry.comment, entry.options]): if (entry.keytype and entry.keytype.lower().strip() in ['ssh-dss', 'ssh-rsa']): return True return False def _pprint_key_entries(user, key_fn, key_entries, hash_meth='md5', prefix='ci-info: '): if not key_entries: message = ("%sno authorized ssh keys fingerprints found for user %s.\n" % (prefix, user)) util.multi_log(message) return tbl_fields = ['Keytype', 'Fingerprint (%s)' % (hash_meth), 'Options', 'Comment'] tbl = PrettyTable(tbl_fields) for entry in key_entries: if _is_printable_key(entry): row = [] row.append(entry.keytype or '-') row.append(_gen_fingerprint(entry.base64, hash_meth) or '-') row.append(entry.options or '-') row.append(entry.comment or '-') tbl.add_row(row) authtbl_s = tbl.get_string() authtbl_lines = authtbl_s.splitlines() max_len = len(max(authtbl_lines, key=len)) lines = [ util.center("Authorized keys from %s for user %s" % (key_fn, user), "+", max_len), ] lines.extend(authtbl_lines) for line in lines: util.multi_log(text="%s%s\n" % (prefix, line), stderr=False, console=True) def handle(name, cfg, cloud, log, _args): if 'no_ssh_fingerprints' in cfg: log.debug(("Skipping module named %s, " "logging of ssh fingerprints disabled"), name) hash_meth = util.get_cfg_option_str(cfg, "authkey_hash", "md5") (users, _groups) = ds.normalize_users_groups(cfg, cloud.distro) for (user_name, _cfg) in users.items(): (key_fn, key_entries) = ssh_util.extract_authorized_keys(user_name) _pprint_key_entries(user_name, key_fn, key_entries, hash_meth)