puppet 2.7.14 → 2.7.16
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.
- data/CHANGELOG +85 -0
- data/conf/redhat/puppet.spec +31 -4
- data/lib/puppet.rb +1 -1
- data/lib/puppet/defaults.rb +2 -3
- data/lib/puppet/face/module/install.rb +3 -3
- data/lib/puppet/face/module/search.rb +3 -3
- data/lib/puppet/indirector/face.rb +1 -1
- data/lib/puppet/network/http_pool.rb +17 -8
- data/lib/puppet/node/environment.rb +1 -3
- data/lib/puppet/parser/ast.rb +1 -1
- data/lib/puppet/parser/compiler.rb +2 -10
- data/lib/puppet/parser/functions/template.rb +2 -1
- data/lib/puppet/parser/lexer.rb +2 -2
- data/lib/puppet/parser/scope.rb +3 -2
- data/lib/puppet/provider/package/gem.rb +3 -1
- data/lib/puppet/provider/package/pkg.rb +18 -2
- data/lib/puppet/provider/service/gentoo.rb +5 -0
- data/lib/puppet/provider/service/init.rb +12 -14
- data/lib/puppet/provider/service/redhat.rb +1 -1
- data/lib/puppet/provider/service/upstart.rb +257 -7
- data/lib/puppet/provider/ssh_authorized_key/parsed.rb +6 -9
- data/lib/puppet/reports/http.rb +1 -1
- data/lib/puppet/reports/tagmail.rb +1 -1
- data/lib/puppet/type/cron.rb +5 -0
- data/lib/puppet/type/filebucket.rb +12 -0
- data/lib/puppet/util.rb +15 -9
- data/lib/puppet/util/colors.rb +94 -64
- data/lib/puppet/util/platform.rb +15 -0
- data/man/man5/puppet.conf.5 +73 -27
- data/man/man8/filebucket.8 +1 -1
- data/man/man8/pi.8 +1 -1
- data/man/man8/puppet-agent.8 +17 -17
- data/man/man8/puppet-apply.8 +8 -3
- data/man/man8/puppet-ca.8 +183 -0
- data/man/man8/puppet-catalog.8 +17 -10
- data/man/man8/puppet-cert.8 +1 -1
- data/man/man8/puppet-certificate.8 +27 -11
- data/man/man8/puppet-certificate_request.8 +12 -11
- data/man/man8/puppet-certificate_revocation_list.8 +11 -10
- data/man/man8/puppet-config.8 +1 -1
- data/man/man8/puppet-describe.8 +1 -1
- data/man/man8/puppet-device.8 +2 -2
- data/man/man8/puppet-doc.8 +15 -3
- data/man/man8/puppet-facts.8 +18 -8
- data/man/man8/puppet-file.8 +13 -22
- data/man/man8/puppet-filebucket.8 +1 -1
- data/man/man8/puppet-help.8 +1 -1
- data/man/man8/puppet-inspect.8 +10 -2
- data/man/man8/puppet-instrumentation_data.8 +145 -0
- data/man/man8/puppet-instrumentation_listener.8 +222 -0
- data/man/man8/puppet-instrumentation_probe.8 +207 -0
- data/man/man8/puppet-key.8 +11 -7
- data/man/man8/puppet-kick.8 +35 -3
- data/man/man8/puppet-man.8 +1 -1
- data/man/man8/puppet-master.8 +1 -1
- data/man/man8/puppet-module.8 +451 -0
- data/man/man8/puppet-node.8 +64 -22
- data/man/man8/puppet-parser.8 +1 -1
- data/man/man8/puppet-plugin.8 +1 -1
- data/man/man8/puppet-queue.8 +1 -1
- data/man/man8/puppet-report.8 +12 -8
- data/man/man8/puppet-resource.8 +1 -1
- data/man/man8/puppet-resource_type.8 +11 -7
- data/man/man8/puppet-secret_agent.8 +1 -1
- data/man/man8/puppet-status.8 +11 -7
- data/man/man8/puppet.8 +1 -1
- data/man/man8/puppetca.8 +1 -1
- data/man/man8/puppetd.8 +17 -17
- data/man/man8/puppetdoc.8 +15 -3
- data/man/man8/puppetmasterd.8 +1 -1
- data/man/man8/puppetqd.8 +1 -1
- data/man/man8/puppetrun.8 +35 -3
- data/man/man8/ralsh.8 +1 -1
- data/spec/fixtures/unit/provider/package/gem/line-with-1.8.5-warning +14 -0
- data/spec/fixtures/unit/provider/package/pkg/{dummy → dummy_solaris10} +0 -0
- data/spec/fixtures/unit/provider/package/pkg/dummy_solaris11 +1 -0
- data/spec/fixtures/unit/provider/package/pkg/solaris11 +12 -0
- data/spec/fixtures/unit/provider/package/pkg/unknown_status +12 -0
- data/spec/fixtures/unit/provider/service/gentoo/rc_update_show +30 -0
- data/spec/integration/defaults_spec.rb +2 -7
- data/spec/integration/network/server/mongrel_spec.rb +16 -10
- data/spec/integration/network/server/webrick_spec.rb +16 -9
- data/spec/integration/provider/service/init_spec.rb +20 -4
- data/spec/integration/provider/ssh_authorized_key_spec.rb +119 -107
- data/spec/unit/face/module/install_spec.rb +16 -4
- data/spec/unit/network/http/api/v1_spec.rb +8 -0
- data/spec/unit/network/http_pool_spec.rb +80 -74
- data/spec/unit/node/environment_spec.rb +9 -4
- data/spec/unit/parser/ast/leaf_spec.rb +2 -2
- data/spec/unit/parser/ast_spec.rb +3 -3
- data/spec/unit/parser/compiler_spec.rb +0 -17
- data/spec/unit/parser/lexer_spec.rb +45 -2
- data/spec/unit/parser/scope_spec.rb +181 -14
- data/spec/unit/provider/package/gem_spec.rb +17 -1
- data/spec/unit/provider/package/pkg_spec.rb +70 -22
- data/spec/unit/provider/service/gentoo_spec.rb +237 -0
- data/spec/unit/provider/service/init_spec.rb +2 -2
- data/spec/unit/provider/service/redhat_spec.rb +2 -2
- data/spec/unit/provider/service/upstart_spec.rb +414 -5
- data/spec/unit/provider/ssh_authorized_key/parsed_spec.rb +24 -0
- data/spec/unit/reports/tagmail_spec.rb +50 -0
- data/spec/unit/type/cron_spec.rb +21 -1
- data/spec/unit/type/filebucket_spec.rb +39 -9
- data/spec/unit/util/colors_spec.rb +69 -0
- data/spec/unit/util/log/destinations_spec.rb +17 -9
- data/spec/unit/util/log_spec.rb +2 -1
- data/spec/unit/util_spec.rb +11 -0
- data/tasks/rake/gem.rake +1 -1
- data/tasks/rake/manpages.rake +11 -3
- data/test/network/handler/fileserver.rb +7 -1
- metadata +22 -10
@@ -63,6 +63,30 @@ describe provider_class, :unless => Puppet.features.microsoft_windows? do
|
|
63
63
|
genkey(key).should == "from=\"192.168.1.1\",no-pty,no-X11-forwarding ssh-rsa AAAAfsfddsjldjgksdflgkjsfdlgkj root@localhost\n"
|
64
64
|
end
|
65
65
|
|
66
|
+
it "should parse comments" do
|
67
|
+
result = [{ :record_type => :comment, :line => "# hello" }]
|
68
|
+
@provider_class.parse("# hello\n").should == result
|
69
|
+
end
|
70
|
+
|
71
|
+
it "should parse comments with leading whitespace" do
|
72
|
+
result = [{ :record_type => :comment, :line => " # hello" }]
|
73
|
+
@provider_class.parse(" # hello\n").should == result
|
74
|
+
end
|
75
|
+
|
76
|
+
it "should skip over lines with only whitespace" do
|
77
|
+
result = [{ :record_type => :comment, :line => "#before" },
|
78
|
+
{ :record_type => :blank, :line => " " },
|
79
|
+
{ :record_type => :comment, :line => "#after" }]
|
80
|
+
@provider_class.parse("#before\n \n#after\n").should == result
|
81
|
+
end
|
82
|
+
|
83
|
+
it "should skip over completely empty lines" do
|
84
|
+
result = [{ :record_type => :comment, :line => "#before"},
|
85
|
+
{ :record_type => :blank, :line => ""},
|
86
|
+
{ :record_type => :comment, :line => "#after"}]
|
87
|
+
@provider_class.parse("#before\n\n#after\n").should == result
|
88
|
+
end
|
89
|
+
|
66
90
|
it "should be able to parse name if it includes whitespace" do
|
67
91
|
@provider_class.parse_line('ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC7pHZ1XRj3tXbFpPFhMGU1bVwz7jr13zt/wuE+pVIJA8GlmHYuYtIxHPfDHlkixdwLachCpSQUL9NbYkkRFRn9m6PZ7125ohE4E4m96QS6SGSQowTiRn4Lzd9LV38g93EMHjPmEkdSq7MY4uJEd6DUYsLvaDYdIgBiLBIWPA3OrQ== fancy user')[:name].should == 'fancy user'
|
68
92
|
@provider_class.parse_line('from="host1.reductlivelabs.com,host.reductivelabs.com",command="/usr/local/bin/run",ssh-pty ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC7pHZ1XRj3tXbFpPFhMGU1bVwz7jr13zt/wuE+pVIJA8GlmHYuYtIxHPfDHlkixdwLachCpSQUL9NbYkkRFRn9m6PZ7125ohE4E4m96QS6SGSQowTiRn4Lzd9LV38g93EMHjPmEkdSq7MY4uJEd6DUYsLvaDYdIgBiLBIWPA3OrQ== fancy user')[:name].should == 'fancy user'
|
@@ -163,6 +163,56 @@ describe tagmail do
|
|
163
163
|
processor.process
|
164
164
|
end
|
165
165
|
end
|
166
|
+
|
167
|
+
context "when no message match a positive tag" do
|
168
|
+
before do
|
169
|
+
processor << log_entry
|
170
|
+
end
|
171
|
+
|
172
|
+
let(:log_entry) do
|
173
|
+
Puppet::Util::Log.new(
|
174
|
+
:level => :notice,
|
175
|
+
:message => 'Unnotices change',
|
176
|
+
:tags => %w{not_present_in_tagmail.conf}
|
177
|
+
)
|
178
|
+
end
|
179
|
+
|
180
|
+
it "should send no email if there are changes" do
|
181
|
+
processor.expects(:send).never
|
182
|
+
processor.expects(:raw_summary).returns({
|
183
|
+
"resources" => { "changed" => 1, "out_of_sync" => 0 }
|
184
|
+
})
|
185
|
+
processor.process
|
186
|
+
end
|
187
|
+
|
188
|
+
it "should send no email if there are resources out of sync" do
|
189
|
+
processor.expects(:send).never
|
190
|
+
processor.expects(:raw_summary).returns({
|
191
|
+
"resources" => { "changed" => 0, "out_of_sync" => 1 }
|
192
|
+
})
|
193
|
+
processor.process
|
194
|
+
end
|
195
|
+
|
196
|
+
it "should send no email if no changes or resources out of sync" do
|
197
|
+
processor.expects(:send).never
|
198
|
+
processor.expects(:raw_summary).returns({
|
199
|
+
"resources" => { "changed" => 0, "out_of_sync" => 0 }
|
200
|
+
})
|
201
|
+
processor.process
|
202
|
+
end
|
203
|
+
|
204
|
+
it "should send no email if raw_summary is not defined" do
|
205
|
+
processor.expects(:send).never
|
206
|
+
processor.expects(:raw_summary).returns(nil)
|
207
|
+
processor.process
|
208
|
+
end
|
209
|
+
|
210
|
+
it "should send no email if there are no resource metrics" do
|
211
|
+
processor.expects(:send).never
|
212
|
+
processor.expects(:raw_summary).returns({'resources' => nil})
|
213
|
+
processor.process
|
214
|
+
end
|
215
|
+
end
|
166
216
|
end
|
167
217
|
end
|
168
218
|
|
data/spec/unit/type/cron_spec.rb
CHANGED
@@ -34,7 +34,8 @@ describe Puppet::Type.type(:cron), :unless => Puppet.features.microsoft_windows?
|
|
34
34
|
end
|
35
35
|
|
36
36
|
|
37
|
-
describe "when validating
|
37
|
+
describe "when validating values" do
|
38
|
+
|
38
39
|
describe "ensure" do
|
39
40
|
it "should support present as a value for ensure" do
|
40
41
|
proc { described_class.new(:name => 'foo', :ensure => :present) }.should_not raise_error
|
@@ -459,6 +460,25 @@ describe Puppet::Type.type(:cron), :unless => Puppet.features.microsoft_windows?
|
|
459
460
|
end
|
460
461
|
end
|
461
462
|
|
463
|
+
describe "when autorequiring resources" do
|
464
|
+
|
465
|
+
before :each do
|
466
|
+
@user_bob = Puppet::Type.type(:user).new(:name => 'bob', :ensure => :present)
|
467
|
+
@user_alice = Puppet::Type.type(:user).new(:name => 'alice', :ensure => :present)
|
468
|
+
@catalog = Puppet::Resource::Catalog.new
|
469
|
+
@catalog.add_resource @user_bob, @user_alice
|
470
|
+
end
|
471
|
+
|
472
|
+
it "should autorequire the user" do
|
473
|
+
@resource = described_class.new(:name => 'dummy', :command => '/usr/bin/uptime', :user => 'alice')
|
474
|
+
@catalog.add_resource @resource
|
475
|
+
req = @resource.autorequire
|
476
|
+
req.size.should == 1
|
477
|
+
req[0].target.must == @resource
|
478
|
+
req[0].source.must == @user_alice
|
479
|
+
end
|
480
|
+
end
|
481
|
+
|
462
482
|
it "should require a command when adding an entry" do
|
463
483
|
entry = described_class.new(:name => "test_entry", :ensure => :present)
|
464
484
|
expect { entry.value(:command) }.should raise_error(Puppet::Error, /No command/)
|
@@ -2,6 +2,8 @@
|
|
2
2
|
require 'spec_helper'
|
3
3
|
|
4
4
|
describe Puppet::Type.type(:filebucket) do
|
5
|
+
include PuppetSpec::Files
|
6
|
+
|
5
7
|
describe "when validating attributes" do
|
6
8
|
%w{name server port path}.each do |attr|
|
7
9
|
it "should have a '#{attr}' parameter" do
|
@@ -35,16 +37,42 @@ describe Puppet::Type.type(:filebucket) do
|
|
35
37
|
bucket.bucket.should be_local
|
36
38
|
end
|
37
39
|
|
38
|
-
|
39
|
-
bucket
|
40
|
+
describe "path" do
|
41
|
+
def bucket(hash)
|
42
|
+
Puppet::Type.type(:filebucket).new({:name => 'main'}.merge(hash))
|
43
|
+
end
|
40
44
|
|
41
|
-
|
42
|
-
|
45
|
+
it "should accept false as a value" do
|
46
|
+
expect { bucket(:path => false) }.not_to raise_error
|
47
|
+
end
|
43
48
|
|
44
|
-
|
45
|
-
|
49
|
+
it "should accept true as a value" do
|
50
|
+
expect { bucket(:path => true) }.not_to raise_error
|
51
|
+
end
|
46
52
|
|
47
|
-
|
53
|
+
it "should fail when given an array of values" do
|
54
|
+
expect { bucket(:path => ['one', 'two']) }.
|
55
|
+
to raise_error Puppet::Error, /only have one filebucket path/
|
56
|
+
end
|
57
|
+
|
58
|
+
%w{one ../one one/two}.each do |path|
|
59
|
+
it "should fail if given a relative path of #{path.inspect}" do
|
60
|
+
expect { bucket(:path => path) }.
|
61
|
+
to raise_error Puppet::Error, /Filebucket paths must be absolute/
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
it "should succeed if given an absolute path" do
|
66
|
+
expect { bucket(:path => make_absolute('/tmp/bucket')) }.not_to raise_error
|
67
|
+
end
|
68
|
+
|
69
|
+
it "not be local if path is false" do
|
70
|
+
bucket(:path => false).bucket.should_not be_local
|
71
|
+
end
|
72
|
+
|
73
|
+
it "be local if both a path and a server are specified" do
|
74
|
+
bucket(:server => "puppet", :path => make_absolute("/my/path")).bucket.should be_local
|
75
|
+
end
|
48
76
|
end
|
49
77
|
|
50
78
|
describe "when creating the filebucket" do
|
@@ -53,10 +81,12 @@ describe Puppet::Type.type(:filebucket) do
|
|
53
81
|
end
|
54
82
|
|
55
83
|
it "should use any provided path" do
|
56
|
-
|
57
|
-
Puppet::
|
84
|
+
path = make_absolute("/foo/bar")
|
85
|
+
bucket = Puppet::Type.type(:filebucket).new :name => "main", :path => path
|
86
|
+
Puppet::FileBucket::Dipper.expects(:new).with(:Path => path).returns @bucket
|
58
87
|
bucket.bucket
|
59
88
|
end
|
89
|
+
|
60
90
|
it "should use any provided server and port" do
|
61
91
|
bucket = Puppet::Type.type(:filebucket).new :name => "main", :server => "myserv", :port => "myport", :path => false
|
62
92
|
Puppet::FileBucket::Dipper.expects(:new).with(:Server => "myserv", :Port => "myport").returns @bucket
|
@@ -0,0 +1,69 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe Puppet::Util::Colors do
|
5
|
+
include Puppet::Util::Colors
|
6
|
+
|
7
|
+
let (:message) { 'a message' }
|
8
|
+
let (:color) { :black }
|
9
|
+
let (:subject) { self }
|
10
|
+
|
11
|
+
describe ".console_color" do
|
12
|
+
it { should respond_to :console_color }
|
13
|
+
|
14
|
+
it "should generate ANSI escape sequences" do
|
15
|
+
subject.console_color(color, message).should == "\e[0;30m#{message}\e[0m"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
describe ".html_color" do
|
20
|
+
it { should respond_to :html_color }
|
21
|
+
|
22
|
+
it "should generate an HTML span element and style attribute" do
|
23
|
+
subject.html_color(color, message).should =~ /<span style=\"color: #FFA0A0\">#{message}<\/span>/
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
describe ".colorize" do
|
28
|
+
it { should respond_to :colorize }
|
29
|
+
|
30
|
+
context "ansicolor supported" do
|
31
|
+
before :each do
|
32
|
+
subject.stubs(:console_has_color?).returns(true)
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should colorize console output" do
|
36
|
+
Puppet[:color] = true
|
37
|
+
|
38
|
+
subject.expects(:console_color).with(color, message)
|
39
|
+
subject.colorize(:black, message)
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should not colorize unknown color schemes" do
|
43
|
+
Puppet[:color] = :thisisanunknownscheme
|
44
|
+
|
45
|
+
subject.colorize(:black, message).should == message
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
context "ansicolor not supported" do
|
50
|
+
before :each do
|
51
|
+
subject.stubs(:console_has_color?).returns(false)
|
52
|
+
end
|
53
|
+
|
54
|
+
it "should not colorize console output" do
|
55
|
+
Puppet[:color] = true
|
56
|
+
|
57
|
+
subject.expects(:console_color).never
|
58
|
+
subject.colorize(:black, message).should == message
|
59
|
+
end
|
60
|
+
|
61
|
+
it "should colorize html output" do
|
62
|
+
Puppet[:color] = :html
|
63
|
+
|
64
|
+
subject.expects(:html_color).with(color, message)
|
65
|
+
subject.colorize(color, message)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#!/usr/bin/env rspec
|
1
|
+
#!/usr/bin/env ruby -S rspec
|
2
2
|
require 'spec_helper'
|
3
3
|
|
4
4
|
require 'puppet/util/log'
|
@@ -107,24 +107,28 @@ end
|
|
107
107
|
|
108
108
|
describe Puppet::Util::Log.desttypes[:console] do
|
109
109
|
describe "when color is available" do
|
110
|
+
before :each do
|
111
|
+
subject.stubs(:console_has_color?).returns(true)
|
112
|
+
end
|
113
|
+
|
110
114
|
it "should support color output" do
|
111
|
-
Puppet
|
115
|
+
Puppet[:color] = true
|
112
116
|
subject.colorize(:red, 'version').should == "\e[0;31mversion\e[0m"
|
113
117
|
end
|
114
118
|
|
115
119
|
it "should withhold color output when not appropriate" do
|
116
|
-
Puppet
|
120
|
+
Puppet[:color] = false
|
117
121
|
subject.colorize(:red, 'version').should == "version"
|
118
122
|
end
|
119
123
|
|
120
124
|
it "should handle multiple overlapping colors in a stack-like way" do
|
121
|
-
Puppet
|
125
|
+
Puppet[:color] = true
|
122
126
|
vstring = subject.colorize(:red, 'version')
|
123
127
|
subject.colorize(:green, "(#{vstring})").should == "\e[0;32m(\e[0;31mversion\e[0;32m)\e[0m"
|
124
128
|
end
|
125
129
|
|
126
130
|
it "should handle resets in a stack-like way" do
|
127
|
-
Puppet
|
131
|
+
Puppet[:color] = true
|
128
132
|
vstring = subject.colorize(:reset, 'version')
|
129
133
|
subject.colorize(:green, "(#{vstring})").should == "\e[0;32m(\e[mversion\e[0;32m)\e[0m"
|
130
134
|
end
|
@@ -133,24 +137,28 @@ end
|
|
133
137
|
|
134
138
|
describe Puppet::Util::Log.desttypes[:telly_prototype_console] do
|
135
139
|
describe "when color is available" do
|
140
|
+
before :each do
|
141
|
+
subject.stubs(:console_has_color?).returns(true)
|
142
|
+
end
|
143
|
+
|
136
144
|
it "should support color output" do
|
137
|
-
Puppet
|
145
|
+
Puppet[:color] = true
|
138
146
|
subject.colorize(:red, 'version').should == "\e[0;31mversion\e[0m"
|
139
147
|
end
|
140
148
|
|
141
149
|
it "should withhold color output when not appropriate" do
|
142
|
-
Puppet
|
150
|
+
Puppet[:color] = false
|
143
151
|
subject.colorize(:red, 'version').should == "version"
|
144
152
|
end
|
145
153
|
|
146
154
|
it "should handle multiple overlapping colors in a stack-like way" do
|
147
|
-
Puppet
|
155
|
+
Puppet[:color] = true
|
148
156
|
vstring = subject.colorize(:red, 'version')
|
149
157
|
subject.colorize(:green, "(#{vstring})").should == "\e[0;32m(\e[0;31mversion\e[0;32m)\e[0m"
|
150
158
|
end
|
151
159
|
|
152
160
|
it "should handle resets in a stack-like way" do
|
153
|
-
Puppet
|
161
|
+
Puppet[:color] = true
|
154
162
|
vstring = subject.colorize(:reset, 'version')
|
155
163
|
subject.colorize(:green, "(#{vstring})").should == "\e[0;32m(\e[mversion\e[0;32m)\e[0m"
|
156
164
|
end
|
data/spec/unit/util/log_spec.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#!/usr/bin/env rspec
|
1
|
+
#!/usr/bin/env ruby -S rspec
|
2
2
|
require 'spec_helper'
|
3
3
|
|
4
4
|
require 'puppet/util/log'
|
@@ -42,6 +42,7 @@ describe Puppet::Util::Log do
|
|
42
42
|
describe Puppet::Util::Log::DestConsole do
|
43
43
|
before do
|
44
44
|
@console = Puppet::Util::Log::DestConsole.new
|
45
|
+
@console.stubs(:console_has_color?).returns(true)
|
45
46
|
end
|
46
47
|
|
47
48
|
it "should colorize if Puppet[:color] is :ansi" do
|
data/spec/unit/util_spec.rb
CHANGED
@@ -571,6 +571,17 @@ describe Puppet::Util do
|
|
571
571
|
Puppet::Util.which(base).should be_nil
|
572
572
|
end
|
573
573
|
|
574
|
+
it "should ignore ~user directories if the user doesn't exist" do
|
575
|
+
# Windows treats *any* user as a "user that doesn't exist", which means
|
576
|
+
# that this will work correctly across all our platforms, and should
|
577
|
+
# behave consistently. If they ever implement it correctly (eg: to do
|
578
|
+
# the lookup for real) it should just work transparently.
|
579
|
+
baduser = 'if_this_user_exists_I_will_eat_my_hat'
|
580
|
+
Puppet::Util::Execution.withenv("PATH" => "~#{baduser}#{File::PATH_SEPARATOR}#{base}") do
|
581
|
+
Puppet::Util.which('foo').should == path
|
582
|
+
end
|
583
|
+
end
|
584
|
+
|
574
585
|
describe "on POSIX systems" do
|
575
586
|
before :each do
|
576
587
|
Puppet.features.stubs(:posix?).returns true
|
data/tasks/rake/gem.rake
CHANGED
@@ -27,7 +27,7 @@ spec = Gem::Specification.new do |spec|
|
|
27
27
|
spec.files = GEM_FILES.to_a
|
28
28
|
spec.executables = EXECUTABLES.gsub(/sbin\/|bin\//, '').to_a
|
29
29
|
spec.version = Puppet::PUPPETVERSION
|
30
|
-
spec.add_dependency('facter', '
|
30
|
+
spec.add_dependency('facter', '~> 1.5')
|
31
31
|
spec.summary = 'Puppet, an automated configuration management tool'
|
32
32
|
spec.description = 'Puppet, an automated configuration management tool'
|
33
33
|
spec.author = 'Puppet Labs'
|
data/tasks/rake/manpages.rake
CHANGED
@@ -7,6 +7,16 @@ task :gen_manpages do
|
|
7
7
|
|
8
8
|
helpface = Puppet::Face[:help, '0.0.1']
|
9
9
|
manface = Puppet::Face[:man, '0.0.1']
|
10
|
+
|
11
|
+
# TODO: This line is terrible. The reason we need this here is because we
|
12
|
+
# handle state initialization differently when we run via command line
|
13
|
+
# (application.rb) than we do when we try to use Faces as library code.
|
14
|
+
# This is bad, we need to come up with an official stance on what our
|
15
|
+
# API is and what the entry points, so that we can make sure that
|
16
|
+
# state initialization is consistent. See:
|
17
|
+
# http://projects.puppetlabs.com/issues/14441
|
18
|
+
Puppet::Util::Instrumentation.init()
|
19
|
+
|
10
20
|
sbins = Dir.glob(%w{sbin/*})
|
11
21
|
bins = Dir.glob(%w{bin/*})
|
12
22
|
non_face_applications = helpface.legacy_applications
|
@@ -49,9 +59,7 @@ task :gen_manpages do
|
|
49
59
|
# Create face man pages
|
50
60
|
faces.each do |face|
|
51
61
|
File.open("./man/man8/puppet-#{face}.8.ronn", 'w') do |fh|
|
52
|
-
#
|
53
|
-
# so we have to remove the dupes with a gsub.
|
54
|
-
fh.write manface.man("#{face}", {:render_as => :s}).gsub(/^(\* `[^`]+`)\n\1/, '\1')
|
62
|
+
fh.write manface.man("#{face}")
|
55
63
|
end
|
56
64
|
|
57
65
|
%x{#{ronn} #{ronn_args} ./man/man8/puppet-#{face}.8.ronn}
|
@@ -1100,14 +1100,20 @@ allow *
|
|
1100
1100
|
mounts = {}
|
1101
1101
|
Puppet[:modulepath] = moddir
|
1102
1102
|
|
1103
|
-
|
1103
|
+
%w{green red}.each do |name|
|
1104
1104
|
path = File::join(moddir, name, Puppet::Module::FILES)
|
1105
1105
|
FileUtils::mkdir_p(path)
|
1106
1106
|
if name == "green"
|
1107
1107
|
file = File::join(path, "test.txt")
|
1108
1108
|
File::open(file, "w") { |f| f.print name }
|
1109
1109
|
end
|
1110
|
+
end
|
1111
|
+
|
1112
|
+
# We changed modulepath, so we have to clear the environment cache to
|
1113
|
+
# refresh it
|
1114
|
+
Puppet::Node::Environment.current.modules = nil
|
1110
1115
|
|
1116
|
+
mods = %w{green red}.map do |name|
|
1111
1117
|
Puppet::Module::find(name)
|
1112
1118
|
end
|
1113
1119
|
|
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:
|
4
|
+
hash: 51
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 2.7.
|
9
|
+
- 16
|
10
|
+
version: 2.7.16
|
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: 2012-
|
18
|
+
date: 2012-06-14 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: facter
|
@@ -23,14 +23,13 @@ dependencies:
|
|
23
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
24
|
none: false
|
25
25
|
requirements:
|
26
|
-
- -
|
26
|
+
- - ~>
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
hash:
|
28
|
+
hash: 5
|
29
29
|
segments:
|
30
30
|
- 1
|
31
31
|
- 5
|
32
|
-
|
33
|
-
version: 1.5.1
|
32
|
+
version: "1.5"
|
34
33
|
type: :runtime
|
35
34
|
version_requirements: *id001
|
36
35
|
description: Puppet, an automated configuration management tool
|
@@ -751,6 +750,7 @@ files:
|
|
751
750
|
- lib/puppet/util/network_device.rb
|
752
751
|
- lib/puppet/util/package.rb
|
753
752
|
- lib/puppet/util/pidlock.rb
|
753
|
+
- lib/puppet/util/platform.rb
|
754
754
|
- lib/puppet/util/plugins.rb
|
755
755
|
- lib/puppet/util/posix.rb
|
756
756
|
- lib/puppet/util/provider_features.rb
|
@@ -834,6 +834,7 @@ files:
|
|
834
834
|
- man/man8/pi.8
|
835
835
|
- man/man8/puppet-agent.8
|
836
836
|
- man/man8/puppet-apply.8
|
837
|
+
- man/man8/puppet-ca.8
|
837
838
|
- man/man8/puppet-catalog.8
|
838
839
|
- man/man8/puppet-cert.8
|
839
840
|
- man/man8/puppet-certificate.8
|
@@ -848,10 +849,14 @@ files:
|
|
848
849
|
- man/man8/puppet-filebucket.8
|
849
850
|
- man/man8/puppet-help.8
|
850
851
|
- man/man8/puppet-inspect.8
|
852
|
+
- man/man8/puppet-instrumentation_data.8
|
853
|
+
- man/man8/puppet-instrumentation_listener.8
|
854
|
+
- man/man8/puppet-instrumentation_probe.8
|
851
855
|
- man/man8/puppet-key.8
|
852
856
|
- man/man8/puppet-kick.8
|
853
857
|
- man/man8/puppet-man.8
|
854
858
|
- man/man8/puppet-master.8
|
859
|
+
- man/man8/puppet-module.8
|
855
860
|
- man/man8/puppet-node.8
|
856
861
|
- man/man8/puppet-parser.8
|
857
862
|
- man/man8/puppet-plugin.8
|
@@ -1221,14 +1226,19 @@ files:
|
|
1221
1226
|
- spec/fixtures/unit/provider/mount/parsed/openbsd.mount
|
1222
1227
|
- spec/fixtures/unit/provider/mount/parsed/solaris.fstab
|
1223
1228
|
- spec/fixtures/unit/provider/mount/parsed/solaris.mount
|
1229
|
+
- spec/fixtures/unit/provider/package/gem/line-with-1.8.5-warning
|
1224
1230
|
- spec/fixtures/unit/provider/package/openbsd/pkginfo.detail
|
1225
1231
|
- spec/fixtures/unit/provider/package/openbsd/pkginfo.list
|
1226
1232
|
- spec/fixtures/unit/provider/package/openbsd/pkginfo.query
|
1227
|
-
- spec/fixtures/unit/provider/package/pkg/
|
1233
|
+
- spec/fixtures/unit/provider/package/pkg/dummy_solaris10
|
1234
|
+
- spec/fixtures/unit/provider/package/pkg/dummy_solaris11
|
1228
1235
|
- spec/fixtures/unit/provider/package/pkg/incomplete
|
1229
1236
|
- spec/fixtures/unit/provider/package/pkg/publisher
|
1230
1237
|
- spec/fixtures/unit/provider/package/pkg/simple
|
1238
|
+
- spec/fixtures/unit/provider/package/pkg/solaris11
|
1239
|
+
- spec/fixtures/unit/provider/package/pkg/unknown_status
|
1231
1240
|
- spec/fixtures/unit/provider/package/zypper/zypper-list-updates-SLES11sp1.out
|
1241
|
+
- spec/fixtures/unit/provider/service/gentoo/rc_update_show
|
1232
1242
|
- spec/fixtures/unit/provider/ssh_authorized_key/parsed/authorized_keys
|
1233
1243
|
- spec/fixtures/unit/provider/ssh_authorized_key/parsed/authorized_keys1
|
1234
1244
|
- spec/fixtures/unit/provider/ssh_authorized_key/parsed/authorized_keys2
|
@@ -1643,6 +1653,7 @@ files:
|
|
1643
1653
|
- spec/unit/provider/service/daemontools_spec.rb
|
1644
1654
|
- spec/unit/provider/service/debian_spec.rb
|
1645
1655
|
- spec/unit/provider/service/freebsd_spec.rb
|
1656
|
+
- spec/unit/provider/service/gentoo_spec.rb
|
1646
1657
|
- spec/unit/provider/service/init_spec.rb
|
1647
1658
|
- spec/unit/provider/service/launchd_spec.rb
|
1648
1659
|
- spec/unit/provider/service/redhat_spec.rb
|
@@ -1758,6 +1769,7 @@ files:
|
|
1758
1769
|
- spec/unit/util/cache_accumulator_spec.rb
|
1759
1770
|
- spec/unit/util/cacher_spec.rb
|
1760
1771
|
- spec/unit/util/checksums_spec.rb
|
1772
|
+
- spec/unit/util/colors_spec.rb
|
1761
1773
|
- spec/unit/util/command_line_spec.rb
|
1762
1774
|
- spec/unit/util/constant_inflector_spec.rb
|
1763
1775
|
- spec/unit/util/diff_spec.rb
|
@@ -1857,7 +1869,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1857
1869
|
requirements: []
|
1858
1870
|
|
1859
1871
|
rubyforge_project: puppet
|
1860
|
-
rubygems_version: 1.8.
|
1872
|
+
rubygems_version: 1.8.24
|
1861
1873
|
signing_key:
|
1862
1874
|
specification_version: 3
|
1863
1875
|
summary: Puppet, an automated configuration management tool
|