CFEngine makes it easy to render JSON data. This is incredibly useful for coordinating and exchanging data with other systems. Sometimes, data provided to other systems needs to be constructed from multiple parts. When preparing a data container for rendering with mergedata() beware that the true and false values are special and will not be replaced by data containers of the same name.
- Bare values used in mergedata() try to expand a cfengine data container named for the bare word
- true and false are reserved bare values
This example illustrates how the true and false bare values are not expanded even when data containers matching those names exist.
|
|
R: CFEngine 3.14.0a.ed0158a8e
R: NOTE 'f' and 't' are expanded{"configured":true,"watch_out_for_false":{"Buckle":"Shoe","one":"two"},"watch_out_for_true":{"Shut":"Door","three":"four"}}
R: NOTE 'false' and 'true' are NOT expanded{"configured":true,"watch_out_for_false":false,"watch_out_for_true":true}