summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorDaniel Watkins <daniel@daniel-watkins.co.uk>2019-08-19 19:23:04 +0000
committerServer Team CI Bot <josh.powers+server-team-bot@canonical.com>2019-08-19 19:23:04 +0000
commite11b71900e95ec7f90d0da4e588be5c89d97baa9 (patch)
tree9e4a9c071f61e87d9e3baf765f799b5944ddb661 /doc
parent633f1eabac04325a639d9f4893e8bb6fa89bb281 (diff)
downloadvyos-cloud-init-e11b71900e95ec7f90d0da4e588be5c89d97baa9.tar.gz
vyos-cloud-init-e11b71900e95ec7f90d0da4e588be5c89d97baa9.zip
format.rst: add text/jinja2 to list of content types (+ cleanups)
The cleanups, specifically, are to sort the list of content types, and remove trailing whitespace.
Diffstat (limited to 'doc')
-rw-r--r--doc/rtd/topics/format.rst25
1 files changed, 13 insertions, 12 deletions
diff --git a/doc/rtd/topics/format.rst b/doc/rtd/topics/format.rst
index 15234d21..74d1fee9 100644
--- a/doc/rtd/topics/format.rst
+++ b/doc/rtd/topics/format.rst
@@ -23,14 +23,15 @@ For example, both a user data script and a cloud-config type could be specified.
Supported content-types:
-- text/x-include-once-url
-- text/x-include-url
-- text/cloud-config-archive
-- text/upstart-job
+- text/cloud-boothook
- text/cloud-config
+- text/cloud-config-archive
+- text/jinja2
- text/part-handler
+- text/upstart-job
+- text/x-include-once-url
+- text/x-include-url
- text/x-shellscript
-- text/cloud-boothook
Helper script to generate mime messages
---------------------------------------
@@ -38,16 +39,16 @@ Helper script to generate mime messages
.. code-block:: python
#!/usr/bin/python
-
+
import sys
-
+
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
-
+
if len(sys.argv) == 1:
print("%s input-file:type ..." % (sys.argv[0]))
sys.exit(1)
-
+
combined_message = MIMEMultipart()
for i in sys.argv[1:]:
(filename, format_type) = i.split(":", 1)
@@ -56,7 +57,7 @@ Helper script to generate mime messages
sub_message = MIMEText(contents, format_type, sys.getdefaultencoding())
sub_message.add_header('Content-Disposition', 'attachment; filename="%s"' % (filename))
combined_message.attach(sub_message)
-
+
print(combined_message)
@@ -78,10 +79,10 @@ Example
::
$ cat myscript.sh
-
+
#!/bin/sh
echo "Hello World. The time is now $(date -R)!" | tee /root/output.txt
-
+
$ euca-run-instances --key mykey --user-data-file myscript.sh ami-a07d95c9
Include File