diff options
Diffstat (limited to 'cloudinit/config')
-rw-r--r-- | cloudinit/config/cc_keys_to_console.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/cloudinit/config/cc_keys_to_console.py b/cloudinit/config/cc_keys_to_console.py index ed7af690..58104f4d 100644 --- a/cloudinit/config/cc_keys_to_console.py +++ b/cloudinit/config/cc_keys_to_console.py @@ -26,13 +26,14 @@ from cloudinit import util frequency = PER_INSTANCE # This is a tool that cloud init provides -HELPER_TOOL = '/usr/lib/cloud-init/write-ssh-key-fingerprints' +HELPER_TOOL_TPL = '%s/cloud-init/write-ssh-key-fingerprints' -def handle(name, cfg, _cloud, log, _args): - if not os.path.exists(HELPER_TOOL): +def handle(name, cfg, cloud, log, _args): + helper_path = HELPER_TOOL_TPL % (cloud.distro.usr_lib_exec) + if not os.path.exists(helper_path): log.warn(("Unable to activate module %s," - " helper tool not found at %s"), name, HELPER_TOOL) + " helper tool not found at %s"), name, helper_path) return fp_blacklist = util.get_cfg_option_list(cfg, @@ -42,7 +43,7 @@ def handle(name, cfg, _cloud, log, _args): ["ssh-dss"]) try: - cmd = [HELPER_TOOL] + cmd = [helper_path] cmd.append(','.join(fp_blacklist)) cmd.append(','.join(key_blacklist)) (stdout, _stderr) = util.subp(cmd) |