Re: Problems while upgrading to latest cfengine-community LTS
Berthold Cogel <[email protected]> Tue, 23 Dec 2025 12:01:51 +0100
| Newsgroups | gmane.comp.sysutils.cfengine.general |
|---|---|
| Message-ID | <[email protected]> |
Am 28.10.25 um 12:33 schrieb Berthold Cogel:
> Am 21.10.25 um 16:35 schrieb Nick Anderson:
>> Hi Berthold,
>>
>> Thanks for letting us know.
>>
>> Can you please make a self contained policy that reproduces the
>> behavior? I don't recall any changes to the difference() function in
>> the recent past. If there is an unintended behavior change here there
>> is little time to address it before the next release.
>>
>>
>
> Hello Nick,
>
> until now I wasn't able to reproduce the problem with a separate script
> in an isolated environment. I think I'm still missing something. Perhaps
> I have to rebuild the complete directory structure of our setup.
>
> Regards
> Berthold Cogel
>
Hello Nick,
I was wondering why my last post remained unanswered and have now tested
with cfengine 3.24.3. In doing so, I realized that I accidentally posted
the wrong version of the script last time.
Sorry for the noise!
Here is the correct version with the results for versions 3.21.8 and
3.24.3:
In our script we use this lines:
"dirs_found" slist => findfiles("$(constants.conf_dir)/*/");
"dirs_expected" slist => { maplist("$(constants.conf_dir)/$(this)/",
@(file_list) ), "$(constants.conf_dir)host_config"};
------------:<-------------
body common control
{
bundlesequence => { "test" };
}
bundle agent test {
vars:
"test_dir" string => "/tmp/diff_test";
"file_list" slist => { "a", "b", "c", "d", "e", "f", "g", "x", "z" };
"dirs_found" slist => findfiles("$(test_dir)/*/");
"dirs2_found" slist => findfiles("$(test_dir)/*");
"dirs_expected" slist => { maplist("$(test_dir)/$(this)/",
@(file_list) ), "$(test_dir)/host_config"};
"dirs_diff" slist => difference(dirs_found, dirs_expected);
"dirs2_diff" slist => difference(dirs2_found, dirs_expected);
reports:
"version: $(sys.cf_version)";
"found: $(dirs_found)";
"found2: $(dirs2_found)";
"expected: $(dirs_expected)";
"diff: $(dirs_diff)";
"diff2: $(dirs2_diff)";
}
------------:<-------------
R: version: 3.21.8
R: found: /tmp/diff_test/a/
R: found: /tmp/diff_test/b/
R: found: /tmp/diff_test/c/
R: found: /tmp/diff_test/d/
R: found: /tmp/diff_test/e/
R: found: /tmp/diff_test/f/
R: found: /tmp/diff_test/g/
R: found: /tmp/diff_test/x/
R: found: /tmp/diff_test/z/
R: found2: /tmp/diff_test/a
R: found2: /tmp/diff_test/b
R: found2: /tmp/diff_test/c
R: found2: /tmp/diff_test/d
R: found2: /tmp/diff_test/e
R: found2: /tmp/diff_test/f
R: found2: /tmp/diff_test/g
R: found2: /tmp/diff_test/x
R: found2: /tmp/diff_test/z
R: expected: /tmp/diff_test/a/
R: expected: /tmp/diff_test/b/
R: expected: /tmp/diff_test/c/
R: expected: /tmp/diff_test/d/
R: expected: /tmp/diff_test/e/
R: expected: /tmp/diff_test/f/
R: expected: /tmp/diff_test/g/
R: expected: /tmp/diff_test/x/
R: expected: /tmp/diff_test/z/
R: expected: /tmp/diff_test/host_config
R: diff2: /tmp/diff_test/a
R: diff2: /tmp/diff_test/b
R: diff2: /tmp/diff_test/c
R: diff2: /tmp/diff_test/d
R: diff2: /tmp/diff_test/e
R: diff2: /tmp/diff_test/f
R: diff2: /tmp/diff_test/g
R: diff2: /tmp/diff_test/x
R: diff2: /tmp/diff_test/z
------------:<-------------
R: version: 3.24.3
R: found: /tmp/diff_test/a
R: found: /tmp/diff_test/b
R: found: /tmp/diff_test/c
R: found: /tmp/diff_test/d
R: found: /tmp/diff_test/e
R: found: /tmp/diff_test/f
R: found: /tmp/diff_test/g
R: found: /tmp/diff_test/x
R: found: /tmp/diff_test/z
R: found2: /tmp/diff_test/a
R: found2: /tmp/diff_test/b
R: found2: /tmp/diff_test/c
R: found2: /tmp/diff_test/d
R: found2: /tmp/diff_test/e
R: found2: /tmp/diff_test/f
R: found2: /tmp/diff_test/g
R: found2: /tmp/diff_test/x
R: found2: /tmp/diff_test/z
R: expected: /tmp/diff_test/a/
R: expected: /tmp/diff_test/b/
R: expected: /tmp/diff_test/c/
R: expected: /tmp/diff_test/d/
R: expected: /tmp/diff_test/e/
R: expected: /tmp/diff_test/f/
R: expected: /tmp/diff_test/g/
R: expected: /tmp/diff_test/x/
R: expected: /tmp/diff_test/z/
R: expected: /tmp/diff_test/host_config
R: diff: /tmp/diff_test/a
R: diff: /tmp/diff_test/b
R: diff: /tmp/diff_test/c
R: diff: /tmp/diff_test/d
R: diff: /tmp/diff_test/e
R: diff: /tmp/diff_test/f
R: diff: /tmp/diff_test/g
R: diff: /tmp/diff_test/x
R: diff: /tmp/diff_test/z
R: diff2: /tmp/diff_test/a
R: diff2: /tmp/diff_test/b
R: diff2: /tmp/diff_test/c
R: diff2: /tmp/diff_test/d
R: diff2: /tmp/diff_test/e
R: diff2: /tmp/diff_test/f
R: diff2: /tmp/diff_test/g
R: diff2: /tmp/diff_test/x
R: diff2: /tmp/diff_test/z
------------:<-------------
If the new behavior is desired, I would be grateful for any information
regarding the necessary changes to our scripts.
Regards
Berthold Cogel
--
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 visit https://groups.google.com/d/msgid/help-cfengine/a73daed0-c2b2-4ae2-80e2-94330108a209%40uni-koeln.de.