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

unless is inconsistent when there are unresolved variables

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Done
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.15.0
    • Component/s: None
    • Labels:
      None

      Description

      Because of some mistakes / bugs in the code, we ended up in a place where unless is inconsistent:

      This is fine, the promise will be evaluated:

      bundle agent main
      {
        vars:
          "a"
            string => "value",
            unless => "$(no_such_var)";
      }
      

      This is not fine, the promise will cause a fatal error:

      bundle agent main
      {
        vars:
          "a"
            string => "value",
            unless => isvariable("$(no_such_var)");
      }
      

      Based on the discussion in this ticket:

      https://tracker.mender.io/browse/CFE-2689

      We agreed to keep this error message, for now, but it might be appropriate to remove the error so the 2 cases are consistent in this edge case.

      This ticket discusses the bigger problem:

      https://tracker.mender.io/browse/CFE-3160

      Some users thought it was better to keep this policy not allowed (using fatal error) until that bigger long term change is done.

        Attachments

          Release management

            Issue Links

              Activity

                People

                Assignee:
                olehermanse Ole Herman Schumacher Elgesem
                Reporter:
                olehermanse Ole Herman Schumacher Elgesem
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: