[ubuntu-cloud] Fwd: #part-handler

Scott Moser smoser at ubuntu.com
Wed Feb 13 00:16:13 UTC 2013

On Mon, 11 Feb 2013, Bo Shi wrote:

> Hi Folks,
> Is there a way to ensure that a particular custom part-handler is run
> as the very last component to execute?

In multipart input, part-handlers
 * the method 'handle_part' with signature (data,ctype,filename,payload)
   is the handler
 * execute the handler initialization (cdata=__begin__) in the order they
   are found,
 * replace any existing handlers for the types they claim
 * will immediately start handling any subsequent parts of the
   type they're registered for.
 * have handle_part called with cdata='__end__' called in undefined order
   after all user-data content has been handled.

> We use EC2 UserData (augmented via Ubuntu's CloudInit) to install
> dependencies and have a relatively generic script to invoke
> ec2-bundle-vol.  Due to us not being terribly sophisticated in
> controlling the part execution order of our multi-part UserData, we're
> somewhat constrained on the CloudInit features we can use.  It would
> be straightforward to convert it to a part-handler plugin but, of
> course, this particular handler would have to execute last.

So, I'm kind of confused as to what "execute last" means here.
Where you wanting defined execution order of the handle_part with

To control order in which user-data is processed you should just need to
control the order in which it is created.

Does that make sense?

More information about the Ubuntu-cloud mailing list