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

maparray function produce empty list

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.0
    • Component/s: Built-in functions
    • Labels:
      None
    • Platform:
      Linux
    • Found in version (details):
      3.6.0rc.59ca863

      Description

      Hello,
      This is created from discussion https://groups.google.com/forum/#!topic/help-cfengine/sI_mfW4EYJo (undefined bundle in 3.6 beta2).

      Bellow code produce different outputs between 3.5.3 and 3.6.0rc. The lists inputs_services and inputs_services2 are equivalent only in 3.5.3 release.
      <pre>
      bundle common global {
      vars:
      any::
      "bundles[services][afs]" slist =>

      { "afs.cf" }

      ;
      "bundles[services][base]" slist =>

      { "base.cf" }

      ;

      "inputs_services" slist => maparray("services/$(this.k)/$(this.v)", "bundles[services]");
      "inputs_services2" slist =>

      {"services/afs/afs.cf", "services/base/base.cf"}

      ;
      }

      bundle agent test {
      reports:
      any::
      "inputs_services $(global.inputs_services)";
      "inputs_services2 $(global.inputs_services2)";
      }

      body common control
      {
      bundlesequence =>

      { "global", "test" }

      ;
      }
      </pre>
      Output from release candidate version:
      <pre>

      1. cf-agent -V ; cf-agent -Kf ./promises.cf
        CFEngine Core 3.6.0rc.59ca863
        R: inputs_services2 services/afs/afs.cf
        R: inputs_services2 services/base/base.cf

      </pre>
      And after rollback to stable version:
      <pre>

      1. cf-agent -V ; cf-agent -Kf ./promises.cf
        CFEngine Core 3.5.3
        2014-04-10T23:55:14+0200 notice: R: inputs_services services/afs/afs.cf
        2014-04-10T23:55:14+0200 notice: R: inputs_services services/base/base.cf
        2014-04-10T23:55:14+0200 notice: R: inputs_services2 services/afs/afs.cf
        2014-04-10T23:55:14+0200 notice: R: inputs_services2 services/base/base.cf
        </pre>

        Attachments

          Activity

            People

            • Assignee:
              a10025 Volker Hilsheimer (Inactive)
              Reporter:
              svamberg Michal Švamberg
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Summary Panel