Chris, I don't think this is possible. Are you mixing up two versions? M
Faehl, Chris wrote: > Mark, > > From svn, cf-promises now validates the input file correctly - but cf-agent > evaluates using the pre-change semantics (fails just as cf-promises did). > > -- > Chris Faehl > Hosting Engineering Systems Manager, RightNow Technologies > > > -----Original Message----- > From: Mark Burgess [mailto:mark.burg...@iu.hio.no] > Sent: Wednesday, May 06, 2009 11:22 AM > To: Faehl, Chris > Cc: bug-cfengine@cfengine.org > Subject: Re: cf3: incorrect parsing or misdocumented > file_select.search_owners attribute > > > Ok - I've thought about this now. Please try svn and tell me if it > works as expected. > > M > > Faehl, Chris wrote: >> Using cfengine 3.0.1 and cfengine 3 svn 328: >> Objective: find unowned files and assign them a default owner. >> Problem: search_owners doesn't seem to really accept regexes, as documented >> examples suggest. Search_groups suffers this same malady. It's difficult to >> see how the required objective could be met without at least working >> character classes and the "+" operator. >> >> Test case: >> body common control { >> bundlesequence => { "s" }; >> } >> bundle agent s { >> files: >> "/" >> file_select => noowner, >> perms => pnoowner, >> action => warn; >> } >> >> body file_select noowner { >> search_owners => { "[a-zA-Z0-9_.]+" }; >> file_result => "!owner"; >> } >> >> body action warn{ >> action_policy => "warn"; >> } >> >> body perms pnoowner { >> owners => { "root" }; >> groups => { "root" }; >> } >> >> >> Cf-promises -v -f ./test7.cf: >> . >> . >> . >> cf3 > Parsing file ./test7.cf >> cf3:./test7.cf:13,38: Scalar item in search_owners => { [a-zA-Z0-9_.]+ } in >> rvalue is out of bounds (value should match pattern [a-zA-Z0-9_$.-]+), near >> token '}' >> . >> . >> . >> >> >> Cf-promises -d2 -f ./test7.cf: >> . >> . >> . >> ------------------------------------------------ >> - Checking inline constraint/arg file_select[(ext body)] => mappedval >> (bundle/body) >> ------------------------------------------------ >> Nothing to check for body reference >> end CheckConstraintTypeMatch--------- >> Post Check Constraint files: search_owners => {'[a-zA-Z0-9_.]+'} >> ------------------------------------------------ >> - Checking inline constraint/arg search_owners[slist] => mappedval (l) >> [a-zA-Z0-9_$.-]+ >> ------------------------------------------------ >> ------------------------------------------------ >> - Checking inline constraint/arg search_owners[slist] => mappedval (s) >> [a-zA-Z0-9_$.-]+ >> ------------------------------------------------ >> >> CheckParseString(search_owners => [a-zA-Z0-9_.]+/[a-zA-Z0-9_$.-]+) >> Deleting scope match >> Object match exists >> Adding scope data match >> Regex [a-zA-Z0-9_$.-]+ did not match ([a-zA-Z0-9_.]+) exactly, but it >> matched a part of it. >> IsCf3VarString([a-zA-Z0-9_.]+) - syntax verify >> Found 0 variables in ([a-zA-Z0-9_.]+) >> Validation: Scalar item in search_owners => { [a-zA-Z0-9_.]+ } in rvalue is >> out of bounds (value should match pattern [a-zA-Z0-9_$.-]+) >> end CheckConstraintTypeMatch--------- >> Post Check Constraint files: file_result =>!owner >> . >> . >> . >> -- >> Chris Faehl >> Hosting Engineering Systems Manager, RightNow Technologies >> >> _______________________________________________ >> Bug-cfengine mailing list >> Bug-cfengine@cfengine.org >> https://cfengine.org/mailman/listinfo/bug-cfengine > -- Mark Burgess ------------------------------------------------- Professor of Network and System Administration Oslo University College, Norway Personal Web: http://www.iu.hio.no/~mark Office Telf : +47 22453272 ------------------------------------------------- _______________________________________________ Bug-cfengine mailing list Bug-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/bug-cfengine