From 196294a73e32f5f1cd511a8c23006d23839c7e57 Mon Sep 17 00:00:00 2001 From: Dan Bode Date: Wed, 16 Mar 2011 15:32:23 -0500 Subject: (4576) - if ENC declares invalid class, it is logged at warning. used to be at info, so you had to run the master on verbose to see it an ENC was trying to declare a class that could not be loaded. --- lib/puppet/parser/compiler.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/puppet/parser') diff --git a/lib/puppet/parser/compiler.rb b/lib/puppet/parser/compiler.rb index fdabd05c9..6e8e3d26b 100644 --- a/lib/puppet/parser/compiler.rb +++ b/lib/puppet/parser/compiler.rb @@ -162,7 +162,7 @@ class Puppet::Parser::Compiler resource.evaluate unless lazy_evaluate found << name else - Puppet.info "Could not find class #{name} for #{node.name}" + Puppet.warning "Could not find class #{name} for #{node.name}" @catalog.tag(name) end end -- cgit From 7c60db5d9db8eeda46f7041100759e69aed120a8 Mon Sep 17 00:00:00 2001 From: Jesse Wolfe Date: Thu, 24 Mar 2011 17:51:59 -0700 Subject: (#5477) Allow watch_file to watch non-existent files, especially site.pp The watch_file mechanism would refuse to monitor paths to files that didn't exist. This patch makes it possible to watch a file that hasn't been created yet, so when it is created, you manifests will get reparsed. Backported this change to 2.6.x Paired-With: Jacob Helwig --- lib/puppet/parser/lexer.rb | 5 +++-- lib/puppet/parser/parser_support.rb | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/puppet/parser') diff --git a/lib/puppet/parser/lexer.rb b/lib/puppet/parser/lexer.rb index 9a25263f6..71d9440ff 100644 --- a/lib/puppet/parser/lexer.rb +++ b/lib/puppet/parser/lexer.rb @@ -312,7 +312,8 @@ class Puppet::Parser::Lexer def file=(file) @file = file @line = 1 - @scanner = StringScanner.new(File.read(file)) + contents = File.exists?(file) ? File.read(file) : "" + @scanner = StringScanner.new(contents) end def shift_token @@ -547,7 +548,7 @@ class Puppet::Parser::Lexer value,terminator = slurpstring('"$') token_queue << [TOKENS[token_type[terminator]],preamble+value] if terminator != '$' or @scanner.scan(/\{/) - token_queue.shift + token_queue.shift elsif var_name = @scanner.scan(%r{(\w*::)*\w+|[0-9]}) token_queue << [TOKENS[:VARIABLE],var_name] tokenize_interpolated_string(DQ_continuation_token_types) diff --git a/lib/puppet/parser/parser_support.rb b/lib/puppet/parser/parser_support.rb index 7a0aa2601..9e580efb2 100644 --- a/lib/puppet/parser/parser_support.rb +++ b/lib/puppet/parser/parser_support.rb @@ -88,7 +88,6 @@ class Puppet::Parser::Parser unless file =~ /\.pp$/ file = file + ".pp" end - raise Puppet::Error, "Could not find file #{file}" unless FileTest.exist?(file) end raise Puppet::AlreadyImportedError, "Import loop detected" if known_resource_types.watching_file?(file) -- cgit