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

Introudce simplerer version of scoped_classes_generic



    • Type: Task
    • Status: Done
    • Priority: Low
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.7.2
    • Component/s: None
    • Labels:


      scoped_classes_generic is kind of hard to understand based on its name. It really means that it generates classes based on the outcome. Additionally it defines both prefix and suffix varieties. For simplicity it should define a minimal number of classes.

      all other classes bodies in the stdlib should be updated with documentation recommending using this new classes body.

      body classes results(scope, class_prefix)

      1. @brief Define classes prefixed with `class_prefix` and suffixed
      2. with appropriate outcomes {_kept, _repaired, _not_kept, _error,
      3. _failed, _denied, _timeout, _reached }
      4. *See also:* `scope`
      5. @param scope The scope in which the class should be defined
      6. @param class_prefix The unique part of the classes to be defined
      7. *Suffix Notes:*
      8. * _reached indicates the promise was tried. Any outcome will
      9. result in a class with this suffix being defined.
      10. * _kept indicates some aspect of the promise was kept
      11. * _repaired indicates some aspect of the promise was repaired
      12. * _not_kept indicates some aspect of the promise was not kept.
      13. error, failed, denied and timeout outcomes will result in a
      14. class with this suffix being defined
      15. * _error indicates the promise errored
      16. * _failed indicates the promise failed
      17. * _denided indicates the promsie was denied
      18. * _timeout indicates the promise timed out

      scope => "$(scope)";

      promise_kept =>

      { "$(class_prefix)_reached", "$(class_prefix)_kept" }

      promise_repaired =>

      { "$(class_prefix)_reached", "$(class_prefix)_repaired" }

      repair_failed =>

      { "$(class_prefix)_reached", "$(class_prefix)_error", "$(class_prefix)_not_kept", "$(class_prefix)_failed" }

      repair_denied =>

      { "$(class_prefix)_reached", "$(class_prefix)_error", "$(class_prefix)_not_kept", "$(class_prefix)_denied" }

      repair_timeout =>

      { "$(class_prefix)_reached", "$(class_prefix)_error", "$(class_prefix)_not_kept", "$(class_prefix)_timeout" }





            • Assignee:
              a10042 Nick Anderson
              a10042 Nick Anderson
            • Votes:
              0 Vote for this issue
              5 Start watching this issue


              • Created:

                Summary Panel