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

programming error trying to double expand namespaced variable

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: High
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      <pre>
      > $ cf-agent -KIf /tmp/double_dereference_variablesmatching.cf -b init,check -DDEBUG
      2015-06-10T13:50:24-0500 info: Using command line specified bundlesequence
      expand.c:862: Programming Error: Couldn't find extracted variable 'default*check#default*init#myvar
      </pre>

      <pre>
      bundle agent init

      { vars: "myvar" string => "myvalue"; }

      bundle agent check
      {
      vars:
      "found_vars" slist => variablesmatching(".*myvar");

      classes:
      "double_deref_ok" expression => strcmp("$($(found_vars))", "myvalue");
      "direct_deref_ok" expression => strcmp("$(default:init.myvar)", "myvalue");
      "ok" and =>

      { "double_deref_ok", "direct_deref_ok" }

      ;

      reports:
      DEBUG::

      1. I should be able to report on found vars
        "Found Var: $(found_vars)";
      1. I should be able to directly dereference the variable i expect to find
        "direct_deref: $(const.dollar)(default:init.myvar) = $(default:init.myvar)";
      1. I should be able to dereference the found vars to get their values
        "double_deref: $(const.dollar)($(const.dollar)(found_vars)) = $($(found_vars))";

      ok::
      "$(this.promise_filename) Pass";
      !ok::
      "$(this.promise_filename) FAILED";
      }
      </pre>

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                a10003 Eystein Maloy Stenberg
                Reporter:
                a10042 Nick Anderson
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Summary Panel