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

cf-promsies should generate an error and return nonzero when classes type promises do not have constraints

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Rejected
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Evaluation
    • Labels:
      None

      Description

      Classes type promises are required to use one of the following attributes:

      • and
      • dist
      • expression
      • or
      • not
      • select_class
      • xor

      Consider this example policy:

      <pre>
      bundle agent test
      {
      classes:
      "my_class"
      scope => "namespace",
      meta =>

      { "inventory", "attribute_name=Something" }

      ;

      reports:
      my_class::
      "Hai everybody!";
      }
      </pre>

      When I run @cf-promises -f ./class_test.cf@ I get no error.

      However if I run @cf-agent -KIf ./class_test.cf -b test@ I get errors.

      <pre>
      2015-06-24T08:13:00-0500 info: Using command line specified bundlesequence
      2015-06-24T08:13:00-0500 error: /default/test/classes/'my_class'[0]: No constraints for class promise 'my_class'
      2015-06-24T08:13:00-0500 error: /default/test/classes/'my_class'[0]: No constraints for class promise 'my_class'
      2015-06-24T08:13:00-0500 error: /default/test/classes/'my_class'[0]: No constraints for class promise 'my_class'
      </pre>

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                a10003 Eystein Maloy Stenberg
                Reporter:
                a10042 Nick Anderson
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel