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

Broken nested variable evaluation is some cases

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: To Do
    • Priority: (None)
    • Resolution: Unresolved
    • Affects Version/s: 3.10.0b1
    • Fix Version/s: None
    • Component/s: Evaluation
    • Labels:
      None

      Description

      There is a breaking change in the evaluator behavior with nested variables in 3.10, which was found while running some ncf tests that use nested variables evaluation against 3.10.0b1. These tests use strings to build commands using shell command substitution, like "mycommand $(mysecondcommand ${myfile})", myfile being a CFEngine variable.

      The following code:

      bundle agent main {
      vars:
      "string1" string => "test1";
      
      reports:
      "$(test)";
      "$(test $(string1))";
      "$(test $(string2))";
      }
      

      3.7.4

      R: $(test)
      R: $(test test1)
      R: $(test $(string2))
      

      3.10b1

      R: $(test)
      

      3.13.0

      bundle agent main
      {
        vars:
            "string1" string => "test1";
      
        reports:
            "CFEngine $(sys.cf_version)";
            "$(test)";
            "$(test $(string1))";
            "$(test $(string2))";
      }
      
      R: CFEngine 3.13.0
      R: $(test)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              amousset Alexis Mousset
            • Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:

                Summary Panel