Details
-
Type:
Bug
-
Status: Open
-
Priority:
Low
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Built-in functions
-
Labels:None
Description
When combining usage of the format("%S, mylist) function with difference(), it produces a string -empty-list- that is likely a internal placeholder.
The list does not show this placeholder when iterated over nor when using the join() function.
Manual test case attached and below, with output.
<pre>
body common control
{
bundlesequence =>
;
}
bundle agent test
{
vars:
"a" slist =>
"b" slist => { ".", ".." };
"diff_between_a_and_b" slist => difference(a, b);
"a_str" string => format("%S", a);
"b_str" string => format("%S", b);
"diff_str_format" string => format("%S", diff_between_a_and_b);
"diff_str_join" string => join( ",", diff_between_a_and_b);
reports:
agent::
"a: $(a_str)";
"b: $(b_str)";
"diff from format: $(diff_str_format)";
"diff from join: $(diff_str_join)";
"diff item: $(diff_between_a_and_b)";
}
</pre>
<pre>
[root@node001 tmp]# cf-agent -K test.cf
R: a: { "test", ".", "item", ".." }
R: b:
{ ".", ".." }R: diff from format:
{ --empty-list--, "test", "item" }R: diff from join: test,item
R: diff item: test
R: diff item: item
</pre>