On Thu, 22 Jul 2010, Keith Mitchell wrote:
Couple quick nits... On 07/22/10 04:33 PM, Alok Aggarwal wrote:The most recent version of the DC design doc specifies user defined checkpoints as follows: <execution stop_on_error="false"> <checkpoint name="custom-script" mod_path="custom_script" checkpoint_class="CustomScript"> <args>/usr/bin/myscript.sh arg1 arg2</args> </checkpoint> </execution> As was pointed out in this morning's meeting, this has the downside of not allowing for a way to specify arguments to myscript.sh that get reside in the DOC. So, I'm enhancing my proposal based on some conversations with Darren and Keith. For arguments that need to be referenced from the DOC, allow XPATH style argument specification. So, if the 'distro_name' element needs to be referenced from the DOC, the args to myscript.sh would be specified as - %{/doc/volatile/dc_spec/distro_name} Or, simply, %{/*/distro_name}Perhaps we should avoid the asterisk as its a special character. %{//distro_name} (double slash instead of single slash) The above format is more closely similar to xpath style, as well.
That works too and I like it a little better than '*'.
Anytime, the CustomScript checkpoint sees a %{ .. }, it will perform a substitution based on a call to the DOC.So, the above two specifications will respectively map to: doc.volatile.get_children(name=distro_name) and doc.get_descendents(name=distro_name) If a user wants to reference a more specific attribute, it can be specified as follows - %{/doc/volatile/n...@attribute} and this will get substituted to the appropriate DOC call and object.__dict__['attribute'] referenced.When you get to implementation time, you'll want to use "getattr" instead of going directly to the __dict__ object.
Sure. Thanks, Alok _______________________________________________ caiman-discuss mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/caiman-discuss

