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

document convergence order better to avoid user surprises

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Low
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Documentation
    • Labels:
      None
    • Found in version (details):
      3.5.1-3,3.5.2

      Description

      There seems to be some internal evaluation ordering problem.

      Take the following code:

      <pre>
      body common control {
      bundlesequence =>

      { "test_config" };
      }

      bundle common test_config {

      classes:
      "should_be_unrelated_but_isnt" expression => "any";

      vars:

      any::
      "my_string" string => "This value is wrong!",
      policy => "free";

      "my_string" string => execresult("/bin/echo -n 'This value is right'", "noshell"),
      policy => "free";

      reports:
      "my_string: $(my_string)";
      }
      </pre>

      What I expect to get:
      <pre>
      2013-08-29T17:23:41-0700 notice: R: my_string: This value is right
      </pre>

      What I actually get:
      <pre>
      2013-08-29T17:23:49-0700 notice: R: my_string: This value is wrong!
      </pre>

      Oddly, if you comment out the "classes" section, it works as expected:
      <pre>
      body common control {
      bundlesequence => { "test_config" }

      ;
      }

      bundle common test_config {

      1. classes:
      2. "should_be_unrelated_but_isnt" expression => "any";

      vars:

      any::
      "my_string" string => "This value is wrong!",
      policy => "free";

      "my_string" string => execresult("/bin/echo -n 'This value is right'", "noshell"),
      policy => "free";

      reports:
      "my_string: $(my_string)";
      }
      </pre>

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                a10042 Nick Anderson
                Reporter:
                chrishiestand Chris Hiestand
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Summary Panel