... to avoid redundant parsing of json content from a given string.
This also allows us to add more strict validation later using Struct
data type.
Change-Id: I2a8bbd266d5e97a06b89c131bbd86e3710a68923
The uriescape function from puppetlabs-stdlib is no longer functional
in Puppet 8, because the URI.escape, which is internally used by that
function, is no longer available in Ruby 3+.
This replaces the function by own function to avoid the failure in
Puppet 8.
Closes-Bug: #2057860
Change-Id: I7b4db4c1e64416e20d8470cbff0b8497c6a0cfc9
JSON does not allow usage of single quotes and require double quotes.
We have been converting single quotes to support such invalid usage but
that was deprecated a long ago[1].
This also simplifies the logic to handle aliases. Using undef results
in the value set to service default fact.
[1] 1cd349f893408803fec307f615ae3fe265d54fed
Change-Id: If1328531f33a9fe778091ce38b5c1f8072b473b8