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 that only ‘require’, ‘consume’, and ‘export’ is used when declaring relationships to capability 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



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

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