diff options
-rw-r--r-- | cloudinit/config/cc_keys_to_console.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cloudinit/config/cc_keys_to_console.py b/cloudinit/config/cc_keys_to_console.py index 58104f4d..f1c1adff 100644 --- a/cloudinit/config/cc_keys_to_console.py +++ b/cloudinit/config/cc_keys_to_console.py @@ -29,8 +29,16 @@ frequency = PER_INSTANCE HELPER_TOOL_TPL = '%s/cloud-init/write-ssh-key-fingerprints' +def _get_helper_tool_path(distro): + try: + base_lib = distro.usr_lib_exec + except AttributeError: + base_lib = '/usr/lib' + return HELPER_TOOL_TPL % base_lib + + def handle(name, cfg, cloud, log, _args): - helper_path = HELPER_TOOL_TPL % (cloud.distro.usr_lib_exec) + helper_path = _get_helper_tool_path(cloud.distro) if not os.path.exists(helper_path): log.warn(("Unable to activate module %s," " helper tool not found at %s"), name, helper_path) |