puppet 2.7.8 → 2.7.9

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 (98) hide show
  1. data/CHANGELOG +6 -0
  2. data/README_DEVELOPER.md +63 -0
  3. data/conf/redhat/puppet.spec +4 -1
  4. data/ext/puppetstoredconfigclean.rb +39 -27
  5. data/lib/puppet.rb +1 -1
  6. data/lib/puppet/application/agent.rb +33 -25
  7. data/lib/puppet/application/apply.rb +15 -1
  8. data/lib/puppet/application/module.rb +3 -0
  9. data/lib/puppet/defaults.rb +4 -0
  10. data/lib/puppet/face/module.rb +12 -0
  11. data/lib/puppet/face/module/build.rb +31 -0
  12. data/lib/puppet/face/module/changes.rb +38 -0
  13. data/lib/puppet/face/module/clean.rb +30 -0
  14. data/lib/puppet/face/module/generate.rb +40 -0
  15. data/lib/puppet/face/module/install.rb +83 -0
  16. data/lib/puppet/face/module/search.rb +66 -0
  17. data/lib/puppet/indirector/exec.rb +1 -1
  18. data/lib/puppet/module_tool.rb +97 -0
  19. data/lib/puppet/module_tool/applications.rb +12 -0
  20. data/lib/puppet/module_tool/applications/application.rb +83 -0
  21. data/lib/puppet/module_tool/applications/builder.rb +91 -0
  22. data/lib/puppet/module_tool/applications/checksummer.rb +47 -0
  23. data/lib/puppet/module_tool/applications/cleaner.rb +16 -0
  24. data/lib/puppet/module_tool/applications/generator.rb +141 -0
  25. data/lib/puppet/module_tool/applications/installer.rb +89 -0
  26. data/lib/puppet/module_tool/applications/searcher.rb +40 -0
  27. data/lib/puppet/module_tool/applications/unpacker.rb +70 -0
  28. data/lib/puppet/module_tool/cache.rb +56 -0
  29. data/lib/puppet/module_tool/checksums.rb +52 -0
  30. data/lib/puppet/module_tool/contents_description.rb +82 -0
  31. data/lib/puppet/module_tool/dependency.rb +24 -0
  32. data/lib/puppet/module_tool/metadata.rb +141 -0
  33. data/lib/puppet/module_tool/modulefile.rb +75 -0
  34. data/lib/puppet/module_tool/repository.rb +79 -0
  35. data/lib/puppet/module_tool/skeleton.rb +34 -0
  36. data/lib/puppet/module_tool/skeleton/templates/generator/Modulefile.erb +11 -0
  37. data/lib/puppet/module_tool/skeleton/templates/generator/README.erb +16 -0
  38. data/lib/puppet/module_tool/skeleton/templates/generator/manifests/init.pp.erb +41 -0
  39. data/lib/puppet/module_tool/skeleton/templates/generator/metadata.json +12 -0
  40. data/lib/puppet/module_tool/skeleton/templates/generator/spec/spec_helper.rb +17 -0
  41. data/lib/puppet/module_tool/skeleton/templates/generator/tests/init.pp.erb +11 -0
  42. data/lib/puppet/module_tool/utils.rb +5 -0
  43. data/lib/puppet/module_tool/utils/interrogation.rb +25 -0
  44. data/lib/puppet/network/http/api/v1.rb +2 -1
  45. data/lib/puppet/parser/functions/create_resources.rb +19 -4
  46. data/lib/puppet/rails.rb +1 -1
  47. data/lib/puppet/rails/database/schema.rb +1 -1
  48. data/lib/puppet/ssl/host.rb +16 -8
  49. data/lib/puppet/transaction.rb +1 -1
  50. data/lib/puppet/type/file.rb +7 -2
  51. data/lib/puppet/type/file/ctime.rb +1 -1
  52. data/lib/puppet/type/file/mtime.rb +1 -1
  53. data/lib/puppet/type/file/type.rb +1 -1
  54. data/lib/puppet/util/queue/stomp.rb +19 -6
  55. data/lib/puppet/util/zaml.rb +39 -5
  56. data/spec/fixtures/releases/jamtur01-apache/Modulefile +2 -0
  57. data/spec/fixtures/releases/jamtur01-apache/files/httpd +24 -0
  58. data/spec/fixtures/releases/jamtur01-apache/files/test.vhost +18 -0
  59. data/spec/fixtures/releases/jamtur01-apache/lib/puppet/provider/a2mod/debian.rb +21 -0
  60. data/spec/fixtures/releases/jamtur01-apache/lib/puppet/type/a2mod.rb +12 -0
  61. data/spec/fixtures/releases/jamtur01-apache/manifests/dev.pp +5 -0
  62. data/spec/fixtures/releases/jamtur01-apache/manifests/init.pp +34 -0
  63. data/spec/fixtures/releases/jamtur01-apache/manifests/params.pp +17 -0
  64. data/spec/fixtures/releases/jamtur01-apache/manifests/php.pp +5 -0
  65. data/spec/fixtures/releases/jamtur01-apache/manifests/ssl.pp +15 -0
  66. data/spec/fixtures/releases/jamtur01-apache/manifests/vhost.pp +15 -0
  67. data/spec/fixtures/releases/jamtur01-apache/metadata.json +1 -0
  68. data/spec/fixtures/releases/jamtur01-apache/templates/vhost-default.conf.erb +20 -0
  69. data/spec/fixtures/releases/jamtur01-apache/tests/apache.pp +1 -0
  70. data/spec/fixtures/releases/jamtur01-apache/tests/dev.pp +1 -0
  71. data/spec/fixtures/releases/jamtur01-apache/tests/init.pp +1 -0
  72. data/spec/fixtures/releases/jamtur01-apache/tests/php.pp +1 -0
  73. data/spec/fixtures/releases/jamtur01-apache/tests/ssl.pp +1 -0
  74. data/spec/fixtures/releases/jamtur01-apache/tests/vhost.pp +2 -0
  75. data/spec/integration/module_tool_spec.rb +477 -0
  76. data/spec/integration/util/windows/security_spec.rb +1 -1
  77. data/spec/unit/application/agent_spec.rb +26 -0
  78. data/spec/unit/application/apply_spec.rb +12 -1
  79. data/spec/unit/face/module/build_spec.rb +30 -0
  80. data/spec/unit/face/module/changes_spec.rb +30 -0
  81. data/spec/unit/face/module/clean_spec.rb +30 -0
  82. data/spec/unit/face/module/generate_spec.rb +30 -0
  83. data/spec/unit/face/module/install_spec.rb +75 -0
  84. data/spec/unit/face/module/search_spec.rb +40 -0
  85. data/spec/unit/face/module_spec.rb +3 -0
  86. data/spec/unit/file_bucket/dipper_spec.rb +1 -1
  87. data/spec/unit/module_tool/application_spec.rb +29 -0
  88. data/spec/unit/module_tool/metadata_spec.rb +11 -0
  89. data/spec/unit/module_tool/repository_spec.rb +52 -0
  90. data/spec/unit/module_tool_spec.rb +38 -0
  91. data/spec/unit/network/http/api/v1_spec.rb +4 -0
  92. data/spec/unit/parser/functions/create_resources_spec.rb +21 -4
  93. data/spec/unit/rails_spec.rb +89 -158
  94. data/spec/unit/ssl/host_spec.rb +10 -33
  95. data/spec/unit/type/file_spec.rb +30 -0
  96. data/spec/unit/util/queue/stomp_spec.rb +9 -4
  97. data/spec/unit/util/zaml_spec.rb +37 -0
  98. metadata +77 -11
