Closed davidsandilands closed 1 year ago
When running PDK validate with auto correct the top scope facts check creates errors on its correction when using a fact hash, this can be seen by doing the following
1) Create the following manifest:
file { 'test_file' :content => file("example/etc/login.defs.${::operatingsystem}${::operatingsystemrelease}"), }
2) Run validate command:
pdk validate
3) Confirm legacy fact is detected
pdk (WARNING): puppet-lint: legacy fact (manifests/test.pp:2:60) pdk (WARNING): puppet-lint: legacy fact (manifests/test.pp:2:80)
4) Run autocorrect on the validation command:
pdk validate --auto-correct --puppet-version 7.9.0
5) Confirm legacy fact is updated with autocorrect
pdk (CORRECTED): puppet-lint: top scope fact instead of facts hash (manifests/test.pp:2:60) pdk (CORRECTED): puppet-lint: top scope fact instead of facts hash (manifests/test.pp:2:80)
When you then run pdk validate an error is thrown:
pdk (ERROR): puppet-syntax: Could not parse for environment production: Syntax error at 'os' (manifests/test.pp:2:76)
Sorry posted on wrong module
When running PDK validate with auto correct the top scope facts check creates errors on its correction when using a fact hash, this can be seen by doing the following
1) Create the following manifest:
2) Run validate command:
3) Confirm legacy fact is detected
4) Run autocorrect on the validation command:
5) Confirm legacy fact is updated with autocorrect
When you then run pdk validate an error is thrown: