Currently, it's necessary to have a separate file to enable standalone policy execution and for policy to be included as part of a separate policy set.
- Why bundle agent main in standalone.cf instead of common control bundlesequence?: Because more flexible decision making at bundle level. This bundle isn't expected to be included in other policies, we would have name conflict. Same issue exists if we used body common control here instead.
It would be convenient to be able to specify a bundlesequence to be used based on the policy entry file. Implementing such a feature would remove the need for creating wrappers to enable standalone execution.
I propose that we introduce a new body file control attribute called bundlesequence.
bundlesequence in body file control defines the bundles to run if the file is the policy entry point ( $(this.promise_filename) is equal to $(sys.policy_entry_filename) ). This is similar to if _name_ = "++":= in python.
Instead of having a seperate standalone wrapper in the above example we could define a different bundlesequence to use if the policy is the entry. For example:
- Old behavior of bundlesequences and main bundles is exactly the same.
- Bundles called _main_ have special behavior
- If they are in entry point policy, they are defined as main (without underscores)
- If they are in other policy files, they will be removed before evaluation, so you can have multiple _main_ bundles in different files
- Because of the behavior above, you will get errors if you try to define multiple main bundles (with or without underscores).