|
puppetlabs_spec_helper provides a task named validate that now fails on modules containing plans. I have traced the calls this makes down and it seems that, in the end, each .pp file in a project that is not excluded manually via PuppetSyntax.exclude_paths is passed to puppet parser validate via the code below:
def validate_manifest(file)
|
Puppet[:parser] = 'future' if PuppetSyntax.future_parser and Puppet.version.to_i < 4
|
Puppet[:app_management] = true if PuppetSyntax.app_management && (Puppet::Util::Package.versioncmp(Puppet.version, '4.3.0') >= 0 && Puppet.version.to_i < 5)
|
Puppet::Face[:parser, :current].validate(file)
|
end
|
The result of this is that existing module authors like myself who have added plans to their modules now have failing test with valid code. Natrually, I could work around this by adding the entire plans directory to my list of excluded paths but, seeing as these are proper .pp files, this feels wrong.
Here is the full trace of how rake validate gets to these manifests:
-
puppetlabs_spec_helper defines a validate task here that calls the syntax task.
-
the syntax task is part of puppet-syntax and calls syntax:manifests here
-
the syntax:manifests task is defined here. It calls the check method of PuppetSyntax::Manifests on all found manifests here.
-
The check method calls the validate_manifest method on each file here.
-
The validate_manifest method is defined here and passes each file to puppet parser validate via the code block above.
|