Hello,

Im hoping someone can help me here.  Im trying to make use of some
dynamically set classes in the reports section.  Below is a simplified
config demonstrating what im attempting to do.  The directory creation
works as expected.  however i never receive a report.

When the promise runs it appears as though the correct class is set


cf3>     .........................................................
cf3>     Promise handle:
cf3>     Promise made by: /tmp/test1
cf3>     .........................................................
cf3>
cf3>  -> Using literal pathtype for /tmp/test1
cf3>  -> File "/tmp/test1" exists as promised
cf3>  ?> defining promise result class _tmp_test1_ok
cf3>  -> Handling file existence constraints on /tmp/test1
cf3>  -> Handling file existence constraints on /tmp/test1
cf3>
cf3>     .........................................................
cf3>     Promise handle:
cf3>     Promise made by: /tmp/test2
cf3>     .........................................................
cf3>
cf3>  -> Using literal pathtype for /tmp/test2
cf3>  -> No mode was set, choose plain file default 600
cf3>  -> Created file /tmp/test2, mode = 600
cf3>  ?> defining promise result class _tmp_test2_fixed
cf3>  -> Handling file existence constraints on /tmp/test2

However when the process gets to the report section, the promise is
skipped with the following message

cf3> Skipping whole next promise (/tmp/test1 : ok), as var-context
_tmp_test1_ok is not relevant
cf3> Skipping whole next promise (/tmp/test2 : fixed), as var-context
_tmp_test2_fixed is not relevant

Full output here http://pastebin.com/qKG3ShiN

Any assistance is appreciated and please let me know if you need an
more information

============================================
body common control {
   bundlesequence  => { "test" };
}

bundle agent test {
   vars:
      "test_disks" slist => {
         "/tmp/test1",
         "/tmp/test2",
      };
   files:
     "$(test_disks)"
       create => "true",
       classes =>
kept_rep_err("$(test_disks)_ok","$(test_disks)_fixed","$(test_disks)_err");
   reports:
      "$(test_disks) : ok" ifvarclass => canonify("$(test_disks)_ok");
      "$(test_disks) : fixed" ifvarclass => canonify("$(test_disks)_fixed");
      "$(test_disks) : err" ifvarclass => canonify("$(test_disks)_err");
}
body classes kept_rep_err(kept,rep,fail) {
    promise_kept     => { "$(kept)" };
    promise_repaired => { "$(rep)" };
    repair_failed    => { "$(fail)" };
    repair_denied    => { "$(fail)" };
    repair_timeout   => { "$(fail)" };
}

=============================================
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to