From e11b71900e95ec7f90d0da4e588be5c89d97baa9 Mon Sep 17 00:00:00 2001 From: Daniel Watkins Date: Mon, 19 Aug 2019 19:23:04 +0000 Subject: 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. --- doc/rtd/topics/format.rst | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'doc') 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 -- cgit v1.2.3