summaryrefslogtreecommitdiff
path: root/cloudinit/transforms/keys_to_console.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-06-19 17:58:41 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-06-19 17:58:41 -0700
commit43eb6d5aace53bef2116dde0796807befef1d8ff (patch)
tree4e19b985cb97fd1293f9617c2b800e5377fc8494 /cloudinit/transforms/keys_to_console.py
parentb492cedaa5a4e66f4f4c589fc73f53afade7b904 (diff)
downloadvyos-cloud-init-43eb6d5aace53bef2116dde0796807befef1d8ff.tar.gz
vyos-cloud-init-43eb6d5aace53bef2116dde0796807befef1d8ff.zip
Make most of all the places use the paths join() function so that testing with non-real read/write paths is easier.
Diffstat (limited to 'cloudinit/transforms/keys_to_console.py')
-rw-r--r--cloudinit/transforms/keys_to_console.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/cloudinit/transforms/keys_to_console.py b/cloudinit/transforms/keys_to_console.py
index e974375f..40758198 100644
--- a/cloudinit/transforms/keys_to_console.py
+++ b/cloudinit/transforms/keys_to_console.py
@@ -29,23 +29,24 @@ frequency = PER_INSTANCE
helper_tool = '/usr/lib/cloud-init/write-ssh-key-fingerprints'
-def handle(name, cfg, _cloud, log, _args):
+def handle(name, cfg, cloud, log, _args):
if not os.path.exists(helper_tool):
log.warn(("Unable to activate transform %s,"
" helper tool not found at %s"), name, helper_tool)
return
fp_blacklist = util.get_cfg_option_list(cfg,
- "ssh_fp_console_blacklist", [])
+ "ssh_fp_console_blacklist", [])
key_blacklist = util.get_cfg_option_list(cfg,
- "ssh_key_console_blacklist", ["ssh-dss"])
+ "ssh_key_console_blacklist",
+ ["ssh-dss"])
try:
cmd = [helper_tool]
cmd.append(','.join(fp_blacklist))
cmd.append(','.join(key_blacklist))
(stdout, _stderr) = util.subp(cmd)
- util.write_file('/dev/console', stdout)
+ util.write_file(cloud.paths.join(False, '/dev/console'), stdout)
except:
log.warn("Writing keys to /dev/console failed!")
raise