@@ -1253,6 +1253,36 @@ describe Puppet::Type.type(:file) do
1253
1253
  end
1254
1254
 
1255
1255
  describe "when autorequiring" do
1256
+ describe "target" do
1257
+ it "should require file resource when specified with the target property" do
1258
+ file = described_class.new(:path => File.expand_path("/foo"), :ensure => :directory)
1259
+ link = described_class.new(:path => File.expand_path("/bar"), :ensure => :symlink, :target => File.expand_path("/foo"))
1260
+ catalog.add_resource file
1261
+ catalog.add_resource link
1262
+ reqs = link.autorequire
1263
+ reqs.size.must == 1
1264
+ reqs[0].source.must == file
1265
+ reqs[0].target.must == link
1266
+ end
1267
+
1268
+ it "should require file resource when specified with the ensure property" do
1269
+ file = described_class.new(:path => File.expand_path("/foo"), :ensure => :directory)
1270
+ link = described_class.new(:path => File.expand_path("/bar"), :ensure => File.expand_path("/foo"))
1271
+ catalog.add_resource file
1272
+ catalog.add_resource link
1273
+ reqs = link.autorequire
1274
+ reqs.size.must == 1
1275
+ reqs[0].source.must == file
1276
+ reqs[0].target.must == link
1277
+ end
1278
+
1279
+ it "should not require target if target is not managed" do
1280
+ link = described_class.new(:path => File.expand_path('/foo'), :ensure => :symlink, :target => '/bar')
1281
+ catalog.add_resource link
1282
+ link.autorequire.size.should == 0
1283
+ end
1284
+ end
1285
+
1256
1286
  describe "directories" do
1257
1287
  it "should autorequire its parent directory" do
1258
1288
  dir = described_class.new(:path => File.dirname(path))
@@ -13,7 +13,7 @@ describe 'Puppet::Util::Queue::Stomp', :if => Puppet.features.stomp?, :'fails_on
13
13
  before do
14
14
  # So we make sure we never create a real client instance.
15
15
  # Otherwise we'll try to connect, and that's bad.
16
- Stomp::Client.stubs(:new).returns stub("client")
16
+ Stomp::Client.stubs(:new).returns stub("client", :publish => true)
17
17
  end
18
18
 
19
19
  it 'should be registered with Puppet::Util::Queue as :stomp type' do
@@ -22,7 +22,7 @@ describe 'Puppet::Util::Queue::Stomp', :if => Puppet.features.stomp?, :'fails_on
22
22
 
23
23
  describe "when initializing" do
24
24
  it "should create a Stomp client instance" do
25
- Stomp::Client.expects(:new).returns stub("stomp_client")
25
+ Stomp::Client.expects(:new).returns stub("stomp_client", :publish => true)
26
26
  Puppet::Util::Queue::Stomp.new
27
27
  end
28
28
 
@@ -65,7 +65,7 @@ describe 'Puppet::Util::Queue::Stomp', :if => Puppet.features.stomp?, :'fails_on
65
65
 
66
66
  describe "when publishing a message" do
67
67
  before do
68
- @client = stub 'client'
68
+ @client = stub 'client', :publish => true
69
69
  Stomp::Client.stubs(:new).returns @client
70
70
  @queue = Puppet::Util::Queue::Stomp.new
71
71
  end
@@ -84,11 +84,16 @@ describe 'Puppet::Util::Queue::Stomp', :if => Puppet.features.stomp?, :'fails_on
84
84
  @client.expects(:publish).with { |queue, msg, options| options[:persistent] == true }
85
85
  @queue.publish_message('fooqueue', 'Smite!')
86
86
  end
87
+
88
+ it "should use send when the gem does not support publish" do
89
+ Stomp::Client.stubs(:new).returns(stub('client', :send => true))
90
+ Puppet::Util::Queue::Stomp.new.publish_message('fooqueue', 'Smite!')
91
+ end
87
92
  end
88
93
 
89
94
  describe "when subscribing to a queue" do
90
95
  before do
91
- @client = stub 'client', :acknowledge => true
96
+ @client = stub 'client', :acknowledge => true, :publish => true
92
97
  Stomp::Client.stubs(:new).returns @client
93
98
  @queue = Puppet::Util::Queue::Stomp.new
94
99
  end
@@ -1,4 +1,16 @@
1
1
  #!/usr/bin/env rspec
2
+ # encoding: UTF-8
3
+ #
4
+ # The above encoding line is a magic comment to set the default source encoding
5
+ # of this file for the Ruby interpreter. It must be on the first or second
6
+ # line of the file if an interpreter is in use. In Ruby 1.9 and later, the
7
+ # source encoding determines the encoding of String and Regexp objects created
8
+ # from this source file. This explicit encoding is important becuase otherwise
9
+ # Ruby will pick an encoding based on LANG or LC_CTYPE environment variables.
10
+ # These may be different from site to site so it's important for us to
11
+ # establish a consistent behavior. For more information on M17n please see:
12
+ # http://links.puppetlabs.com/understanding_m17n
13
+
2
14
  require 'spec_helper'
3
15
 
4
16
  require 'puppet/util/monkey_patches'
@@ -60,3 +72,28 @@ describe "Pure ruby yaml implementation" do
60
72
  x2[2].should equal(x2)
61
73
  end
62
74
  end
75
+
76
+ # Note, many of these tests will pass on Ruby 1.8 but fail on 1.9 if the patch
77
+ # fix is not applied to Puppet or there's a regression. These version
78
+ # dependant failures are intentional since the string encoding behavior changed
79
+ # significantly in 1.9.
80
+ describe "UTF-8 encoded String#to_yaml (Bug #11246)" do
81
+ # JJM All of these snowmen are different representations of the same
82
+ # UTF-8 encoded string.
83
+ let(:snowman) { 'Snowman: [☃]' }
84
+ let(:snowman_escaped) { "Snowman: [\xE2\x98\x83]" }
85
+
86
+ describe "UTF-8 String Literal" do
87
+ subject { snowman }
88
+
89
+ it "should serialize to YAML" do
90
+ subject.to_yaml
91
+ end
92
+ it "should serialize and deserialize to the same thing" do
93
+ YAML.load(subject.to_yaml).should == subject
94
+ end
95
+ it "should serialize and deserialize to a String compatible with a UTF-8 encoded Regexp" do
96
+ YAML.load(subject.to_yaml).should =~ /☃/u
97
+ end
98
+ end
99
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 7
9
- - 8
10
- version: 2.7.8
9
+ - 9
10
+ version: 2.7.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Puppet Labs
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-12-09 00:00:00 Z
18
+ date: 2011-12-10 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: facter
@@ -39,13 +39,13 @@ executables:
39
39
  - filebucket
40
40
  - pi
41
41
  - puppet
42
+ - puppetdoc
43
+ - ralsh
42
44
  - puppetca
43
45
  - puppetd
44
- - puppetdoc
45
46
  - puppetmasterd
46
47
  - puppetqd
47
48
  - puppetrun
48
- - ralsh
49
49
  extensions: []
50
50
 
51
51
  extra_rdoc_files: []
@@ -56,16 +56,12 @@ files:
56
56
  - LICENSE
57
57
  - Rakefile
58
58
  - README.md
59
+ - README_DEVELOPER.md
59
60
  - install.rb
60
61
  - bin/filebucket
61
62
  - bin/pi
62
63
  - bin/puppet
63
- - bin/puppetca
64
- - bin/puppetd
65
64
  - bin/puppetdoc
66
- - bin/puppetmasterd
67
- - bin/puppetqd
68
- - bin/puppetrun
69
65
  - bin/ralsh
70
66
  - lib/puppet/agent/locker.rb
71
67
  - lib/puppet/agent.rb
@@ -92,6 +88,7 @@ files:
92
88
  - lib/puppet/application/kick.rb
93
89
  - lib/puppet/application/man.rb
94
90
  - lib/puppet/application/master.rb
91
+ - lib/puppet/application/module.rb
95
92
  - lib/puppet/application/node.rb
96
93
  - lib/puppet/application/parser.rb
97
94
  - lib/puppet/application/plugin.rb
@@ -147,6 +144,13 @@ files:
147
144
  - lib/puppet/face/help.rb
148
145
  - lib/puppet/face/key.rb
149
146
  - lib/puppet/face/man.rb
147
+ - lib/puppet/face/module/build.rb
148
+ - lib/puppet/face/module/changes.rb
149
+ - lib/puppet/face/module/clean.rb
150
+ - lib/puppet/face/module/generate.rb
151
+ - lib/puppet/face/module/install.rb
152
+ - lib/puppet/face/module/search.rb
153
+ - lib/puppet/face/module.rb
150
154
  - lib/puppet/face/node/clean.rb
151
155
  - lib/puppet/face/node.rb
152
156
  - lib/puppet/face/parser.rb
@@ -281,6 +285,32 @@ files:
281
285
  - lib/puppet/interface.rb
282
286
  - lib/puppet/metatype/manager.rb
283
287
  - lib/puppet/module.rb
288
+ - lib/puppet/module_tool/applications/application.rb
289
+ - lib/puppet/module_tool/applications/builder.rb
290
+ - lib/puppet/module_tool/applications/checksummer.rb
291
+ - lib/puppet/module_tool/applications/cleaner.rb
292
+ - lib/puppet/module_tool/applications/generator.rb
293
+ - lib/puppet/module_tool/applications/installer.rb
294
+ - lib/puppet/module_tool/applications/searcher.rb
295
+ - lib/puppet/module_tool/applications/unpacker.rb
296
+ - lib/puppet/module_tool/applications.rb
297
+ - lib/puppet/module_tool/cache.rb
298
+ - lib/puppet/module_tool/checksums.rb
299
+ - lib/puppet/module_tool/contents_description.rb
300
+ - lib/puppet/module_tool/dependency.rb
301
+ - lib/puppet/module_tool/metadata.rb
302
+ - lib/puppet/module_tool/modulefile.rb
303
+ - lib/puppet/module_tool/repository.rb
304
+ - lib/puppet/module_tool/skeleton/templates/generator/manifests/init.pp.erb
305
+ - lib/puppet/module_tool/skeleton/templates/generator/metadata.json
306
+ - lib/puppet/module_tool/skeleton/templates/generator/Modulefile.erb
307
+ - lib/puppet/module_tool/skeleton/templates/generator/README.erb
308
+ - lib/puppet/module_tool/skeleton/templates/generator/spec/spec_helper.rb
309
+ - lib/puppet/module_tool/skeleton/templates/generator/tests/init.pp.erb
310
+ - lib/puppet/module_tool/skeleton.rb
311
+ - lib/puppet/module_tool/utils/interrogation.rb
312
+ - lib/puppet/module_tool/utils.rb
313
+ - lib/puppet/module_tool.rb
284
314
  - lib/puppet/network/authconfig.rb
285
315
  - lib/puppet/network/authorization.rb
286
316
  - lib/puppet/network/authstore.rb
@@ -1074,6 +1104,25 @@ files:
1074
1104
  - test/util/utiltest.rb
1075
1105
  - spec/fixtures/faulty_face/puppet/face/syntax.rb
1076
1106
  - spec/fixtures/integration/provider/mailalias/aliases/test1
1107
+ - spec/fixtures/releases/jamtur01-apache/files/httpd
1108
+ - spec/fixtures/releases/jamtur01-apache/files/test.vhost
1109
+ - spec/fixtures/releases/jamtur01-apache/lib/puppet/provider/a2mod/debian.rb
1110
+ - spec/fixtures/releases/jamtur01-apache/lib/puppet/type/a2mod.rb
1111
+ - spec/fixtures/releases/jamtur01-apache/manifests/dev.pp
1112
+ - spec/fixtures/releases/jamtur01-apache/manifests/init.pp
1113
+ - spec/fixtures/releases/jamtur01-apache/manifests/params.pp
1114
+ - spec/fixtures/releases/jamtur01-apache/manifests/php.pp
1115
+ - spec/fixtures/releases/jamtur01-apache/manifests/ssl.pp
1116
+ - spec/fixtures/releases/jamtur01-apache/manifests/vhost.pp
1117
+ - spec/fixtures/releases/jamtur01-apache/metadata.json
1118
+ - spec/fixtures/releases/jamtur01-apache/Modulefile
1119
+ - spec/fixtures/releases/jamtur01-apache/templates/vhost-default.conf.erb
1120
+ - spec/fixtures/releases/jamtur01-apache/tests/apache.pp
1121
+ - spec/fixtures/releases/jamtur01-apache/tests/dev.pp
1122
+ - spec/fixtures/releases/jamtur01-apache/tests/init.pp
1123
+ - spec/fixtures/releases/jamtur01-apache/tests/php.pp
1124
+ - spec/fixtures/releases/jamtur01-apache/tests/ssl.pp
1125
+ - spec/fixtures/releases/jamtur01-apache/tests/vhost.pp
1077
1126
  - spec/fixtures/unit/parser/lexer/aliastest.pp
1078
1127
  - spec/fixtures/unit/parser/lexer/append.pp
1079
1128
  - spec/fixtures/unit/parser/lexer/argumentdefaults.pp
@@ -1157,6 +1206,7 @@ files:
1157
1206
  - spec/integration/indirector/file_content/file_server_spec.rb
1158
1207
  - spec/integration/indirector/file_metadata/file_server_spec.rb
1159
1208
  - spec/integration/indirector/node/ldap_spec.rb
1209
+ - spec/integration/module_tool_spec.rb
1160
1210
  - spec/integration/network/formats_spec.rb
1161
1211
  - spec/integration/network/handler_spec.rb
1162
1212
  - spec/integration/network/rest_authconfig_spec.rb
@@ -1259,6 +1309,13 @@ files:
1259
1309
  - spec/unit/face/file_spec.rb
1260
1310
  - spec/unit/face/help_spec.rb
1261
1311
  - spec/unit/face/key_spec.rb
1312
+ - spec/unit/face/module/build_spec.rb
1313
+ - spec/unit/face/module/changes_spec.rb
1314
+ - spec/unit/face/module/clean_spec.rb
1315
+ - spec/unit/face/module/generate_spec.rb
1316
+ - spec/unit/face/module/install_spec.rb
1317
+ - spec/unit/face/module/search_spec.rb
1318
+ - spec/unit/face/module_spec.rb
1262
1319
  - spec/unit/face/node_spec.rb
1263
1320
  - spec/unit/face/plugin_spec.rb
1264
1321
  - spec/unit/face/report_spec.rb
@@ -1367,6 +1424,10 @@ files:
1367
1424
  - spec/unit/interface/option_spec.rb
1368
1425
  - spec/unit/interface_spec.rb
1369
1426
  - spec/unit/module_spec.rb
1427
+ - spec/unit/module_tool/application_spec.rb
1428
+ - spec/unit/module_tool/metadata_spec.rb
1429
+ - spec/unit/module_tool/repository_spec.rb
1430
+ - spec/unit/module_tool_spec.rb
1370
1431
  - spec/unit/network/authconfig_spec.rb
1371
1432
  - spec/unit/network/authstore_spec.rb
1372
1433
  - spec/unit/network/format_handler_spec.rb
@@ -1675,6 +1736,11 @@ files:
1675
1736
  - spec/unit/util/zaml_spec.rb
1676
1737
  - spec/unit/util_spec.rb
1677
1738
  - spec/watchr.rb
1739
+ - bin/puppetca
1740
+ - bin/puppetd
1741
+ - bin/puppetmasterd
1742
+ - bin/puppetqd
1743
+ - bin/puppetrun
1678
1744
  homepage: http://puppetlabs.com
1679
1745
  licenses: []
1680
1746