| Facter 4 introduced compositive fact structuring via dot-notation as a feature. However, the dot-notation implementation used is incomplete, and behaves differently from dot-notation elsewhere in the ecosystem. Specifically, Facter 4 dot-notation splits key segments incorrectly, because it does not recognize the use of double or single quotes to indicate keys which contain literal dot characters. The reference implementation for dot-notation is found in Puppet, here. Today's behavior Consider the following plain-text custom fact file:
foo.bar.one=1 |
foo.bar.two=2 |
foo."I.Have.Dots"=3 |
"me.too"=4
|
Today, Facter returns the following for these facts.
{ |
"foo": { |
"bar": { |
"one": "1", |
"two": "2" |
}, |
"\"i": { |
"have": { |
"dots\"": "3" |
} |
} |
}, |
"\"foo": { |
"too\"": "4" |
} |
}
|
This is incorrect. Correct behavior Full and correct support for dot-notation SHOULD give:
{ |
"foo": { |
"bar": { |
"one": "1", |
"two": "2" |
}, |
"i.have.dots": "3" |
}, |
"me.too": "4" |
}
|
|