puppet 0.25.0 → 0.25.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of puppet might be problematic. Click here for more details.

Files changed (138) hide show
  1. data/CHANGELOG +4772 -19114
  2. data/README +1 -1
  3. data/Rakefile +7 -25
  4. data/{sbin → bin}/puppetca +0 -0
  5. data/{sbin → bin}/puppetd +0 -0
  6. data/{sbin → bin}/puppetmasterd +0 -0
  7. data/{sbin → bin}/puppetqd +0 -0
  8. data/{sbin → bin}/puppetrun +0 -0
  9. data/conf/osx/createpackage.sh +1 -1
  10. data/conf/redhat/client.init +6 -3
  11. data/conf/redhat/puppet.spec +26 -14
  12. data/conf/redhat/server.init +3 -2
  13. data/ext/vim/syntax/puppet.vim +4 -1
  14. data/install.rb +25 -7
  15. data/lib/puppet.rb +1 -1
  16. data/lib/puppet/agent.rb +2 -2
  17. data/lib/puppet/application/puppet.rb +3 -3
  18. data/lib/puppet/application/puppetd.rb +0 -7
  19. data/lib/puppet/application/puppetdoc.rb +1 -0
  20. data/lib/puppet/application/puppetmasterd.rb +2 -2
  21. data/lib/puppet/configurer.rb +6 -1
  22. data/lib/puppet/configurer/fact_handler.rb +2 -2
  23. data/lib/puppet/defaults.rb +2 -2
  24. data/lib/puppet/external/nagios/base.rb +4 -3
  25. data/lib/puppet/external/pson/common.rb +367 -0
  26. data/lib/puppet/external/pson/pure.rb +77 -0
  27. data/lib/puppet/external/pson/pure/generator.rb +429 -0
  28. data/lib/puppet/external/pson/pure/parser.rb +269 -0
  29. data/lib/puppet/external/pson/version.rb +8 -0
  30. data/lib/puppet/feature/pson.rb +6 -0
  31. data/lib/puppet/feature/rails.rb +1 -5
  32. data/lib/puppet/file_serving/configuration.rb +2 -2
  33. data/lib/puppet/indirector/certificate/rest.rb +6 -0
  34. data/lib/puppet/indirector/facts/facter.rb +1 -1
  35. data/lib/puppet/indirector/ldap.rb +1 -1
  36. data/lib/puppet/indirector/queue.rb +3 -3
  37. data/lib/puppet/indirector/rest.rb +1 -1
  38. data/lib/puppet/network/authstore.rb +34 -53
  39. data/lib/puppet/network/formats.rb +59 -9
  40. data/lib/puppet/network/http/mongrel/rest.rb +10 -9
  41. data/lib/puppet/network/http/webrick.rb +8 -1
  42. data/lib/puppet/network/http/webrick/rest.rb +2 -5
  43. data/lib/puppet/network/http_server/webrick.rb +1 -4
  44. data/lib/puppet/parser/ast/leaf.rb +1 -3
  45. data/lib/puppet/parser/collector.rb +14 -8
  46. data/lib/puppet/parser/compiler.rb +7 -0
  47. data/lib/puppet/parser/functions/fqdn_rand.rb +4 -10
  48. data/lib/puppet/parser/functions/regsubst.rb +44 -30
  49. data/lib/puppet/parser/functions/require.rb +18 -3
  50. data/lib/puppet/parser/functions/versioncmp.rb +1 -1
  51. data/lib/puppet/parser/interpreter.rb +1 -1
  52. data/lib/puppet/parser/lexer.rb +29 -31
  53. data/lib/puppet/parser/loaded_code.rb +4 -0
  54. data/lib/puppet/parser/parser_support.rb +5 -2
  55. data/lib/puppet/parser/resource.rb +31 -6
  56. data/lib/puppet/property.rb +3 -2
  57. data/lib/puppet/provider/macauthorization/macauthorization.rb +14 -14
  58. data/lib/puppet/provider/package/dpkg.rb +1 -1
  59. data/lib/puppet/provider/package/portage.rb +15 -5
  60. data/lib/puppet/provider/package/rug.rb +1 -1
  61. data/lib/puppet/provider/package/up2date.rb +1 -1
  62. data/lib/puppet/provider/package/urpmi.rb +1 -1
  63. data/lib/puppet/provider/service/daemontools.rb +7 -10
  64. data/lib/puppet/provider/service/runit.rb +7 -17
  65. data/lib/puppet/provider/ssh_authorized_key/parsed.rb +7 -47
  66. data/lib/puppet/provider/zone/solaris.rb +12 -3
  67. data/lib/puppet/relationship.rb +12 -12
  68. data/lib/puppet/reports/rrdgraph.rb +1 -1
  69. data/lib/puppet/reports/store.rb +2 -2
  70. data/lib/puppet/reports/tagmail.rb +5 -16
  71. data/lib/puppet/resource.rb +15 -20
  72. data/lib/puppet/resource/catalog.rb +40 -29
  73. data/lib/puppet/ssl/certificate_revocation_list.rb +0 -2
  74. data/lib/puppet/ssl/host.rb +2 -3
  75. data/lib/puppet/sslcertificates/ca.rb +0 -5
  76. data/lib/puppet/type/cron.rb +1 -1
  77. data/lib/puppet/type/file/owner.rb +7 -4
  78. data/lib/puppet/type/resources.rb +17 -17
  79. data/lib/puppet/type/yumrepo.rb +10 -3
  80. data/lib/puppet/util.rb +6 -11
  81. data/lib/puppet/util/inifile.rb +8 -0
  82. data/lib/puppet/util/log.rb +2 -2
  83. data/lib/puppet/util/monkey_patches.rb +0 -43
  84. data/lib/puppet/util/{json.rb → pson.rb} +6 -6
  85. data/lib/puppet/util/rdoc.rb +5 -3
  86. data/lib/puppet/util/selinux.rb +12 -6
  87. data/lib/puppet/util/settings.rb +25 -16
  88. data/lib/puppet/util/settings/file_setting.rb +4 -2
  89. data/spec/integration/application/puppet.rb +4 -4
  90. data/spec/integration/defaults.rb +2 -2
  91. data/spec/integration/indirector/catalog/queue.rb +5 -5
  92. data/spec/integration/indirector/certificate/rest.rb +3 -1
  93. data/spec/integration/network/formats.rb +36 -36
  94. data/spec/integration/parser/functions/require.rb +5 -3
  95. data/spec/integration/provider/mailalias/aliases.rb +4 -4
  96. data/spec/integration/resource/catalog.rb +4 -4
  97. data/spec/unit/application/puppet.rb +16 -15
  98. data/spec/unit/application/puppetd.rb +1 -1
  99. data/spec/unit/application/puppetdoc.rb +6 -0
  100. data/spec/unit/application/puppetmasterd.rb +6 -6
  101. data/spec/unit/configurer/fact_handler.rb +3 -3
  102. data/spec/unit/file_serving/configuration.rb +16 -2
  103. data/spec/unit/indirector/certificate/rest.rb +34 -0
  104. data/spec/unit/indirector/queue.rb +15 -15
  105. data/spec/unit/indirector/rest.rb +31 -9
  106. data/spec/unit/network/authstore.rb +105 -26
  107. data/spec/unit/network/formats.rb +124 -39
  108. data/spec/unit/parser/ast/leaf.rb +15 -0
  109. data/spec/unit/parser/collector.rb +20 -9
  110. data/spec/unit/parser/compiler.rb +19 -0
  111. data/spec/unit/parser/functions/fqdn_rand.rb +62 -0
  112. data/spec/unit/parser/functions/regsubst.rb +80 -0
  113. data/spec/unit/parser/functions/require.rb +19 -7
  114. data/spec/unit/parser/interpreter.rb +2 -2
  115. data/spec/unit/parser/lexer.rb +32 -7
  116. data/spec/unit/parser/loaded_code.rb +18 -1
  117. data/spec/unit/parser/parser.rb +10 -2
  118. data/spec/unit/parser/resource.rb +53 -2
  119. data/spec/unit/parser/scope.rb +1 -1
  120. data/spec/unit/property.rb +14 -4
  121. data/spec/unit/provider/package/dpkg.rb +7 -0
  122. data/spec/unit/provider/service/daemontools.rb +19 -2
  123. data/spec/unit/provider/service/redhat.rb +2 -0
  124. data/spec/unit/provider/service/runit.rb +15 -4
  125. data/spec/unit/provider/ssh_authorized_key/parsed.rb +32 -55
  126. data/spec/unit/relationship.rb +21 -46
  127. data/spec/unit/resource.rb +30 -39
  128. data/spec/unit/resource/catalog.rb +66 -51
  129. data/spec/unit/ssl/certificate_revocation_list.rb +0 -12
  130. data/spec/unit/type/cron.rb +33 -0
  131. data/spec/unit/type/file/owner.rb +10 -4
  132. data/spec/unit/util/json.rb +9 -9
  133. data/spec/unit/util/log.rb +36 -0
  134. data/spec/unit/util/settings.rb +6 -0
  135. data/test/data/providers/ssh_authorized_key/parsed/authorized_keys2 +1 -0
  136. data/test/lib/puppettest/support/utils.rb +8 -16
  137. metadata +36 -13
  138. data/lib/puppet/feature/json.rb +0 -2
