On 04/02/2012 04:58 PM, Aleksey Tsalolikhin wrote:
> Dear Nick,
>
> Yes, it's a single promise, but remember, the promiser can affect
> multiple objects.
<snip>
> cf3> -> Handling file existence constraints on /tmp/etc/warnquota.conf
> ...
> cf3> -> Handling file existence constraints on /tmp/etc/nscd.conf
> ...
> cf3> -> Handling file existence constraints on /tmp/etc/syslog.conf
<snip>
Yeah, your right, here is a contrived example. Using a regex inside the
promiser it operated on multiple files.
mkdir -p /tmp/etc
touch /tmp/etc/{5,6,7}.conf
cf-agent -KIf ./test_pcre_promiser.cf -> Object /tmp/etc/6.conf had
permission 644, changed it to 222
-> Object /tmp/etc/5.conf had permission 644, changed it to 222
-> Object /tmp/etc/7.conf had permission 644, changed it to 222
-> Object /tmp/etc/7.conf had permission 644, changed it to 222
I didn't use the pathtype attribute in mine, but it still found the
files using the regular expression "/tmp/etc/.*\.conf". I hadn't seen
that attribute previously. Thanks Aleksey! you learn something new every
day.
I would say it seems like a bug.
--
Nick Anderson <[email protected]>
body common control {
bundlesequence => {
"main",
};
inputs => {
"cfengine_stdlib.cf",
};
}
bundle agent main {
files:
"/tmp/etc/.*\.conf"
perms => m("222");
}
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine