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

be clear about how class guards are "sticky"

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Done
    • Priority: (None)
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.18.2, 3.15.6, 3.20.0
    • Component/s: Documentation
    • Labels:
      None
    • Story Points:
      0

      Description

      Looking at the docs here: https://docs.cfengine.com/docs/3.18/reference-language-concepts-classes.html

      I don't see anything that makes it clear that a class guard "sticks" until another one is present.

      Consider this policy, run with cf-agent -KIf ./test.cf or cf-agent -KIf ./test.cf -Dfoo

      bundle agent main
      {
        reports:
          "hi";
          foo::
            "foo 1";
          "foo 2";
          any::
            "any!";
      }
      

      And see that the foo class guard persists for two promises "foo 1" and "foo 2".

      Also note and maybe we can remind folks that indentation doesn't matter. The above policy could just as easily be (and works)

      bundle agent main
      {
        reports: "hi"; foo:: "foo 1"; "foo 2"; any:: "any";
      }
      

      But maybe that's another ticket

        Attachments

          Activity

            People

            Assignee:
            a10042 Nick Anderson
            Reporter:
            craig.comstock Craig Comstock
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: