diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/parser/grammar.ra | 4 | ||||
-rw-r--r-- | lib/puppet/parser/interpreter.rb | 40 | ||||
-rw-r--r-- | lib/puppet/parser/lexer.rb | 6 | ||||
-rw-r--r-- | lib/puppet/parser/parser.rb | 9 | ||||
-rw-r--r-- | lib/puppet/type.rb | 4 | ||||
-rw-r--r-- | lib/puppet/type/file.rb (renamed from lib/puppet/type/pfile.rb) | 18 | ||||
-rwxr-xr-x | lib/puppet/type/file/checksum.rb (renamed from lib/puppet/type/pfile/checksum.rb) | 0 | ||||
-rwxr-xr-x | lib/puppet/type/file/content.rb (renamed from lib/puppet/type/pfile/content.rb) | 0 | ||||
-rwxr-xr-x | lib/puppet/type/file/ensure.rb (renamed from lib/puppet/type/pfile/ensure.rb) | 0 | ||||
-rwxr-xr-x | lib/puppet/type/file/group.rb (renamed from lib/puppet/type/pfile/group.rb) | 0 | ||||
-rwxr-xr-x | lib/puppet/type/file/mode.rb (renamed from lib/puppet/type/pfile/mode.rb) | 0 | ||||
-rwxr-xr-x | lib/puppet/type/file/owner.rb (renamed from lib/puppet/type/pfile/owner.rb) | 0 | ||||
-rwxr-xr-x | lib/puppet/type/file/source.rb (renamed from lib/puppet/type/pfile/source.rb) | 0 | ||||
-rw-r--r-- | lib/puppet/type/file/target.rb (renamed from lib/puppet/type/pfile/target.rb) | 0 | ||||
-rwxr-xr-x | lib/puppet/type/file/type.rb (renamed from lib/puppet/type/pfile/type.rb) | 0 | ||||
-rwxr-xr-x | lib/puppet/type/filebucket.rb (renamed from lib/puppet/type/pfilebucket.rb) | 0 |
16 files changed, 43 insertions, 38 deletions
diff --git a/lib/puppet/parser/grammar.ra b/lib/puppet/parser/grammar.ra index 0fd644b3a..484efe83c 100644 --- a/lib/puppet/parser/grammar.ra +++ b/lib/puppet/parser/grammar.ra @@ -151,7 +151,7 @@ resourceoverride: resourceref LBRACE anyparams endcomma RBRACE { virtualresource: at resource { type = val[0] - if type == :exported and ! Puppet[:storeconfigs] + if (type == :exported and ! Puppet[:storeconfigs]) and ! Puppet[:parseonly] error "You cannot collect without storeconfigs being set" end @@ -192,7 +192,7 @@ collection: classref collectrhand { else args[:form] = val[1] end - if args[:form] == :exported and ! Puppet[:storeconfigs] + if args[:form] == :exported and ! Puppet[:storeconfigs] and ! Puppet[:parseonly] error "You cannot collect exported resources without storeconfigs being set" end result = ast AST::Collection, args diff --git a/lib/puppet/parser/interpreter.rb b/lib/puppet/parser/interpreter.rb index 1d93193dd..d4b7449fb 100644 --- a/lib/puppet/parser/interpreter.rb +++ b/lib/puppet/parser/interpreter.rb @@ -42,6 +42,26 @@ class Puppet::Parser::Interpreter @parsers = {} end + # Return the parser for a specific environment. + def parser(environment) + if ! @parsers[environment] or @parsers[environment].reparse? + # This will throw an exception if it does not succeed. We only + # want to get rid of the old parser if we successfully create a new + # one. + begin + tmp = create_parser(environment) + @parsers[environment].clear if @parsers[environment] + @parsers[environment] = tmp + rescue => detail + # If a parser already exists, than assume that we logged the + # exception elsewhere and reuse the parser. If one doesn't + # exist, then reraise. + raise detail unless @parsers[environment] + end + end + @parsers[environment] + end + private # Create a new parser object and pre-parse the configuration. @@ -67,24 +87,4 @@ class Puppet::Parser::Interpreter raise error end end - - # Return the parser for a specific environment. - def parser(environment) - if ! @parsers[environment] or @parsers[environment].reparse? - # This will throw an exception if it does not succeed. We only - # want to get rid of the old parser if we successfully create a new - # one. - begin - tmp = create_parser(environment) - @parsers[environment].clear if @parsers[environment] - @parsers[environment] = tmp - rescue => detail - # If a parser already exists, than assume that we logged the - # exception elsewhere and reuse the parser. If one doesn't - # exist, then reraise. - raise detail unless @parsers[environment] - end - end - @parsers[environment] - end end diff --git a/lib/puppet/parser/lexer.rb b/lib/puppet/parser/lexer.rb index 6661650ba..51026ea1b 100644 --- a/lib/puppet/parser/lexer.rb +++ b/lib/puppet/parser/lexer.rb @@ -33,7 +33,11 @@ class Puppet::Parser::Lexer end def to_s - "Lexer token %s" % @name.to_s + if self.string + @string + else + @name.to_s + end end end diff --git a/lib/puppet/parser/parser.rb b/lib/puppet/parser/parser.rb index c3279d4e7..e27a209fc 100644 --- a/lib/puppet/parser/parser.rb +++ b/lib/puppet/parser/parser.rb @@ -29,7 +29,7 @@ module Puppet class Parser < Racc::Parser -module_eval <<'..end grammar.ra modeval..id9134b179f4', 'grammar.ra', 638 +module_eval <<'..end grammar.ra modeval..idfef5d70c9f', 'grammar.ra', 638 # It got too annoying having code in a file that needs to be compiled. require 'puppet/parser/parser_support' @@ -39,8 +39,9 @@ require 'puppet/parser/parser_support' # mode: ruby # End: +# $Id$ -..end grammar.ra modeval..id9134b179f4 +..end grammar.ra modeval..idfef5d70c9f ##### racc 1.4.5 generates ### @@ -956,7 +957,7 @@ module_eval <<'.,.,', 'grammar.ra', 174 def _reduce_38( val, _values, result ) type = val[0] - if type == :exported and ! Puppet[:storeconfigs] + if (type == :exported and ! Puppet[:storeconfigs]) and ! Puppet[:parseonly] error "You cannot collect without storeconfigs being set" end @@ -1009,7 +1010,7 @@ module_eval <<'.,.,', 'grammar.ra', 199 else args[:form] = val[1] end - if args[:form] == :exported and ! Puppet[:storeconfigs] + if args[:form] == :exported and ! Puppet[:storeconfigs] and ! Puppet[:parseonly] error "You cannot collect exported resources without storeconfigs being set" end result = ast AST::Collection, args diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb index def9e44e4..c4e154d47 100644 --- a/lib/puppet/type.rb +++ b/lib/puppet/type.rb @@ -423,8 +423,8 @@ end require 'puppet/propertychange' require 'puppet/provider' require 'puppet/type/component' -require 'puppet/type/pfile' -require 'puppet/type/pfilebucket' +require 'puppet/type/file' +require 'puppet/type/filebucket' require 'puppet/type/tidy' diff --git a/lib/puppet/type/pfile.rb b/lib/puppet/type/file.rb index c32a4d474..65ee7e72e 100644 --- a/lib/puppet/type/pfile.rb +++ b/lib/puppet/type/file.rb @@ -1159,13 +1159,13 @@ module Puppet # We put all of the properties in separate files, because there are so many # of them. The order these are loaded is important, because it determines # the order they are in the property lit. - require 'puppet/type/pfile/checksum' - require 'puppet/type/pfile/content' # can create the file - require 'puppet/type/pfile/source' # can create the file - require 'puppet/type/pfile/target' # creates a different type of file - require 'puppet/type/pfile/ensure' # can create the file - require 'puppet/type/pfile/owner' - require 'puppet/type/pfile/group' - require 'puppet/type/pfile/mode' - require 'puppet/type/pfile/type' + require 'puppet/type/file/checksum' + require 'puppet/type/file/content' # can create the file + require 'puppet/type/file/source' # can create the file + require 'puppet/type/file/target' # creates a different type of file + require 'puppet/type/file/ensure' # can create the file + require 'puppet/type/file/owner' + require 'puppet/type/file/group' + require 'puppet/type/file/mode' + require 'puppet/type/file/type' end diff --git a/lib/puppet/type/pfile/checksum.rb b/lib/puppet/type/file/checksum.rb index 08f48ea21..08f48ea21 100755 --- a/lib/puppet/type/pfile/checksum.rb +++ b/lib/puppet/type/file/checksum.rb diff --git a/lib/puppet/type/pfile/content.rb b/lib/puppet/type/file/content.rb index 6dcda0aa6..6dcda0aa6 100755 --- a/lib/puppet/type/pfile/content.rb +++ b/lib/puppet/type/file/content.rb diff --git a/lib/puppet/type/pfile/ensure.rb b/lib/puppet/type/file/ensure.rb index 3aa918f65..3aa918f65 100755 --- a/lib/puppet/type/pfile/ensure.rb +++ b/lib/puppet/type/file/ensure.rb diff --git a/lib/puppet/type/pfile/group.rb b/lib/puppet/type/file/group.rb index 5f7caf342..5f7caf342 100755 --- a/lib/puppet/type/pfile/group.rb +++ b/lib/puppet/type/file/group.rb diff --git a/lib/puppet/type/pfile/mode.rb b/lib/puppet/type/file/mode.rb index 8674e0a88..8674e0a88 100755 --- a/lib/puppet/type/pfile/mode.rb +++ b/lib/puppet/type/file/mode.rb diff --git a/lib/puppet/type/pfile/owner.rb b/lib/puppet/type/file/owner.rb index 6f9bbd6a2..6f9bbd6a2 100755 --- a/lib/puppet/type/pfile/owner.rb +++ b/lib/puppet/type/file/owner.rb diff --git a/lib/puppet/type/pfile/source.rb b/lib/puppet/type/file/source.rb index 3dfb5cccd..3dfb5cccd 100755 --- a/lib/puppet/type/pfile/source.rb +++ b/lib/puppet/type/file/source.rb diff --git a/lib/puppet/type/pfile/target.rb b/lib/puppet/type/file/target.rb index a0e5dc401..a0e5dc401 100644 --- a/lib/puppet/type/pfile/target.rb +++ b/lib/puppet/type/file/target.rb diff --git a/lib/puppet/type/pfile/type.rb b/lib/puppet/type/file/type.rb index 65539795b..65539795b 100755 --- a/lib/puppet/type/pfile/type.rb +++ b/lib/puppet/type/file/type.rb diff --git a/lib/puppet/type/pfilebucket.rb b/lib/puppet/type/filebucket.rb index b268610e9..b268610e9 100755 --- a/lib/puppet/type/pfilebucket.rb +++ b/lib/puppet/type/filebucket.rb |