Skip to content

Commit

Permalink
stub out dangerous functions for graphs too
Browse files Browse the repository at this point in the history
  • Loading branch information
binford2k committed Nov 13, 2017
1 parent 41aeb84 commit 5324bb0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/puppet-validator/validators/syntax.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,17 @@ def render!
begin
raise 'No Puppet environment found' if Puppet[:code].empty?

# neuter functions that might run code on the master during compilation
Puppet::Parser::Functions.newfunction(:generate, :type => :rvalue) { |args|
true
}
Puppet::Parser::Functions.newfunction(:template, :type => :rvalue) { |args|
args.first
}
Puppet::Parser::Functions.newfunction(:inline_template, :type => :rvalue) { |args|
args.first
}

node = Puppet::Node.indirection.find('validator')
catalog = Puppet::Resource::Catalog.indirection.find(node.name, :use_node => node)

Expand Down

0 comments on commit 5324bb0

Please sign in to comment.