summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_keys_to_console.py
diff options
context:
space:
mode:
authorMichael Hudson-Doyle <michael.hudson@canonical.com>2021-02-23 08:20:46 +1300
committerGitHub <noreply@github.com>2021-02-22 14:20:46 -0500
commite384a5436560c9494118f0999c314982d4912d27 (patch)
tree22a657982fce42d22a727b0b9160f79f779cc136 /cloudinit/config/cc_keys_to_console.py
parent38aee6eebb160d46287c63a979bb897b15bb2f96 (diff)
downloadvyos-cloud-init-e384a5436560c9494118f0999c314982d4912d27.tar.gz
vyos-cloud-init-e384a5436560c9494118f0999c314982d4912d27.zip
cc_keys_to_console: add option to disable key emission (#811)
Specifically: ssh: emit_keys_to_console: false We also port the cc_keys_to_console cloud tests to the new integration testing framework, and add a test for this new option. LP: #1915460
Diffstat (limited to 'cloudinit/config/cc_keys_to_console.py')
-rw-r--r--cloudinit/config/cc_keys_to_console.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/cloudinit/config/cc_keys_to_console.py b/cloudinit/config/cc_keys_to_console.py
index 0f2be52b..646d1f67 100644
--- a/cloudinit/config/cc_keys_to_console.py
+++ b/cloudinit/config/cc_keys_to_console.py
@@ -51,6 +51,11 @@ def _get_helper_tool_path(distro):
def handle(name, cfg, cloud, log, _args):
+ if util.is_false(cfg.get("ssh", {}).get("emit_keys_to_console", True)):
+ log.debug(("Skipping module named %s, "
+ "logging of SSH host keys disabled"), name)
+ return
+
helper_path = _get_helper_tool_path(cloud.distro)
if not os.path.exists(helper_path):
log.warning(("Unable to activate module %s,"