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

No way to use an "and" expression in augments classes

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Priority: (None)
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.14.0, 3.12.2
    • Component/s: None
    • Labels:
      None
    • Story Points:
      0

      Description

      Per the documentation on how classes can be set in augments (def.json), the following snippet:

      "classes":
      {
        "my_other_apache": [ "server[34]", "debian.*" ],
      }
      

      will set the "my_other_apache" class if ANY of the following are true:

      • Either or both of the classes "server3" and "server4" are set, OR
      • A class is set that begins with "debian".

      Of course, the same thing could be accomplished with the single regex "server[34]|debian.*"

      However, try to set a class based on more than one other class—that is, based on an AND expression—and you'll find it's not possible based on the documentation. This isn't explicitly mentioned.

      Is this an intentional limitation? Was there discussion about this during the design phase? (If so, I would like a link pointing me to that discussion, please.)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                a10042 Nick Anderson
                Reporter:
                mweilgart Mike Weilgart
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: