Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-2108

Add a this.callers_promisers variable to identify current execution context

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Done
    • Priority: (None)
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.9.0
    • Component/s: Promise type: methods
    • Labels:
      None

      Description

      With methods, we can re-utilize common configuration pieces from different places. But it is currently impossible to identify, within the called bundle, what is the
      context of the call, and hence difficult to produce meaningful logs or reporting, particularly when bundles are called with the same arguments.

      A way to make it possible to know the context would be to create a new context variable, for example called this.callers_promisers, which would be a list of the parents promisers of the current bundle.

      This way we can use the full call stack to identify uniquely the current action.

      The attached code shows an example of this feature.

        Attachments

          Activity

            People

            • Assignee:
              a10053 Marcin Pasinski
              Reporter:
              amousset Alexis Mousset
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Summary Panel