Class: Puppet::Parser::Compiler::CatalogValidator::EnvironmentRelationshipValidator
- Inherits:
-
Puppet::Parser::Compiler::CatalogValidator
- Object
- Puppet::Parser::Compiler::CatalogValidator
- Puppet::Parser::Compiler::CatalogValidator::EnvironmentRelationshipValidator
- Defined in:
- lib/puppet/parser/compiler/catalog_validator/env_relationship_validator.rb
Overview
Validator that asserts that all capability resources that are referenced by ‘consume’ or ‘require’ has been exported by some other resource in the environment
Constant Summary
Constants inherited from Puppet::Parser::Compiler::CatalogValidator
Instance Attribute Summary
Attributes inherited from Puppet::Parser::Compiler::CatalogValidator
Instance Method Summary collapse
Methods inherited from Puppet::Parser::Compiler::CatalogValidator
#initialize, validation_stage?
Constructor Details
This class inherits a constructor from Puppet::Parser::Compiler::CatalogValidator
Instance Method Details
#validate ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/puppet/parser/compiler/catalog_validator/env_relationship_validator.rb', line 6 def validate assumed_exports = {} exported = {} catalog.resources.each do |resource| next unless resource.is_a?(Puppet::Parser::Resource) resource.eachparam do |param| pclass = Puppet::Type.(param.name) validate_relationship(resource, param, assumed_exports, exported) if !pclass.nil? && pclass < Puppet::Type::RelationshipMetaparam end end assumed_exports.each_pair do |key, (param, cap)| raise CatalogValidationError.new(_("Capability '%{cap}' referenced by '%{param}' is never exported") % { cap: cap, param: param.name }, param.file, param.line) unless exported.include?(key) end nil end |