Class: Puppet::Parser::Compiler::CatalogValidator::RelationshipValidator

Inherits:
Puppet::Parser::Compiler::CatalogValidator show all
Defined in:
lib/puppet/parser/compiler/catalog_validator/relationship_validator.rb

Overview

Validator that asserts relationship metaparameters refer to valid resources

Constant Summary

Constants inherited from Puppet::Parser::Compiler::CatalogValidator

FINAL, PRE_FINISH

Instance Attribute Summary

Attributes inherited from Puppet::Parser::Compiler::CatalogValidator

#catalog

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

#validateObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/puppet/parser/compiler/catalog_validator/relationship_validator.rb', line 6

def validate
  catalog.resources.each do |resource|
    next unless resource.is_a?(Puppet::Parser::Resource)
    next if resource.virtual?

    resource.eachparam do |param|
      pclass = Puppet::Type.metaparamclass(param.name)
      validate_relationship(param) if !pclass.nil? && pclass < Puppet::Type::RelationshipMetaparam
    end
  end
  nil
end