summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_final_message.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-07-09 16:41:45 -0400
committerScott Moser <smoser@ubuntu.com>2012-07-09 16:41:45 -0400
commit75af023c864d1b6c4e48788b1b4cf7aad5eb2204 (patch)
tree2f79d479ee27ecb26faa94b91ea47e10b63c6612 /cloudinit/config/cc_final_message.py
parent50b9e8b7be096e331eb070c5c48d833b1756463c (diff)
downloadvyos-cloud-init-75af023c864d1b6c4e48788b1b4cf7aad5eb2204.tar.gz
vyos-cloud-init-75af023c864d1b6c4e48788b1b4cf7aad5eb2204.zip
Revert back to using cheetah + adjust resultant code + templates
At this point there is a mixture of "double hash" cheetah comments and '#*' cheetah comments.
Diffstat (limited to 'cloudinit/config/cc_final_message.py')
-rw-r--r--cloudinit/config/cc_final_message.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/cloudinit/config/cc_final_message.py b/cloudinit/config/cc_final_message.py
index b1caca47..3865332f 100644
--- a/cloudinit/config/cc_final_message.py
+++ b/cloudinit/config/cc_final_message.py
@@ -26,23 +26,20 @@ from cloudinit.settings import PER_ALWAYS
frequency = PER_ALWAYS
-FINAL_MESSAGE_DEF = ("Cloud-init v. {{version}} finished at {{timestamp}}."
- " Up {{uptime}} seconds.")
+# Cheetah formated default message
+FINAL_MESSAGE_DEF = ("Cloud-init v. ${version} finished at ${timestamp}."
+ " Up ${uptime} seconds.")
def handle(_name, cfg, cloud, log, args):
- msg_in = None
+ msg_in = ''
if len(args) != 0:
- msg_in = args[0]
+ msg_in = str(args[0])
else:
- msg_in = util.get_cfg_option_str(cfg, "final_message")
-
- if not msg_in:
- template_fn = cloud.get_template_filename('final_message')
- if template_fn:
- msg_in = util.load_file(template_fn)
+ msg_in = util.get_cfg_option_str(cfg, "final_message". msg_in)
+ msg_in = msg_in.strip()
if not msg_in:
msg_in = FINAL_MESSAGE_DEF