@@ -46,18 +46,6 @@ describe Puppet::SSL::CertificateRevocationList do
46
46
  end
47
47
  end
48
48
 
49
- describe "when initializing" do
50
- it "should fail if :cacrl is set to false" do
51
- Puppet.settings.expects(:value).with(:cacrl).returns false
52
- lambda { @class.new("crl") }.should raise_error(Puppet::Error)
53
- end
54
-
55
- it "should fail if :cacrl is set to the string 'false'" do
56
- Puppet.settings.expects(:value).with(:cacrl).returns "false"
57
- lambda { @class.new("crl") }.should raise_error(Puppet::Error)
58
- end
59
- end
60
-
61
49
  describe "when generating the crl" do
62
50
  before do
63
51
  @real_crl = mock 'crl'
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
4
+
5
+ describe Puppet::Type.type(:cron) do
6
+ before do
7
+ @cron = Puppet::Type.type(:cron).new( :name => "foo" )
8
+ end
9
+
10
+ it "it should accept an :environment that looks like a path" do
11
+ lambda do
12
+ @cron[:environment] = 'PATH=/bin:/usr/bin:/usr/sbin'
13
+ end.should_not raise_error
14
+ end
15
+
16
+ it "should not accept environment variables that do not contain '='" do
17
+ lambda do
18
+ @cron[:environment] = "INVALID"
19
+ end.should raise_error(Puppet::Error)
20
+ end
21
+
22
+ it "should accept empty environment variables that do not contain '='" do
23
+ lambda do
24
+ @cron[:environment] = "MAILTO="
25
+ end.should_not raise_error(Puppet::Error)
26
+ end
27
+
28
+ it "should accept 'absent'" do
29
+ lambda do
30
+ @cron[:environment] = 'absent'
31
+ end.should_not raise_error(Puppet::Error)
32
+ end
33
+ end
@@ -55,11 +55,13 @@ describe property do
55
55
 
56
56
  describe "when determining if the file is in sync" do
57
57
  describe "and not running as root" do
58
- it "should warn and return true" do
59
- @owner.should = 10
58
+ it "should warn once and return true" do
60
59
  Puppet::Util::SUIDManager.expects(:uid).returns 1
61
- @owner.expects(:warning)
62
- @owner.must be_insync("whatever")
60
+
61
+ @owner.expects(:warnonce)
62
+
63
+ @owner.should = [10]
64
+ @owner.must be_insync(20)
63
65
  end
64
66
  end
65
67
 
@@ -67,6 +69,10 @@ describe property do
67
69
  Puppet::Util::SUIDManager.stubs(:uid).returns 0
68
70
  end
69
71
 
72
+ it "should be in sync if 'should' is not provided" do
73
+ @owner.must be_insync(10)
74
+ end
75
+
70
76
  it "should directly compare the owner values if the desired owner is an integer" do
71
77
  @owner.should = [10]
72
78
  @owner.must be_insync(10)
@@ -2,20 +2,20 @@
2
2
 
3
3
  Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
4
4
 
5
- require 'puppet/util/json'
5
+ require 'puppet/util/pson'
6
6
 
7
- class JsonUtil
8
- include Puppet::Util::Json
7
+ class PsonUtil
8
+ include Puppet::Util::Pson
9
9
  end
10
10
 
11
- describe Puppet::Util::Json do
11
+ describe Puppet::Util::Pson do
12
12
  it "should fail if no data is provided" do
13
- lambda { JsonUtil.new.json_create("json_class" => "foo") }.should raise_error(ArgumentError)
13
+ lambda { PsonUtil.new.pson_create("type" => "foo") }.should raise_error(ArgumentError)
14
14
  end
15
15
 
16
- it "should call 'from_json' with the provided data" do
17
- json = JsonUtil.new
18
- json.expects(:from_json).with("mydata")
19
- json.json_create("json_class" => "foo", "data" => "mydata")
16
+ it "should call 'from_pson' with the provided data" do
17
+ pson = PsonUtil.new
18
+ pson.expects(:from_pson).with("mydata")
19
+ pson.pson_create("type" => "foo", "data" => "mydata")
20
20
  end
21
21
  end
@@ -13,6 +13,42 @@ describe Puppet::Util::Log do
13
13
  Puppet::Util::Log.close_all
14
14
  end
15
15
 
16
+ describe Puppet::Util::Log::DestConsole do
17
+ before do
18
+ @console = Puppet::Util::Log::DestConsole.new
19
+ end
20
+
21
+ it "should colorize if Puppet[:color] is :ansi" do
22
+ Puppet[:color] = :ansi
23
+
24
+ @console.colorize(:alert, "abc").should == "\e[0;31mabc\e[0m"
25
+ end
26
+
27
+ it "should colorize if Puppet[:color] is 'yes'" do
28
+ Puppet[:color] = "yes"
29
+
30
+ @console.colorize(:alert, "abc").should == "\e[0;31mabc\e[0m"
31
+ end
32
+
33
+ it "should htmlize if Puppet[:color] is :html" do
34
+ Puppet[:color] = :html
35
+
36
+ @console.colorize(:alert, "abc").should == "<span style=\"color: FFA0A0\">abc</span>"
37
+ end
38
+
39
+ it "should do nothing if Puppet[:color] is false" do
40
+ Puppet[:color] = false
41
+
42
+ @console.colorize(:alert, "abc").should == "abc"
43
+ end
44
+
45
+ it "should do nothing if Puppet[:color] is invalid" do
46
+ Puppet[:color] = "invalid option"
47
+
48
+ @console.colorize(:alert, "abc").should == "abc"
49
+ end
50
+ end
51
+
16
52
  describe "instances" do
17
53
  before do
18
54
  Puppet::Util::Log.stubs(:newmessage)
@@ -200,6 +200,12 @@ describe Puppet::Util::Settings do
200
200
  @settings[:four].should == "ONE TWO ONE ONE TWO THREE FOUR"
201
201
  end
202
202
 
203
+ it "should provide a method for returning uninterpolated values" do
204
+ @settings[:two] = "$one tw0"
205
+ @settings.uninterpolated_value(:two).should == "$one tw0"
206
+ @settings.uninterpolated_value(:four).should == "$two $three FOUR"
207
+ end
208
+
203
209
  it "should interpolate set values for other parameters into returned parameter values" do
204
210
  @settings[:one] = "on3"
205
211
  @settings[:two] = "$one tw0"
@@ -0,0 +1 @@
1
+ false ssh-dss AAAAB3NzaC1kc3MAAACBAJkupmdsJSDXfUy5EU5NTRBDr9Woo3w0YnB8KmnJW9ghU8C7SkWPB1fIHVe+esFfd3qWBseb83PoFX63geZJAg6bjV4/Rdn1zEoa9EO2QyUdYUen4+rpsh3vVKZ6HFNsn3+W5+kPYgE1F/N4INqkbjY3sqCkP/W1BL9+sbVVbuJFAAAAFQCfjWDk5XhvGUkPjNWWVqltBYzHtwAAAIEAg/XL7ky7x9Ad5banzPFAfmM+DGFe0A/JEbLDjKmr5KBM5x4RFohtEvZ8ECuVGUOqBWdgAjyYwsG4oRVjLnKrf/rgmbNRzSFgEWkcAye3BVwk7Dt6hh4knEl+mNfOLq+FH0011UhecOiqTcESMzQDtgQ1vJh2VchElBLjl3x/ZugAAACAAh5jGQC338t5ObP8trSlOefkx0sXmmEzUbo3Mt8mGUuGJPx8m+X0L8Xd+l5rQxytqE3SmV/RD+6REqBuPqHM8RQuqAzfjdOeg/Ajdggx1CRMTVhltZsgQoxO30cz9Qo0SdPoL+Jp1fLuaLZq7m/RmsWYvoLT3jebBlpvvQE8YlI= Francois Deppierraz
@@ -91,22 +91,6 @@ module PuppetTest::Support::Utils
91
91
  return trans
92
92
  end
93
93
 
94
- # If there are any fake data files, retrieve them
95
- def fakedata(dir)
96
- ary = [basedir, "test"]
97
- ary += dir.split("/")
98
- dir = File.join(ary)
99
-
100
- unless FileTest.exists?(dir)
101
- raise Puppet::DevError, "No fakedata dir %s" % dir
102
- end
103
- files = Dir.entries(dir).reject { |f| f =~ /^\./ }.collect { |f|
104
- File.join(dir, f)
105
- }
106
-
107
- return files
108
- end
109
-
110
94
  def fakefile(name)
111
95
  ary = [PuppetTest.basedir, "test"]
112
96
  ary += name.split("/")
@@ -169,4 +153,12 @@ end
169
153
 
170
154
  module PuppetTest
171
155
  include PuppetTest::Support::Utils
156
+
157
+ def self.fakedata(dir,pat='*')
158
+ glob = "#{basedir}/test/#{dir}/#{pat}"
159
+ files = Dir.glob(glob,File::FNM_PATHNAME)
160
+ raise Puppet::DevError, "No fakedata matching #{glob}" if files.empty?
161
+ files
162
+ end
163
+
172
164
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.25.0
4
+ version: 0.25.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reductive Labs
@@ -9,14 +9,32 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-05 00:00:00 +10:00
12
+ date: 2009-10-27 00:00:00 +11:00
13
13
  default_executable:
14
- dependencies: []
15
-
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: facter
17
+ type: !ruby/sym runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.5.1
24
+ version:
16
25
  description:
17
26
  email: puppet@reductivelabs.com
18
- executables: []
19
-
27
+ executables:
28
+ - puppetca
29
+ - puppetd
30
+ - puppetmasterd
31
+ - puppetqd
32
+ - puppetrun
33
+ - filebucket
34
+ - pi
35
+ - puppet
36
+ - puppetdoc
37
+ - ralsh
20
38
  extensions: []
21
39
 
22
40
  extra_rdoc_files: []
@@ -36,11 +54,6 @@ files:
36
54
  - bin/puppet
37
55
  - bin/puppetdoc
38
56
  - bin/pi
39
- - sbin/puppetca
40
- - sbin/puppetrun
41
- - sbin/puppetd
42
- - sbin/puppetmasterd
43
- - sbin/puppetqd
44
57
  - lib/puppet
45
58
  - lib/puppet/module.rb
46
59
  - lib/puppet/checksum.rb
@@ -177,6 +190,7 @@ files:
177
190
  - lib/puppet/util/posix.rb
178
191
  - lib/puppet/util/settings.rb
179
192
  - lib/puppet/util/monkey_patches.rb
193
+ - lib/puppet/util/pson.rb
180
194
  - lib/puppet/util/tagging.rb
181
195
  - lib/puppet/util/fileparsing.rb
182
196
  - lib/puppet/util/provider_features.rb
@@ -189,7 +203,6 @@ files:
189
203
  - lib/puppet/util/autoload
190
204
  - lib/puppet/util/autoload/file_cache.rb
191
205
  - lib/puppet/util/queue.rb
192
- - lib/puppet/util/json.rb
193
206
  - lib/puppet/util/resource_template.rb
194
207
  - lib/puppet/util/docs.rb
195
208
  - lib/puppet/util/suidmanager.rb
@@ -347,9 +360,9 @@ files:
347
360
  - lib/puppet/sslcertificates/inventory.rb
348
361
  - lib/puppet/reports.rb
349
362
  - lib/puppet/feature
363
+ - lib/puppet/feature/pson.rb
350
364
  - lib/puppet/feature/rails.rb
351
365
  - lib/puppet/feature/stomp.rb
352
- - lib/puppet/feature/json.rb
353
366
  - lib/puppet/feature/rubygems.rb
354
367
  - lib/puppet/feature/rack.rb
355
368
  - lib/puppet/feature/base.rb
@@ -572,6 +585,13 @@ files:
572
585
  - lib/puppet/external/event-loop/signal-system.rb
573
586
  - lib/puppet/external/event-loop/better-definers.rb
574
587
  - lib/puppet/external/nagios.rb
588
+ - lib/puppet/external/pson
589
+ - lib/puppet/external/pson/pure.rb
590
+ - lib/puppet/external/pson/version.rb
591
+ - lib/puppet/external/pson/common.rb
592
+ - lib/puppet/external/pson/pure
593
+ - lib/puppet/external/pson/pure/generator.rb
594
+ - lib/puppet/external/pson/pure/parser.rb
575
595
  - lib/puppet/external/base64.rb
576
596
  - lib/puppet/ssl.rb
577
597
  - lib/puppet/resource
@@ -902,6 +922,7 @@ files:
902
922
  - test/data/providers/ssh_authorized_key
903
923
  - test/data/providers/ssh_authorized_key/parsed
904
924
  - test/data/providers/ssh_authorized_key/parsed/authorized_keys
925
+ - test/data/providers/ssh_authorized_key/parsed/authorized_keys2
905
926
  - test/data/providers/ssh_authorized_key/parsed/authorized_keys1
906
927
  - test/data/providers/package
907
928
  - test/data/providers/package/testpackages.yaml
@@ -1289,6 +1310,7 @@ files:
1289
1310
  - spec/unit/parser/functions/realize.rb
1290
1311
  - spec/unit/parser/functions/require.rb
1291
1312
  - spec/unit/parser/functions/split.rb
1313
+ - spec/unit/parser/functions/fqdn_rand.rb
1292
1314
  - spec/unit/parser/functions/versioncmp.rb
1293
1315
  - spec/unit/parser/functions/template.rb
1294
1316
  - spec/unit/parser/ast.rb
@@ -1360,6 +1382,7 @@ files:
1360
1382
  - spec/unit/type/group.rb
1361
1383
  - spec/unit/type/tidy.rb
1362
1384
  - spec/unit/type/zfs.rb
1385
+ - spec/unit/type/cron.rb
1363
1386
  - spec/unit/parameter.rb
1364
1387
  - spec/unit/indirector
1365
1388
  - spec/unit/indirector/code.rb
@@ -1,2 +0,0 @@
1
- # This is here so it autoloads correctly.
2
- Puppet.features.rails?