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

Variable references in context line override "if" attribute

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: (None)
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: cf-agent
    • Labels:
      None
    • Found in version (details):
      3.12.2

      Description

      I came across this by accident and a quick test seems to confirm my diagnosis that this is a bug in how variables in context lines are handled.

      # cf-agent -V
      CFEngine Core 3.12.2
      CFEngine Enterprise 3.12.2
      # cat bug.cf
      bundle agent main {
        vars:
          any::
            "myclassname"
              string => "any";
      
        reports:
          "$(myclassname)"::
            "This should NOT be shown"
              if => "this_class_is_not_set";
      
          any::
            "This one will actually not be shown"
              if => "this_class_is_not_set";
      }
      # cf-agent -KIC -f ./bug.cf
      R: This should NOT be shown
      #
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mweilgart Mike Weilgart
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Summary Panel