classfiltercsv: filtering only works on bundle level
Xander Cage <[email protected]>
| Newsgroups | gmane.comp.sysutils.cfengine.general |
|---|---|
| Message-ID | <[email protected]> |
seems that the classes filter only works if the data and filter classes are
in the same bundle. i want to use the data container as a somewhat "global"
variable without repeating it in any bundle that uses it.
for example:
bundle agent parent_bundle
{
classes:
#"weirdos";
#"twats";
#"zombie";
#"amlinz";
vars:
"data_file" string => "/root/cfe_testbed/users.csv";
"d" data => classfiltercsv($(data_file), "true", 0);
"keys_unsorted" slist => getindices("d");
"keys" slist => sort(keys_unsorted, "lex");
#"users_$(keys)" data => mergedata("d[$(keys)]");
methods:
"call_child" usebundle => child_bundle(@(d), $(keys)),
handle => "remove_it";
}
bundle agent child_bundle (info, idx) {
classes:
# filtering class to get only the relevant data for this bundle,
seems the natural way #to do it,
# but does not work
"zombie";
vars:
"names" slist => getvalues("info[$(idx)][name]");
"names_str" string => format("%S", names);
methods:
"call_check_user" usebundle => check_user("$(names_str)");
}
--
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/help-cfengine/177b2f07-44b3-43c3-9b6e-cf1cb9f16838n%40googlegroups.com.