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

Variable value persisting from previous bundle run

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Rejected
    • Priority: (None)
    • Resolution: Done
    • Affects Version/s: 3.10.4, 3.12.0b1
    • Fix Version/s: None
    • Component/s: Evaluation
    • Labels:
      None
    • Found in version (details):
      Seen on 3.10.4 and present on master too

      Description

      When executing the following code:

      bundle agent main
      {
        methods:
          "method_call" usebundle => inter("the_first_param");
          "method_call" usebundle => inter("${doesnotexist}");
      }
      
      bundle agent inter(value)
      {
        vars:
          "test"  string => "${value}";
          "ctest" string => canonify("${value}");
      
        reports:
          "test:  ${value}:  ${test}";
          "ctest: ${value}:  ${ctest}";
      }
      
      

      I get:

      R: test:  the_first_param:  the_first_param
      R: ctest: the_first_param:  the_first_param
      R: test:  ${doesnotexist}:  ${doesnotexist}
      R: ctest: ${doesnotexist}:  the_first_param
      

      It looks like the output of canonify() persists from previous bundle execution when there is an unexpanded variable. This may have serious impact by mixing parameters from different bundle calls.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                a10042 Nick Anderson
                Reporter:
                amousset Alexis Mousset
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support

                    Summary Panel