summaryrefslogtreecommitdiff
path: root/cloudinit/UserDataHandler.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2010-06-18 00:23:25 -0400
committerScott Moser <smoser@ubuntu.com>2010-06-18 00:23:25 -0400
commit17fabe47dcbbe6b2180e73cac6211f7394d61a8a (patch)
tree9601bf8d16d19584f1a03749cb1e69965ab23148 /cloudinit/UserDataHandler.py
parent6cdd4bf0a05d90e1e5b9c7b9b3c9f5c251c0a652 (diff)
downloadvyos-cloud-init-17fabe47dcbbe6b2180e73cac6211f7394d61a8a.tar.gz
vyos-cloud-init-17fabe47dcbbe6b2180e73cac6211f7394d61a8a.zip
add 'cloud-boothook' type
if user data is of type text/cloud-boothook, or begins with #cloud-boothook, then assume it to be code to be executed. Boothooks are a very simple format. Basically, its a one line header ('#cloud-config\n') and then executable payload. The executable payload is written to a file, then that file is executed at the time it is read. The file is left in /var/lib/cloud/data/boothooks There is no "first-time-only" protection. If running only once is desired, the boothook must handle that itself.
Diffstat (limited to 'cloudinit/UserDataHandler.py')
-rw-r--r--cloudinit/UserDataHandler.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/cloudinit/UserDataHandler.py b/cloudinit/UserDataHandler.py
index b2c6e174..5c95173a 100644
--- a/cloudinit/UserDataHandler.py
+++ b/cloudinit/UserDataHandler.py
@@ -26,7 +26,8 @@ starts_with_mappings={
'#!' : 'text/x-shellscript',
'#cloud-config' : 'text/cloud-config',
'#upstart-job' : 'text/upstart-job',
- '#part-handler' : 'text/part-handler'
+ '#part-handler' : 'text/part-handler',
+ '#cloud-boothook' : 'text/cloud-boothook'
}
# if 'str' is compressed return decompressed otherwise return it