From e6e30d8c8f72b904b34e93d2b9c4aef39b965b59 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 28 Jan 2010 17:16:11 -0500 Subject: add the part-handler plugin If a part of a multipart file is 'text/part-handler' then it is expected to be python code that implements 2 methods - list_types() list the types that this part-handler supports, return a list. ie: return(['text/plain']) - handle_parts(data,ctype,filename,payload) this method will be called: once, when loaded, with ctype == '__begin__' once per part once, at the end, with ctype == '__end__' - ctype is the content type ('text/plain') - filename is the filename portion of the mime data - payload is the content of the part - data is currently the cloud object, but this could change --- ec2init/UserDataHandler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ec2init/UserDataHandler.py') diff --git a/ec2init/UserDataHandler.py b/ec2init/UserDataHandler.py index f7c0e214..56feb0ff 100644 --- a/ec2init/UserDataHandler.py +++ b/ec2init/UserDataHandler.py @@ -8,7 +8,8 @@ starts_with_mappings={ '#include' : 'text/x-include-url', '#!' : 'text/x-shellscript', '#cloud-config' : 'text/cloud-config', - '#upstart-job' : 'text/upstart-job' + '#upstart-job' : 'text/upstart-job', + '#part-handler' : 'text/part-handler' } # if 'str' is compressed return decompressed otherwise return it -- cgit v1.2.3