Greetings. It seems that when you pass in a parameter to a usebundle,
canonify can't handle it. Consider the following example.

bundle control common {
   bundlesquence = { "test" };
}

##

bundle agent test {

  vars:
    "test_files" slist => { "/etc/motd",
                               "/etc/resolv.conf",
                               "/etc/netsvc.conf"
                             };

   methods:
      "any" usebundle => test_func("$(test_files)");

}

##

bundle agent test_func(filename) {

  vars:

    "canon_filename" string => canonify("$(filename)");

  reports:
     Yr2009::
       "filename: $(filename)";
       "canon_filename: $(canon_filename)";

}


running the example:
cf3    =========================================================
cf3    reports in bundle drop_copy (2)
cf3    =========================================================
cf3
cf3
cf3     .........................................................
cf3     Promise by: filename: /etc/netsvc.conf
cf3     .........................................................
cf3
cf3 R: filename: /etc/netsvc.conf
cf3
cf3     .........................................................
cf3     Promise by: canon_filename: __filename_
cf3     .........................................................
cf3
cf3 R: canon_filename: __filename_
cf3 Method invoked successfully
cf3
cf3      +  Private classes augmented:
cf3
cf3      -  Private classes diminished:
cf3
cf3
cf3
_______________________________________________
Bug-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/bug-cfengine

Reply via email to