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

use functions for any string in the CFEngine policy

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Done
    • Priority: (None)
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.11.0
    • Component/s: Evaluation
    • Labels:
      None

      Description

      I'd like to be able to say, for instance:

      commands:
        format("%s -KI %s", $(sys.cf_agent), $(file))
        contain => in_shell;
      
      reports:
        format("%s: %s = %s", $(this.bundle), $(x), $(y));
      

      ...using a string-returning function anywhere I can use a string (others: strftime, concat, join). Today I can do this by creating a temporary intermediate variable, so there is no technical impediment, it's just syntactic sugar. But it would make the policy language a bit easier to use, which is a good thing.

      Mailing list discussion: https://groups.google.com/d/msg/dev-cfengine/kDt0tAAcUis/VCbdhqBj4HcJ

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                a10003 Eystein Maloy Stenberg
                Reporter:
                jiraadmin Old User (Inactive)
              • Votes:
                3 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel