You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Puppet::Pops::Lookup::ModuleDataProvider#validate_data_hash is a method
that is supposed to prune a data hash of any keys that are not prefixed
with a given module's name. However prior to this commit it incorrectly
took the data hash, cloned it, operated on the clone, then returned the
unchanged original hash.
This commit updates validate_data_hash to instead return the modified
hash, and updates the warning message generated when a key is pruned to
include the key.
expect(warnings).toinclude("Module 'bad_data': Value returned from deprecated API function 'bad_data::data' must use keys qualified with the name of the module")
380
+
expect(warnings).toinclude("Module 'bad_data': Value returned from deprecated API function 'bad_data::data' must use keys qualified with the name of the module; got b")
381
381
end
382
382
383
383
it'will succeed finding prefixed keys even when a key in the function provided module data is not prefixed'do
expect(warnings).toinclude("Module 'bad_data': Value returned from deprecated API function 'bad_data::data' must use keys qualified with the name of the module")
394
+
expect(warnings).toinclude("Module 'bad_data': Value returned from deprecated API function 'bad_data::data' must use keys qualified with the name of the module; got b")
395
395
end
396
396
397
397
it'will resolve global, environment, and module correctly'do
expect(warnings).toinclude("Module 'bad_data': Value returned from deprecated API function 'bad_data::data' must use keys qualified with the name of the module")
expect(warnings).toinclude("Module 'bad_data': Value returned from deprecated API function 'bad_data::data' must use keys qualified with the name of the module; got b")
427
427
end
428
428
429
429
it'a warning will be logged when key in the hiera provided module data is not prefixed'do
expect(warnings).toinclude("Module 'hieraprovider': Value returned from data_hash function 'json_data', when using location '#{environmentpath}/production/modules/hieraprovider/data/first.json', must use keys qualified with the name of the module")
expect(warnings).toinclude("Module 'hieraprovider': Value returned from data_hash function 'json_data', when using location '#{environmentpath}/production/modules/hieraprovider/data/first.json', must use keys qualified with the name of the module; got test::param_b")
0 commit comments