diff options
| -rw-r--r-- | lib/puppet/parser/grammar.ra | 4 | ||||
| -rw-r--r-- | lib/puppet/parser/parser.rb | 34 | ||||
| -rw-r--r-- | lib/puppet/type/pfile.rb | 4 | ||||
| -rwxr-xr-x | lib/puppet/type/user.rb | 24 | ||||
| -rwxr-xr-x | test/language/tc_snippets.rb | 18 | ||||
| -rwxr-xr-x | test/types/tc_filebucket.rb | 2 | ||||
| -rwxr-xr-x | test/types/tc_filesources.rb | 20 |
7 files changed, 35 insertions, 71 deletions
diff --git a/lib/puppet/parser/grammar.ra b/lib/puppet/parser/grammar.ra index c9e79422e..f4f142132 100644 --- a/lib/puppet/parser/grammar.ra +++ b/lib/puppet/parser/grammar.ra @@ -408,12 +408,8 @@ import: IMPORT QTEXT { if dir == "" dir = "." end - Puppet.notice "Orig: %s" % @lexer.file.inspect - Puppet.notice "Dir: %s" % dir.inspect Dir.chdir(dir) { - Puppet.notice "Globbing %s" % val[1] Dir.glob(val[1]).each { |file| - Puppet.notice "File: %s" % file.inspect parser = Puppet::Parser::Parser.new() parser.stack = self.stack Puppet.debug("importing '%s'" % file) diff --git a/lib/puppet/parser/parser.rb b/lib/puppet/parser/parser.rb index a23c95d95..ccfd1ed0b 100644 --- a/lib/puppet/parser/parser.rb +++ b/lib/puppet/parser/parser.rb @@ -31,7 +31,7 @@ module Puppet class Parser < Racc::Parser -module_eval <<'..end grammar.ra modeval..ide594950ab5', 'grammar.ra', 572 +module_eval <<'..end grammar.ra modeval..id37b4503337', 'grammar.ra', 568 attr_writer :stack attr_reader :file @@ -135,7 +135,7 @@ end def string=(string) @lexer.string = string end -..end grammar.ra modeval..ide594950ab5 +..end grammar.ra modeval..id37b4503337 ##### racc 1.4.4 generates ### @@ -1005,7 +1005,7 @@ module_eval <<'.,.,', 'grammar.ra', 399 # reduce 60 omitted -module_eval <<'.,.,', 'grammar.ra', 436 +module_eval <<'.,.,', 'grammar.ra', 432 def _reduce_61( val, _values, result ) # importing files # yuk, i hate keywords @@ -1015,12 +1015,8 @@ module_eval <<'.,.,', 'grammar.ra', 436 if dir == "" dir = "." end - Puppet.notice "Orig: %s" % @lexer.file.inspect - Puppet.notice "Dir: %s" % dir.inspect Dir.chdir(dir) { - Puppet.notice "Globbing %s" % val[1] Dir.glob(val[1]).each { |file| - Puppet.notice "File: %s" % file.inspect parser = Puppet::Parser::Parser.new() parser.stack = self.stack Puppet.debug("importing '%s'" % file) @@ -1044,7 +1040,7 @@ module_eval <<'.,.,', 'grammar.ra', 436 end .,., -module_eval <<'.,.,', 'grammar.ra', 446 +module_eval <<'.,.,', 'grammar.ra', 442 def _reduce_62( val, _values, result ) result = AST::CompDef.new( :name => AST::Name.new(:value => val[1], :line => @lexer.line), @@ -1057,7 +1053,7 @@ module_eval <<'.,.,', 'grammar.ra', 446 end .,., -module_eval <<'.,.,', 'grammar.ra', 457 +module_eval <<'.,.,', 'grammar.ra', 453 def _reduce_63( val, _values, result ) result = AST::ClassDef.new( :name => AST::Name.new(:value => val[1], :line => @lexer.line), @@ -1071,7 +1067,7 @@ module_eval <<'.,.,', 'grammar.ra', 457 end .,., -module_eval <<'.,.,', 'grammar.ra', 472 +module_eval <<'.,.,', 'grammar.ra', 468 def _reduce_64( val, _values, result ) result = AST::ASTArray.new( :line => @lexer.line, @@ -1084,14 +1080,14 @@ module_eval <<'.,.,', 'grammar.ra', 472 # reduce 65 omitted -module_eval <<'.,.,', 'grammar.ra', 477 +module_eval <<'.,.,', 'grammar.ra', 473 def _reduce_66( val, _values, result ) result = val[1] result end .,., -module_eval <<'.,.,', 'grammar.ra', 488 +module_eval <<'.,.,', 'grammar.ra', 484 def _reduce_67( val, _values, result ) if val[1].is_a?(AST::ASTArray) result = val[1] @@ -1108,7 +1104,7 @@ module_eval <<'.,.,', 'grammar.ra', 488 # reduce 68 omitted -module_eval <<'.,.,', 'grammar.ra', 502 +module_eval <<'.,.,', 'grammar.ra', 498 def _reduce_69( val, _values, result ) if val[0].is_a?(AST::ASTArray) val[0].push(val[2]) @@ -1124,7 +1120,7 @@ module_eval <<'.,.,', 'grammar.ra', 502 end .,., -module_eval <<'.,.,', 'grammar.ra', 510 +module_eval <<'.,.,', 'grammar.ra', 506 def _reduce_70( val, _values, result ) result = AST::ASTArray.new( :line => @lexer.line, @@ -1135,7 +1131,7 @@ module_eval <<'.,.,', 'grammar.ra', 510 end .,., -module_eval <<'.,.,', 'grammar.ra', 517 +module_eval <<'.,.,', 'grammar.ra', 513 def _reduce_71( val, _values, result ) result = AST::ASTArray.new( :line => @lexer.line, @@ -1148,7 +1144,7 @@ module_eval <<'.,.,', 'grammar.ra', 517 # reduce 72 omitted -module_eval <<'.,.,', 'grammar.ra', 526 +module_eval <<'.,.,', 'grammar.ra', 522 def _reduce_73( val, _values, result ) result = AST::Name.new( :value => val[1], @@ -1159,7 +1155,7 @@ module_eval <<'.,.,', 'grammar.ra', 526 end .,., -module_eval <<'.,.,', 'grammar.ra', 535 +module_eval <<'.,.,', 'grammar.ra', 531 def _reduce_74( val, _values, result ) name = val[0].sub(/^\$/,'') result = AST::Variable.new( @@ -1171,7 +1167,7 @@ module_eval <<'.,.,', 'grammar.ra', 535 end .,., -module_eval <<'.,.,', 'grammar.ra', 544 +module_eval <<'.,.,', 'grammar.ra', 540 def _reduce_75( val, _values, result ) if val[1].is_a?(AST::ASTArray) result = val[1] @@ -1189,7 +1185,7 @@ module_eval <<'.,.,', 'grammar.ra', 544 # reduce 78 omitted -module_eval <<'.,.,', 'grammar.ra', 549 +module_eval <<'.,.,', 'grammar.ra', 545 def _reduce_79( val, _values, result ) result = nil result diff --git a/lib/puppet/type/pfile.rb b/lib/puppet/type/pfile.rb index 8594681f4..659889c06 100644 --- a/lib/puppet/type/pfile.rb +++ b/lib/puppet/type/pfile.rb @@ -120,9 +120,9 @@ module Puppet raise error end rescue => detail - error = Puppet::Error.new "Could not create %s: %s" % + raise Puppet::Error.new("Could not create %s: %s" % [@should, detail] - raise error + ) end return event end diff --git a/lib/puppet/type/user.rb b/lib/puppet/type/user.rb index fb3a2966e..15c6a3d03 100755 --- a/lib/puppet/type/user.rb +++ b/lib/puppet/type/user.rb @@ -212,18 +212,18 @@ module Puppet # all of the states are very similar, but syncing is different # for each _type_ of state @states.each { |state| - begin - klass = eval("Puppet::State::UserState" + @@extender) - if klass.test - state.send(:include, klass) - else - Puppet.err "Cannot sync %s on %s" % - [state.name, @name] - end - rescue NameError - Puppet.notice "No %s extender for %s" % - [@@extender, state.name] - end +# begin +# klass = eval("Puppet::State::UserState" + @@extender) +# if klass.test +# state.send(:include, klass) +# else +# Puppet.err "Cannot sync %s on %s" % +# [state.name, @name] +# end +# rescue NameError +# Puppet.notice "No %s extender for %s" % +# [@@extender, state.name] +# end } @paramdoc[:name] = "User name. While limitations are determined for diff --git a/test/language/tc_snippets.rb b/test/language/tc_snippets.rb index f206cb2fc..a37404844 100755 --- a/test/language/tc_snippets.rb +++ b/test/language/tc_snippets.rb @@ -23,7 +23,7 @@ require 'puppettest' # so really, we want to do things like test that our ast is correct # and test whether we've got things in the right scopes -class TestSnippets < Test::Unit::TestCase +class TestSnippets < TestPuppet $snippetbase = File.join($puppetbase, "examples", "code", "snippets") def file2ast(file) @@ -161,20 +161,6 @@ class TestSnippets < Test::Unit::TestCase } end - def setup - Puppet[:loglevel] = :debug if __FILE__ == $0 - @@tmpfiles = [] - end - - def teardown - @@tmpfiles.flatten.each { |file| - if FileTest.exists?(file) - system("rm -rf %s" % file) - end - } - Puppet::Type.allclear - end - # this is here in case no tests get defined; otherwise we get a warning def test_nothing end @@ -217,7 +203,7 @@ class TestSnippets < Test::Unit::TestCase files = %w{a b c d}.collect { |letter| "/tmp/snippetselect%stest" % letter } - @@tmpfiles << files + @@tmpfiles += files files.each { |file| assert(FileTest.exists?(file)) diff --git a/test/types/tc_filebucket.rb b/test/types/tc_filebucket.rb index 6a2fd6c50..fe4971136 100755 --- a/test/types/tc_filebucket.rb +++ b/test/types/tc_filebucket.rb @@ -11,7 +11,7 @@ require 'puppettest' # $Id$ -class TestFileBucket < Test::Unit::TestCase +class TestFileBucket < TestPuppet include FileTesting # hmmm # this is complicated, because we store references to the created diff --git a/test/types/tc_filesources.rb b/test/types/tc_filesources.rb index 88699bcb5..de35e1d93 100755 --- a/test/types/tc_filesources.rb +++ b/test/types/tc_filesources.rb @@ -13,11 +13,8 @@ require 'puppettest' # $Id$ -class TestFileSources < Test::Unit::TestCase +class TestFileSources < TestPuppet include FileTesting - # hmmm - # this is complicated, because we store references to the created - # objects in a central store =begin def mkfile(hash) @@ -38,31 +35,20 @@ class TestFileSources < Test::Unit::TestCase end =end def setup - @@tmpfiles = [] - @@tmppids = [] - Puppet[:loglevel] = :debug if __FILE__ == $0 - Puppet[:checksumfile] = File.join(Puppet[:statedir], "checksumtestfile") begin initstorage rescue system("rm -rf %s" % Puppet[:checksumfile]) end + super end def teardown clearstorage - Puppet::Type.allclear @@tmppids.each { |pid| system("kill -INT %s" % pid) } - @@tmpfiles.each { |file| - if FileTest.exists?(file) - system("chmod -R 755 %s" % file) - system("rm -rf %s" % file) - end - } - @@tmpfiles.clear - system("rm -f %s" % Puppet[:checksumfile]) + super end def initstorage |
