Alsoif we have add the aggregate method with just an int, when calling fact.value, facter 3 prints --json or --yaml option the value twice output on facter 2.5.7 and make a fact that aggregates two values:
and print the fact without any option and with --yaml and --json the only difference between facter 3 and 4 is how float numbers are printed with the yaml option:
On facter 3:
fact: 1135.015625
Facter 4:
fact: "1102.89"
The rest is the same. Facter 2 can't even solve the fact.
When printing hash values, everything works the same and no aggregate function is used.
When printing arrays there's a spacing difference when using the --yaml option:
Facter 3:
fact: - value 1 - value 2
Facter 4:
fact: - value 1 - value 2
Facter 2.5.7 and facter 4 are unable to solve aggregate custom facts, if they are written with chunks: {code:java} chunk/fact = Facter::Util::Fact.new('fact') fact.define_resolution('hgy', type:chunk1 :aggregate) do
chunk(:physical_memory) do ['value 1'] end
chunk(:chunk2virtual_memory) do
['value 2'] end end and no aggregate function is usedfact.value/ code placeholder {code}
fact.value on facter 3 yields:
value 1
value 2
[
"value 1",
"value 2"
]
facter 4 and 2.5.7 gives: give nil.
value 1
value 2
Also if we add the when a fact can't be resolved and --json or --yaml option is used the output on facter 2.5.7 and make a fact that aggregates two values outputs are:
{ "fact": null }
On facterFacter 3 and 4 is:
1097.8
{ "fact": null } ""
On facter 3 isFacter 2.5.7:
1071.6171875--- { "fact": 1071.6171875 }
When the chunks are hashes and we use the --yaml optionjson is used: