Scratch that theory. Given this test bundle:
bundle agent test {
vars:
"mylist" slist => { "foo", "bar" };
classes:
"$(mylist)" expression => regcmp(".*", "$(mylist)");
reports:
foo::
"class foo is set";
bar::
"class bar is set";
}
Here's the output:
R: class foo is set
R: class bar is set
But if I change agent to common:
!! Class identifier contains illegal characters
Promise (version not specified) belongs to bundle 'test' in file
'./test.example.cf' near line 17
!! Class identifier contains illegal characters
Promise (version not specified) belongs to bundle 'test' in file
'./test.example.cf' near line 17
!! Class identifier contains illegal characters
Promise (version not specified) belongs to bundle 'test' in file
'./test.example.cf' near line 17
!! Class identifier contains illegal characters
Promise (version not specified) belongs to bundle 'test' in file
'./test.example.cf' near line 17
!! Class identifier contains illegal characters
Promise (version not specified) belongs to bundle 'test' in file
'./test.example.cf' near line 17
!! Class identifier contains illegal characters
Promise (version not specified) belongs to bundle 'test' in file
'./test.example.cf' near line 17
R: class foo is set
R: class bar is set
-----Original Message-----
From: Justin Lloyd
Sent: Tuesday, March 16, 2010 2:24 PM
To: '[email protected]'; Ingersoll, Robert
Cc: [email protected]; [email protected]
Subject: RE: canonify promise_repaired
Neil,
I've been trying to do something similar and have a ticket open. However,
you're doing this in an agent bundle and I'm doing it in a common bundle, and
I'm told that the common bundles do the expansion differently from agent
bundles. Thus, moving my class creation into an agent bundle may not work as
suggested (I've not tested it yet), especially since agent bundles' classes are
not global like common classes are.
Justin
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of [email protected]
Sent: Tuesday, March 16, 2010 1:43 PM
To: Ingersoll, Robert
Cc: [email protected]; [email protected]
Subject: RE: canonify promise_repaired
I wonder if the following is related. I'm seeing this message:
R: WARNING: ^\s*dictionlist\s*=\s*/usr/share/dict/words\s* not found in
/etc/security/
user
!! Class identifier contains illegal characters
Promise (version not specified) belongs to bundle 'grepfile' in file
'/var/cfengine/in
puts/library.cf' near line 341
332 bundle agent grepfile(str, trg) {
333 # Search a file for a regular expression and warn if found.
334
335 vars:
336 "result" string => canonify("${str}_${trg}");
337 "file" string => canonify("${trg}");
338
339 classes:
340
341 "${file}" expression => fileexists("${trg}");
This suggests that the canonify at line 337 did not work. This is using
Community 3.0.4.
Sincerely,
--
Neil Watson
416-673-3465
This electronic communication and any attachments may contain confidential and
proprietary
information of DigitalGlobe, Inc. If you are not the intended recipient, or an
agent or employee
responsible for delivering this communication to the intended recipient, or if
you have received
this communication in error, please do not print, copy, retransmit, disseminate
or
otherwise use the information. Please indicate to the sender that you have
received this
communication in error, and delete the copy you received. DigitalGlobe reserves
the
right to monitor any electronic communication sent or received by its
employees, agents
or representatives.
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine