puppet 3.0.0.rc4 → 3.0.0.rc5
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 +12 -0
- data/conf/redhat/puppet.spec +10 -7
- data/lib/puppet.rb +0 -1
- data/lib/puppet/provider/zpool/zpool.rb +1 -1
- data/lib/puppet/settings.rb +7 -24
- data/lib/puppet/transaction/report.rb +1 -1
- data/lib/puppet/util/run_mode.rb +39 -27
- data/lib/puppet/util/storage.rb +1 -0
- data/lib/puppet/version.rb +1 -1
- data/spec/unit/indirector/hiera_spec.rb +5 -3
- data/spec/unit/module_tool/applications/searcher_spec.rb +7 -4
- data/spec/unit/module_tool/applications/unpacker_spec.rb +11 -5
- data/spec/unit/provider/zpool/zpool_spec.rb +1 -1
- data/spec/unit/settings_spec.rb +17 -25
- data/spec/unit/util/run_mode_spec.rb +91 -30
- metadata +55 -78
data/CHANGELOG
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
3.0.0rc5
|
2
|
+
===
|
3
|
+
88171aa Maint: Use pending block
|
4
|
+
33bf085 Maint: Make paths absolute on Windows
|
5
|
+
54acfba (#16137) Delay evaluation of config and var directories
|
6
|
+
b53e600 (#16137) Tilde expansion should only occur for normal users
|
7
|
+
43590bd (Maint) Remove trailing whitespace
|
8
|
+
c0ff98d (#16137) Ensure HOME is set before attempting ~ expansion
|
9
|
+
224d380 Move singleton require to puppet/util/storage.rb
|
10
|
+
605e34d (#15739) Bump report_version since #10064 change its format
|
11
|
+
d834e76 (#6143) ensure that destroy works for zpools
|
12
|
+
|
1
13
|
3.0.0rc4
|
2
14
|
===
|
3
15
|
adcab02 (#15966) Update gem.rake task for correct facter version dependency
|
data/conf/redhat/puppet.spec
CHANGED
@@ -13,16 +13,16 @@
|
|
13
13
|
|
14
14
|
Name: puppet
|
15
15
|
Version: 3.0.0
|
16
|
-
Release: 0.
|
16
|
+
Release: 0.1rc5%{?dist}
|
17
17
|
#Release: 1%{?dist}
|
18
18
|
Vendor: %{?_host_vendor}
|
19
19
|
Summary: A network tool for managing many disparate systems
|
20
20
|
License: ASL 2.0
|
21
21
|
URL: http://puppetlabs.com
|
22
|
-
Source0: http://puppetlabs.com/downloads/%{name}/%{name}-%{version}.tar.gz
|
23
|
-
|
24
|
-
Source1: http://puppetlabs.com/downloads/%{name}/%{name}-%{version}.tar.gz.asc
|
25
|
-
|
22
|
+
#Source0: http://puppetlabs.com/downloads/%{name}/%{name}-%{version}.tar.gz
|
23
|
+
Source0: http://puppetlabs.com/downloads/%{name}/%{name}-%{version}rc5.tar.gz
|
24
|
+
#Source1: http://puppetlabs.com/downloads/%{name}/%{name}-%{version}.tar.gz.asc
|
25
|
+
Source1: http://puppetlabs.com/downloads/%{name}/%{name}-%{version}rc5.tar.gz.asc
|
26
26
|
|
27
27
|
Group: System Environment/Base
|
28
28
|
|
@@ -76,8 +76,8 @@ Provides the central puppet server daemon which provides manifests to clients.
|
|
76
76
|
The server can also function as a certificate authority and file server.
|
77
77
|
|
78
78
|
%prep
|
79
|
-
|
80
|
-
|
79
|
+
#%setup -q -n %{name}-%{version}
|
80
|
+
%setup -q -n %{name}-%{version}rc5
|
81
81
|
patch -s -p1 < conf/redhat/rundir-perms.patch
|
82
82
|
|
83
83
|
|
@@ -279,6 +279,9 @@ fi
|
|
279
279
|
rm -rf %{buildroot}
|
280
280
|
|
281
281
|
%changelog
|
282
|
+
* Wed Aug 29 2012 Moses Mendoza <moses@puppetlabs.com> - 3.0.0-0.1rc5
|
283
|
+
- Update for 3.0.0 rc5
|
284
|
+
|
282
285
|
* Fri Aug 24 2012 Eric Sorenson <eric0@puppetlabs.com> - 3.0.0-0.1rc4
|
283
286
|
- Facter requirement is 1.6.11, not 2.0
|
284
287
|
- Update for 3.0.0 rc4
|
data/lib/puppet.rb
CHANGED
data/lib/puppet/settings.rb
CHANGED
@@ -37,8 +37,8 @@ class Puppet::Settings
|
|
37
37
|
:logdir => run_mode.log_dir,
|
38
38
|
}
|
39
39
|
end
|
40
|
-
|
41
|
-
def self.default_certname()
|
40
|
+
|
41
|
+
def self.default_certname()
|
42
42
|
hostname = hostname_fact
|
43
43
|
domain = domain_fact
|
44
44
|
if domain and domain != ""
|
@@ -47,31 +47,14 @@ class Puppet::Settings
|
|
47
47
|
fqdn = hostname
|
48
48
|
end
|
49
49
|
fqdn.gsub(/\.$/, '')
|
50
|
-
end
|
50
|
+
end
|
51
51
|
|
52
52
|
def self.hostname_fact()
|
53
|
-
Facter["hostname"].value
|
54
|
-
end
|
53
|
+
Facter["hostname"].value
|
54
|
+
end
|
55
55
|
|
56
56
|
def self.domain_fact()
|
57
57
|
Facter["domain"].value
|
58
|
-
end
|
59
|
-
|
60
|
-
|
61
|
-
def self.default_global_config_dir
|
62
|
-
Puppet.features.microsoft_windows? ? File.join(Dir::COMMON_APPDATA, "PuppetLabs", "puppet", "etc") : "/etc/puppet"
|
63
|
-
end
|
64
|
-
|
65
|
-
def self.default_user_config_dir
|
66
|
-
File.expand_path("~/.puppet")
|
67
|
-
end
|
68
|
-
|
69
|
-
def self.default_global_var_dir
|
70
|
-
Puppet.features.microsoft_windows? ? File.join(Dir::COMMON_APPDATA, "PuppetLabs", "puppet", "var") : "/var/lib/puppet"
|
71
|
-
end
|
72
|
-
|
73
|
-
def self.default_user_var_dir
|
74
|
-
File.expand_path("~/.puppet/var")
|
75
58
|
end
|
76
59
|
|
77
60
|
def self.default_config_file_name
|
@@ -519,13 +502,13 @@ class Puppet::Settings
|
|
519
502
|
if explicit_config_file?
|
520
503
|
return self[:config]
|
521
504
|
else
|
522
|
-
return File.join(
|
505
|
+
return File.join(Puppet::Util::RunMode[:master].conf_dir, config_file_name)
|
523
506
|
end
|
524
507
|
end
|
525
508
|
private :main_config_file
|
526
509
|
|
527
510
|
def user_config_file
|
528
|
-
return File.join(
|
511
|
+
return File.join(Puppet::Util::RunMode[:user].conf_dir, config_file_name)
|
529
512
|
end
|
530
513
|
private :user_config_file
|
531
514
|
|
@@ -76,7 +76,7 @@ class Puppet::Transaction::Report
|
|
76
76
|
@host = Puppet[:node_name_value]
|
77
77
|
@time = Time.now
|
78
78
|
@kind = kind
|
79
|
-
@report_format =
|
79
|
+
@report_format = 3
|
80
80
|
@puppet_version = Puppet.version
|
81
81
|
@configuration_version = configuration_version
|
82
82
|
@environment = environment
|
data/lib/puppet/util/run_mode.rb
CHANGED
@@ -7,12 +7,15 @@ module Puppet
|
|
7
7
|
@name = name.to_sym
|
8
8
|
end
|
9
9
|
|
10
|
-
@@run_modes = Hash.new {|h, k| h[k] = RunMode.new(k)}
|
11
|
-
|
12
10
|
attr :name
|
13
11
|
|
14
12
|
def self.[](name)
|
15
|
-
|
13
|
+
@run_modes ||= {}
|
14
|
+
if Puppet.features.microsoft_windows?
|
15
|
+
@run_modes[name] ||= WindowsRunMode.new(name)
|
16
|
+
else
|
17
|
+
@run_modes[name] ||= UnixRunMode.new(name)
|
18
|
+
end
|
16
19
|
end
|
17
20
|
|
18
21
|
def master?
|
@@ -27,21 +30,6 @@ module Puppet
|
|
27
30
|
name == :user
|
28
31
|
end
|
29
32
|
|
30
|
-
|
31
|
-
def conf_dir
|
32
|
-
which_dir(
|
33
|
-
Puppet::Settings.default_global_config_dir,
|
34
|
-
Puppet::Settings.default_user_config_dir
|
35
|
-
)
|
36
|
-
end
|
37
|
-
|
38
|
-
def var_dir
|
39
|
-
which_dir(
|
40
|
-
Puppet::Settings.default_global_var_dir,
|
41
|
-
Puppet::Settings.default_user_var_dir
|
42
|
-
)
|
43
|
-
end
|
44
|
-
|
45
33
|
def run_dir
|
46
34
|
"$vardir/run"
|
47
35
|
end
|
@@ -50,24 +38,48 @@ module Puppet
|
|
50
38
|
"$vardir/log"
|
51
39
|
end
|
52
40
|
|
53
|
-
|
41
|
+
private
|
54
42
|
|
55
43
|
def which_dir( global, user )
|
56
44
|
#FIXME: we should test if we're user "puppet"
|
57
45
|
# there's a comment that suggests that we do that
|
58
46
|
# and we currently don't.
|
59
|
-
expand_path
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
47
|
+
File.expand_path(if in_global_context? then global else user end)
|
48
|
+
end
|
49
|
+
|
50
|
+
def in_global_context?
|
51
|
+
name == :master || Puppet.features.root?
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
class UnixRunMode < RunMode
|
56
|
+
def conf_dir
|
57
|
+
which_dir("/etc/puppet", "~/.puppet")
|
58
|
+
end
|
59
|
+
|
60
|
+
def var_dir
|
61
|
+
which_dir("/var/lib/puppet", "~/.puppet/var")
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
class WindowsRunMode < RunMode
|
66
|
+
def conf_dir
|
67
|
+
which_dir(File.join(windows_common_base("etc")), File.join(*windows_local_base))
|
64
68
|
end
|
65
69
|
|
66
|
-
def
|
67
|
-
|
68
|
-
File.expand_path(dir)
|
70
|
+
def var_dir
|
71
|
+
which_dir(File.join(windows_common_base("var")), File.join(*windows_local_base("var")))
|
69
72
|
end
|
70
73
|
|
74
|
+
private
|
75
|
+
|
76
|
+
def windows_common_base(*extra)
|
77
|
+
[Dir::COMMON_APPDATA, "PuppetLabs", "puppet"] + extra
|
78
|
+
end
|
79
|
+
|
80
|
+
def windows_local_base(*extra)
|
81
|
+
[Dir::LOCAL_APPDATA, "PuppetLabs", "puppet"] + extra
|
82
|
+
end
|
71
83
|
end
|
72
84
|
end
|
73
85
|
end
|
data/lib/puppet/util/storage.rb
CHANGED
data/lib/puppet/version.rb
CHANGED
@@ -100,19 +100,21 @@ describe Puppet::Indirector::Hiera do
|
|
100
100
|
end
|
101
101
|
|
102
102
|
context "when the Hiera configuration file does not exist" do
|
103
|
+
let(:path) { File.expand_path('/doesnotexist') }
|
104
|
+
|
103
105
|
before do
|
104
|
-
Puppet.settings[:hiera_config] =
|
106
|
+
Puppet.settings[:hiera_config] = path
|
105
107
|
end
|
106
108
|
|
107
109
|
it "should log a warning" do
|
108
110
|
Puppet.expects(:warning).with(
|
109
|
-
|
111
|
+
"Config file #{path} not found, using Hiera defaults")
|
110
112
|
@hiera_class.hiera_config
|
111
113
|
end
|
112
114
|
|
113
115
|
it "should only configure the logger and set it to puppet" do
|
114
116
|
Puppet.expects(:warning).with(
|
115
|
-
|
117
|
+
"Config file #{path} not found, using Hiera defaults")
|
116
118
|
@hiera_class.hiera_config.should == { :logger => 'puppet' }
|
117
119
|
end
|
118
120
|
end
|
@@ -2,17 +2,21 @@ require 'spec_helper'
|
|
2
2
|
require 'puppet/module_tool/applications'
|
3
3
|
require 'puppet_spec/modules'
|
4
4
|
|
5
|
-
describe Puppet::ModuleTool::Applications::Searcher
|
5
|
+
describe Puppet::ModuleTool::Applications::Searcher do
|
6
6
|
include PuppetSpec::Files
|
7
7
|
|
8
8
|
describe "when searching" do
|
9
9
|
let(:forge) { mock 'forge' }
|
10
|
+
let(:searcher) do
|
11
|
+
pending("porting to Windows", :if => Puppet.features.microsoft_windows?) do
|
12
|
+
described_class.new('search_term', forge)
|
13
|
+
end
|
14
|
+
end
|
10
15
|
|
11
16
|
it "should return results from a forge query when successful" do
|
12
17
|
results = 'mock results'
|
13
18
|
forge.expects(:search).with('search_term').returns(results)
|
14
19
|
|
15
|
-
searcher = Puppet::ModuleTool::Applications::Searcher.new('search_term', forge)
|
16
20
|
search_result = searcher.run
|
17
21
|
search_result.should == {
|
18
22
|
:result => :success,
|
@@ -22,8 +26,7 @@ describe Puppet::ModuleTool::Applications::Searcher, :fails_on_windows => true d
|
|
22
26
|
|
23
27
|
it "should return an error when the forge query throws an exception" do
|
24
28
|
forge.expects(:search).with('search_term').raises Puppet::Forge::Errors::ForgeError.new("something went wrong")
|
25
|
-
|
26
|
-
searcher = Puppet::ModuleTool::Applications::Searcher.new('search_term', forge)
|
29
|
+
|
27
30
|
search_result = searcher.run
|
28
31
|
search_result.should == {
|
29
32
|
:result => :failure,
|
@@ -2,14 +2,16 @@ require 'spec_helper'
|
|
2
2
|
require 'puppet/module_tool/applications'
|
3
3
|
require 'puppet_spec/modules'
|
4
4
|
|
5
|
-
describe Puppet::ModuleTool::Applications::Unpacker
|
5
|
+
describe Puppet::ModuleTool::Applications::Unpacker do
|
6
6
|
include PuppetSpec::Files
|
7
7
|
|
8
8
|
let(:target) { tmpdir("unpacker") }
|
9
9
|
|
10
10
|
context "initialization" do
|
11
11
|
it "should support filename and basic options" do
|
12
|
-
|
12
|
+
pending("porting to Windows", :if => Puppet.features.microsoft_windows?) do
|
13
|
+
Puppet::ModuleTool::Applications::Unpacker.new("myusername-mytarball-1.0.0.tar.gz", :target_dir => target)
|
14
|
+
end
|
13
15
|
end
|
14
16
|
|
15
17
|
it "should raise ArgumentError when filename is invalid" do
|
@@ -22,7 +24,9 @@ describe Puppet::ModuleTool::Applications::Unpacker, :fails_on_windows => true d
|
|
22
24
|
let(:filename) { tmpdir("module") + "/myusername-mytarball-1.0.0.tar.gz" }
|
23
25
|
let(:build_dir) { Pathname.new(tmpdir("build_dir")) }
|
24
26
|
let(:unpacker) do
|
25
|
-
|
27
|
+
pending("porting to Windows", :if => Puppet.features.microsoft_windows?) do
|
28
|
+
Puppet::ModuleTool::Applications::Unpacker.new(filename, :target_dir => target)
|
29
|
+
end
|
26
30
|
end
|
27
31
|
|
28
32
|
before :each do
|
@@ -35,8 +39,10 @@ describe Puppet::ModuleTool::Applications::Unpacker, :fails_on_windows => true d
|
|
35
39
|
|
36
40
|
context "on linux" do
|
37
41
|
it "should attempt to untar file to temporary location using system tar" do
|
38
|
-
|
39
|
-
|
42
|
+
pending("porting to Windows", :if => Puppet.features.microsoft_windows?) do
|
43
|
+
Puppet::Util::Execution.expects(:execute).with("tar xzf #{filename} -C #{build_dir}").returns(true)
|
44
|
+
unpacker.run
|
45
|
+
end
|
40
46
|
end
|
41
47
|
end
|
42
48
|
|
data/spec/unit/settings_spec.rb
CHANGED
@@ -6,20 +6,12 @@ require 'puppet/settings/errors'
|
|
6
6
|
describe Puppet::Settings do
|
7
7
|
include PuppetSpec::Files
|
8
8
|
|
9
|
-
|
10
|
-
|
9
|
+
let(:main_config_file_default_location) do
|
10
|
+
File.join(Puppet::Util::RunMode[:master].conf_dir, "puppet.conf")
|
11
|
+
end
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
it "should expand the value to an absolute path" do
|
15
|
-
Pathname.new(Puppet::Settings.default_user_config_dir).absolute?.should be_true
|
16
|
-
end
|
17
|
-
end
|
18
|
-
context "user var dir" do
|
19
|
-
it "should expand the value to an absolute path" do
|
20
|
-
Pathname.new(Puppet::Settings.default_user_var_dir).absolute?.should be_true
|
21
|
-
end
|
22
|
-
end
|
13
|
+
let(:user_config_file_default_location) do
|
14
|
+
File.join(Puppet::Util::RunMode[:user].conf_dir, "puppet.conf")
|
23
15
|
end
|
24
16
|
|
25
17
|
describe "when specifying defaults" do
|
@@ -661,21 +653,21 @@ describe Puppet::Settings do
|
|
661
653
|
end
|
662
654
|
|
663
655
|
describe "when root" do
|
664
|
-
it "should look for
|
656
|
+
it "should look for the main config file default location config settings haven't been overridden'" do
|
665
657
|
Puppet.features.stubs(:root?).returns(true)
|
666
|
-
FileTest.expects(:exist?).with(
|
667
|
-
FileTest.expects(:exist?).with(
|
658
|
+
FileTest.expects(:exist?).with(main_config_file_default_location).returns(false)
|
659
|
+
FileTest.expects(:exist?).with(user_config_file_default_location).never
|
668
660
|
|
669
661
|
@settings.send(:parse_config_files)
|
670
662
|
end
|
671
663
|
end
|
672
664
|
|
673
665
|
describe "when not root" do
|
674
|
-
it "should look for
|
666
|
+
it "should look for user config file default location if config settings haven't been overridden'" do
|
675
667
|
Puppet.features.stubs(:root?).returns(false)
|
676
668
|
|
677
669
|
seq = sequence "load config files"
|
678
|
-
FileTest.expects(:exist?).with(
|
670
|
+
FileTest.expects(:exist?).with(user_config_file_default_location).returns(false).in_sequence(seq)
|
679
671
|
|
680
672
|
@settings.send(:parse_config_files)
|
681
673
|
end
|
@@ -895,10 +887,10 @@ describe Puppet::Settings do
|
|
895
887
|
before :each do
|
896
888
|
Puppet.features.stubs(:root?).returns(false)
|
897
889
|
FileTest.expects(:exist?).
|
898
|
-
with(
|
890
|
+
with(user_config_file_default_location).
|
899
891
|
returns(true).in_sequence(seq)
|
900
892
|
@settings.expects(:read_file).
|
901
|
-
with(
|
893
|
+
with(user_config_file_default_location).
|
902
894
|
returns(user_config_text).in_sequence(seq)
|
903
895
|
end
|
904
896
|
|
@@ -917,10 +909,10 @@ describe Puppet::Settings do
|
|
917
909
|
before :each do
|
918
910
|
Puppet.features.stubs(:root?).returns(true)
|
919
911
|
FileTest.expects(:exist?).
|
920
|
-
with(
|
912
|
+
with(main_config_file_default_location).
|
921
913
|
returns(true).in_sequence(seq)
|
922
914
|
@settings.expects(:read_file).
|
923
|
-
with(
|
915
|
+
with(main_config_file_default_location).
|
924
916
|
returns(main_config_text).in_sequence(seq)
|
925
917
|
end
|
926
918
|
|
@@ -938,12 +930,12 @@ describe Puppet::Settings do
|
|
938
930
|
context "running with an explicit config file as a user (e.g. Apache + Passenger)" do
|
939
931
|
before :each do
|
940
932
|
Puppet.features.stubs(:root?).returns(false)
|
941
|
-
@settings[:confdir] = File.dirname(
|
933
|
+
@settings[:confdir] = File.dirname(main_config_file_default_location)
|
942
934
|
FileTest.expects(:exist?).
|
943
|
-
with(
|
935
|
+
with(main_config_file_default_location).
|
944
936
|
returns(true).in_sequence(seq)
|
945
937
|
@settings.expects(:read_file).
|
946
|
-
with(
|
938
|
+
with(main_config_file_default_location).
|
947
939
|
returns(main_config_text).in_sequence(seq)
|
948
940
|
end
|
949
941
|
|
@@ -6,44 +6,105 @@ describe Puppet::Util::RunMode do
|
|
6
6
|
@run_mode = Puppet::Util::RunMode.new('fake')
|
7
7
|
end
|
8
8
|
|
9
|
-
it "
|
10
|
-
|
11
|
-
etcdir = Puppet.features.microsoft_windows? ? File.join(Dir::COMMON_APPDATA, "PuppetLabs", "puppet", "etc") : '/etc/puppet'
|
12
|
-
# REMIND: issue with windows backslashes
|
13
|
-
@run_mode.conf_dir.should == File.expand_path(etcdir)
|
9
|
+
it "has rundir depend on vardir" do
|
10
|
+
@run_mode.run_dir.should == '$vardir/run'
|
14
11
|
end
|
15
12
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
13
|
+
describe Puppet::Util::UnixRunMode do
|
14
|
+
before do
|
15
|
+
@run_mode = Puppet::Util::UnixRunMode.new('fake')
|
16
|
+
end
|
20
17
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
@run_mode.var_dir.should == File.expand_path(vardir)
|
26
|
-
end
|
18
|
+
describe "#conf_dir" do
|
19
|
+
it "has confdir /etc/puppet when run as root" do
|
20
|
+
as_root { @run_mode.conf_dir.should == File.expand_path('/etc/puppet') }
|
21
|
+
end
|
27
22
|
|
28
|
-
|
29
|
-
|
30
|
-
|
23
|
+
it "has confdir ~/.puppet when run as non-root" do
|
24
|
+
as_non_root { @run_mode.conf_dir.should == File.expand_path('~/.puppet') }
|
25
|
+
end
|
26
|
+
|
27
|
+
it "fails when asking for the conf_dir as non-root and there is no $HOME" do
|
28
|
+
as_non_root do
|
29
|
+
without_home do
|
30
|
+
expect { @run_mode.conf_dir }.to raise_error ArgumentError, /couldn't find HOME/
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe "#var_dir" do
|
37
|
+
it "has vardir /var/lib/puppet when run as root" do
|
38
|
+
as_root { @run_mode.var_dir.should == File.expand_path('/var/lib/puppet') }
|
39
|
+
end
|
40
|
+
|
41
|
+
it "has vardir ~/.puppet/var when run as non-root" do
|
42
|
+
as_non_root { @run_mode.var_dir.should == File.expand_path('~/.puppet/var') }
|
43
|
+
end
|
44
|
+
|
45
|
+
it "fails when asking for the var_dir as non-root and there is no $HOME" do
|
46
|
+
as_non_root do
|
47
|
+
without_home do
|
48
|
+
expect { @run_mode.var_dir }.to raise_error ArgumentError, /couldn't find HOME/
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def without_home
|
55
|
+
saved_home = ENV["HOME"]
|
56
|
+
ENV.delete "HOME"
|
57
|
+
yield
|
58
|
+
ensure
|
59
|
+
ENV["HOME"] = saved_home
|
60
|
+
end
|
31
61
|
end
|
32
62
|
|
33
|
-
|
34
|
-
|
63
|
+
describe Puppet::Util::WindowsRunMode do
|
64
|
+
before do
|
65
|
+
if not Dir.const_defined? :COMMON_APPDATA
|
66
|
+
Dir.const_set :COMMON_APPDATA, "/CommonFakeBase"
|
67
|
+
Dir.const_set :LOCAL_APPDATA, "/LocalFakeBase"
|
68
|
+
@remove_const = true
|
69
|
+
end
|
70
|
+
@run_mode = Puppet::Util::WindowsRunMode.new('fake')
|
71
|
+
end
|
72
|
+
|
73
|
+
after do
|
74
|
+
if @remove_const
|
75
|
+
Dir.send :remove_const, :COMMON_APPDATA
|
76
|
+
Dir.send :remove_const, :LOCAL_APPDATA
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
describe "#conf_dir" do
|
81
|
+
it "has confdir /etc/puppet when run as root" do
|
82
|
+
as_root { @run_mode.conf_dir.should == File.expand_path(File.join(Dir::COMMON_APPDATA, "PuppetLabs", "puppet", "etc")) }
|
83
|
+
end
|
84
|
+
|
85
|
+
it "has confdir in the local appdata when run as non-root" do
|
86
|
+
as_non_root { @run_mode.conf_dir.should == File.expand_path(File.join(Dir::LOCAL_APPDATA, "PuppetLabs", "puppet")) }
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
describe "#var_dir" do
|
91
|
+
it "has vardir /var/lib/puppet when run as root" do
|
92
|
+
as_root { @run_mode.var_dir.should == File.expand_path(File.join(Dir::COMMON_APPDATA, "PuppetLabs", "puppet", "var")) }
|
93
|
+
end
|
94
|
+
|
95
|
+
it "has vardir local appdata when run as non-root" do
|
96
|
+
as_non_root { @run_mode.var_dir.should == File.expand_path(File.join(Dir::LOCAL_APPDATA, "PuppetLabs", "puppet", "var")) }
|
97
|
+
end
|
98
|
+
end
|
35
99
|
end
|
36
100
|
|
101
|
+
def as_root
|
102
|
+
Puppet.features.stubs(:root?).returns(true)
|
103
|
+
yield
|
104
|
+
end
|
37
105
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
@run_mode.logopts.should == {
|
42
|
-
:default => "$vardir/log",
|
43
|
-
:mode => 0750,
|
44
|
-
:owner => "service",
|
45
|
-
:group => "service",
|
46
|
-
:desc => "The Puppet log directory.",
|
47
|
-
}
|
106
|
+
def as_non_root
|
107
|
+
Puppet.features.stubs(:root?).returns(false)
|
108
|
+
yield
|
48
109
|
end
|
49
110
|
end
|
metadata
CHANGED
@@ -1,83 +1,71 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 3.0.0.rc5
|
5
5
|
prerelease: 6
|
6
|
-
segments:
|
7
|
-
- 3
|
8
|
-
- 0
|
9
|
-
- 0
|
10
|
-
- rc
|
11
|
-
- 4
|
12
|
-
version: 3.0.0.rc4
|
13
6
|
platform: ruby
|
14
|
-
authors:
|
7
|
+
authors:
|
15
8
|
- Puppet Labs
|
16
9
|
autorequire:
|
17
10
|
bindir: bin
|
18
11
|
cert_chain: []
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-08-29 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
23
15
|
name: facter
|
24
|
-
|
25
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
26
17
|
none: false
|
27
|
-
requirements:
|
28
|
-
- -
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
hash: 25
|
31
|
-
segments:
|
32
|
-
- 1
|
33
|
-
- 6
|
34
|
-
- 11
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
35
21
|
version: 1.6.11
|
36
22
|
type: :runtime
|
37
|
-
version_requirements: *id001
|
38
|
-
- !ruby/object:Gem::Dependency
|
39
|
-
name: hiera
|
40
23
|
prerelease: false
|
41
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.6.11
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: hiera
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
42
33
|
none: false
|
43
|
-
requirements:
|
44
|
-
- -
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
hash: 1452066708
|
47
|
-
segments:
|
48
|
-
- 1
|
49
|
-
- 0
|
50
|
-
- 0
|
51
|
-
- rc
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
52
37
|
version: 1.0.0rc
|
53
38
|
type: :runtime
|
54
|
-
version_requirements: *id002
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: hiera-puppet
|
57
39
|
prerelease: false
|
58
|
-
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
59
41
|
none: false
|
60
|
-
requirements:
|
61
|
-
- -
|
62
|
-
- !ruby/object:Gem::Version
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.0.0rc
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: hiera-puppet
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
69
53
|
version: 1.0.0rc
|
70
54
|
type: :runtime
|
71
|
-
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.0.0rc
|
72
62
|
description: Puppet, an automated configuration management tool
|
73
63
|
email: puppet@puppetlabs.com
|
74
|
-
executables:
|
64
|
+
executables:
|
75
65
|
- puppet
|
76
66
|
extensions: []
|
77
|
-
|
78
67
|
extra_rdoc_files: []
|
79
|
-
|
80
|
-
files:
|
68
|
+
files:
|
81
69
|
- CHANGELOG
|
82
70
|
- CONTRIBUTING.md
|
83
71
|
- Gemfile
|
@@ -1746,42 +1734,31 @@ files:
|
|
1746
1734
|
- spec/watchr.rb
|
1747
1735
|
homepage: http://puppetlabs.com
|
1748
1736
|
licenses: []
|
1749
|
-
|
1750
1737
|
post_install_message:
|
1751
|
-
rdoc_options:
|
1738
|
+
rdoc_options:
|
1752
1739
|
- --title
|
1753
1740
|
- Puppet - Configuration Management
|
1754
1741
|
- --main
|
1755
1742
|
- README
|
1756
1743
|
- --line-numbers
|
1757
|
-
require_paths:
|
1744
|
+
require_paths:
|
1758
1745
|
- lib
|
1759
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
1746
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
1760
1747
|
none: false
|
1761
|
-
requirements:
|
1762
|
-
- -
|
1763
|
-
- !ruby/object:Gem::Version
|
1764
|
-
|
1765
|
-
|
1766
|
-
- 0
|
1767
|
-
version: "0"
|
1768
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
1748
|
+
requirements:
|
1749
|
+
- - ! '>='
|
1750
|
+
- !ruby/object:Gem::Version
|
1751
|
+
version: '0'
|
1752
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
1769
1753
|
none: false
|
1770
|
-
requirements:
|
1771
|
-
- -
|
1772
|
-
- !ruby/object:Gem::Version
|
1773
|
-
hash: 25
|
1774
|
-
segments:
|
1775
|
-
- 1
|
1776
|
-
- 3
|
1777
|
-
- 1
|
1754
|
+
requirements:
|
1755
|
+
- - ! '>'
|
1756
|
+
- !ruby/object:Gem::Version
|
1778
1757
|
version: 1.3.1
|
1779
1758
|
requirements: []
|
1780
|
-
|
1781
1759
|
rubyforge_project: puppet
|
1782
1760
|
rubygems_version: 1.8.24
|
1783
1761
|
signing_key:
|
1784
1762
|
specification_version: 3
|
1785
1763
|
summary: Puppet, an automated configuration management tool
|
1786
1764
|
test_files: []
|
1787
|
-
|