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
data/CHANGELOG
CHANGED
@@ -1,3 +1,75 @@
|
|
1
|
+
2.7.16
|
2
|
+
===
|
3
|
+
99fecc3 Update facter dep to reflect epoch 1
|
4
|
+
3a06246 (#8858) Explicitly set SSL peer verification mode.
|
5
|
+
cd4bee8 Test SSL setup code, not our stubbing of it.
|
6
|
+
ff052b8 (maint) Add mailmap to identify contributors
|
7
|
+
8dda6c2 (#14723) Fix http report description
|
8
|
+
ebf5386 Remove EL-related test changes from this commit.
|
9
|
+
2aea708 Revert changes to symbolic_modes.rb -- this test should indeed be pending (it should eventually work on Windows).
|
10
|
+
b601bb4 Update acceptance tests to use confine instead of skip_test loops
|
11
|
+
e619304 (#14761) Add boot, reboot to excludes list for redhat provider
|
12
|
+
7c1d8c2 (maint) Disable upstart spec test on windows
|
13
|
+
37df5c4 (#14615) Final stub fixes for the tests.
|
14
|
+
f11dfd6 (#14615) Fix provider spec tests to work on non gentoo systems
|
15
|
+
060810e maint: Make it easier to test the service provider
|
16
|
+
c0cb0fa (Maint) Close filehandles after read in upstart
|
17
|
+
0788ea2 (#14615) Exclude helperscripts in gentoo service provider
|
18
|
+
be6062c Apply commit from master that varies ports during tests
|
19
|
+
a45942b (#14297) Don't remove tty1 or rsyslog during upstart acceptance
|
20
|
+
466ab49 (#14297) Define agent in upstart acceptance test
|
21
|
+
f5d1f74 (#14297) Update upstart provider acceptance tests
|
22
|
+
3c5ef40 (#14297) Clean up upstart provider and tests
|
23
|
+
36c41e1 (#14343) Test cases for more forms of variable lookup
|
24
|
+
6cca061 (#14297) Add acceptance test for upstart provider
|
25
|
+
b9ed026 (#14297) Update spec tests for upstart provider
|
26
|
+
91827e8 (#14297) Handle upstart services better
|
27
|
+
3541db6 (#14343) Lookup in correct inherited scope
|
28
|
+
2d83e22 (Maint) Added test for fully qualified variable
|
29
|
+
c6e006e (#8174) Allow defines to reference topscope
|
30
|
+
e27adf4 Evaluate node classes either in top or node scope
|
31
|
+
a3d51b2 Removed topscope being overridden by node
|
32
|
+
53e0057 Use internal domain name for module tool tests
|
33
|
+
f4ba59e Use absolute_path in module install spec
|
34
|
+
ead9d25 (Maint) Color console output when the win32console gem is installed
|
35
|
+
a76d873 (#14424) Expand path of the target directory
|
36
|
+
95b75e1 Fix unit test failure in fileserver due to modules
|
37
|
+
da5361d Maint: De-genericize Puppet Forge references in module face
|
38
|
+
3b144bf Revert "maint: use relative paths to fixtures."
|
39
|
+
dae5539 (#14440) Hack to allow help faces to be used as API
|
40
|
+
e862cad Fix broken man page rake task
|
41
|
+
b26699a (#10146) `-` is not legal in variable names.
|
42
|
+
7ce9e17 maint: use relative paths to fixtures.
|
43
|
+
a7a532c Significantly improve compilation performance when using modules
|
44
|
+
12c5bda Fix a stub of ansicolor that I missed
|
45
|
+
ea740f6 Add Puppet::Util::Platform to abstract platform checks
|
46
|
+
91a4a7d Don't use features to check for color in logging
|
47
|
+
80fe59d Remove a bad test that can lead to random hangs...
|
48
|
+
0efb4c2 (#14296) Improve template function error message.
|
49
|
+
d5e0cdd (#14288) gem provider should tolerate bad lines.
|
50
|
+
d2b3ba0 Revert "Fix incorrect argument handling for expire in NodeExpirer"
|
51
|
+
7c7d4b6 Fix #14123 for Windows
|
52
|
+
1c9bec0 Fix incorrect argument handling for expire in NodeExpirer
|
53
|
+
7e92a7c Fix filebucket specs on Windows
|
54
|
+
a713f07 (#8778) Make '' == undef commutative in the DSL
|
55
|
+
24d4bb5 Revert "(#11004) Fix regex for pkg provider line matching"
|
56
|
+
34da6f7 (#13651) Use magenta, not purple in Facter::Util::Colors
|
57
|
+
e37b536 (#11004) Fix regex for pkg provider line matching
|
58
|
+
9b47110 (#13956) Fix failing spec tests
|
59
|
+
ca313dc (maint) Fix destinations_spec failure on windows
|
60
|
+
cde3bee Just change Puppet settings in tests, rather than stubbing.
|
61
|
+
6aa8441 (#11004) Support Solaris 11 output in pkg package provider
|
62
|
+
61e7d3c maint: Fix pkg_spec test
|
63
|
+
603b368 (#14173) Enforce that filebucket paths must be absolute
|
64
|
+
b7828ed (#3452) Autorequire user for cron
|
65
|
+
402a425 (#14127) Add integration tests for ssh_authorized_key
|
66
|
+
85ee441 maint: refactor integration specs for ssh_authorized_key
|
67
|
+
b4d1c65 (#14127) ssh_authorized_keys grammer fails on blank lines.
|
68
|
+
36d959a (#14123) Puppet shouldn't explode if PATH contains ~nonexistent_user
|
69
|
+
a281c48 (#13645) Add test cases to tagmail_spec
|
70
|
+
f6ac1bb (#13645) Do not open a smtp connection if nothing to report
|
71
|
+
f40cc71 (#12392): Colorize console output on Windows
|
72
|
+
|
1
73
|
2.7.14
|
2
74
|
===
|
3
75
|
42b20be (#13682) Fix acceptance test failures
|
@@ -2075,6 +2147,19 @@ d532e6d Fixing #3185 Rakefile is loading puppet.rb twice
|
|
2075
2147
|
5aa596c Fix #3150 - require function doesn't like ::class syntax
|
2076
2148
|
3457b87 Added time module to tagmail report
|
2077
2149
|
|
2150
|
+
2.6.16
|
2151
|
+
===
|
2152
|
+
65446c9 Revert "(#5246) Puppetd does not remove it's pidfile when it exits"
|
2153
|
+
|
2154
|
+
2.6.15
|
2155
|
+
===
|
2156
|
+
f7829ec Stub mktmpdir and remove_entry_secure in os x package providers
|
2157
|
+
7ac1ec8 (#13260) Spec test to verify that mktmpdir is used
|
2158
|
+
0180200 Refactor pkgdmg specs
|
2159
|
+
c51447d (#13260) Use mktmpdir when downloading packages
|
2160
|
+
568ded5 Fix for bucket_path security vulnerability
|
2161
|
+
6bef2e6 Removed text/marshal support
|
2162
|
+
|
2078
2163
|
2.6.14
|
2079
2164
|
===
|
2080
2165
|
ade5965 Remove unnecessary fallbacks in change_{user,group}
|
data/conf/redhat/puppet.spec
CHANGED
@@ -5,8 +5,8 @@
|
|
5
5
|
%global confdir conf/redhat
|
6
6
|
|
7
7
|
Name: puppet
|
8
|
-
Version: 2.7.
|
9
|
-
#Release: 0.1rc1%{?dist}
|
8
|
+
Version: 2.7.16
|
9
|
+
#Release: 0.1rc1.2%{?dist}
|
10
10
|
Release: 1%{?dist}
|
11
11
|
Summary: A network tool for managing many disparate systems
|
12
12
|
License: ASL 2.0
|
@@ -20,7 +20,7 @@ Group: System Environment/Base
|
|
20
20
|
|
21
21
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
22
22
|
|
23
|
-
BuildRequires: facter >= 1.5
|
23
|
+
BuildRequires: facter >= 1.5, facter < 1:2.0
|
24
24
|
BuildRequires: ruby >= 1.8.5
|
25
25
|
|
26
26
|
BuildArch: noarch
|
@@ -36,7 +36,7 @@ Requires: ruby-shadow
|
|
36
36
|
%endif
|
37
37
|
%endif
|
38
38
|
|
39
|
-
Requires: facter >= 1.5
|
39
|
+
Requires: facter >= 1.5, facter < 1:2.0
|
40
40
|
Requires: ruby >= 1.8.5
|
41
41
|
%{!?_without_augeas:Requires: ruby-augeas}
|
42
42
|
|
@@ -67,6 +67,7 @@ The server can also function as a certificate authority and file server.
|
|
67
67
|
|
68
68
|
%prep
|
69
69
|
%setup -q -n %{name}-%{version}
|
70
|
+
#%setup -q -n %{name}-%{version}rc1
|
70
71
|
patch -s -p1 < conf/redhat/rundir-perms.patch
|
71
72
|
|
72
73
|
|
@@ -177,6 +178,7 @@ echo "D /var/run/%{name} 0755 %{name} %{name} -" > \
|
|
177
178
|
%{_mandir}/man8/puppet-apply.8.gz
|
178
179
|
%{_mandir}/man8/puppet-catalog.8.gz
|
179
180
|
%{_mandir}/man8/puppet-describe.8.gz
|
181
|
+
%{_mandir}/man8/puppet-ca.8.gz
|
180
182
|
%{_mandir}/man8/puppet-cert.8.gz
|
181
183
|
%{_mandir}/man8/puppet-certificate.8.gz
|
182
184
|
%{_mandir}/man8/puppet-certificate_request.8.gz
|
@@ -189,9 +191,13 @@ echo "D /var/run/%{name} 0755 %{name} %{name} -" > \
|
|
189
191
|
%{_mandir}/man8/puppet-filebucket.8.gz
|
190
192
|
%{_mandir}/man8/puppet-help.8.gz
|
191
193
|
%{_mandir}/man8/puppet-inspect.8.gz
|
194
|
+
%{_mandir}/man8/puppet-instrumentation_data.8.gz
|
195
|
+
%{_mandir}/man8/puppet-instrumentation_listener.8.gz
|
196
|
+
%{_mandir}/man8/puppet-instrumentation_probe.8.gz
|
192
197
|
%{_mandir}/man8/puppet-key.8.gz
|
193
198
|
%{_mandir}/man8/puppet-kick.8.gz
|
194
199
|
%{_mandir}/man8/puppet-man.8.gz
|
200
|
+
%{_mandir}/man8/puppet-module.8.gz
|
195
201
|
%{_mandir}/man8/puppet-node.8.gz
|
196
202
|
%{_mandir}/man8/puppet-parser.8.gz
|
197
203
|
%{_mandir}/man8/puppet-plugin.8.gz
|
@@ -283,6 +289,27 @@ fi
|
|
283
289
|
rm -rf %{buildroot}
|
284
290
|
|
285
291
|
%changelog
|
292
|
+
* Wed Jun 13 2012 Matthaus Litteken <matthaus@puppelabs.com> - 2.7.16-1
|
293
|
+
- Update for 2.7.16
|
294
|
+
|
295
|
+
* Fri Jun 08 2012 Moses Mendoza <moses@puppetlabs.com> - 2.7.16-0.1rc1.2
|
296
|
+
- Updated facter 2.0 dep to include epoch 1
|
297
|
+
|
298
|
+
* Wed Jun 06 2012 Matthaus Litteken <matthaus@puppetlabs.com> - 2.7.16-0.1rc1
|
299
|
+
- Update for 2.7.16rc1, added generated manpages
|
300
|
+
|
301
|
+
* Fri Jun 01 2012 Matthaus Litteken <matthaus@puppetlabs.com> - 2.7.15-0.1rc4
|
302
|
+
- Update for 2.7.15rc4
|
303
|
+
|
304
|
+
* Tue May 29 2012 Moses Mendoza <moses@puppetlabs.com> - 2.7.15-0.1rc3
|
305
|
+
- Update for 2.7.15rc3
|
306
|
+
|
307
|
+
* Wed May 16 2012 Moses Mendoza <moses@puppetlabs.com> - 2.7.15-0.1rc2
|
308
|
+
- Update for 2.7.15rc2
|
309
|
+
|
310
|
+
* Tue May 15 2012 Moses Mendoza <moses@puppetlabs.com> - 2.7.15-0.1rc1
|
311
|
+
- Update for 2.7.15rc1
|
312
|
+
|
286
313
|
* Wed May 02 2012 Moses Mendoza <moses@puppetlabs.com> - 2.7.14-1
|
287
314
|
- Update for 2.7.14
|
288
315
|
|
data/lib/puppet.rb
CHANGED
data/lib/puppet/defaults.rb
CHANGED
@@ -47,11 +47,10 @@ module Puppet
|
|
47
47
|
exits. Comma-separate multiple values. For a list of all values,
|
48
48
|
specify 'all'."],
|
49
49
|
:color => {
|
50
|
-
:default =>
|
50
|
+
:default => "ansi",
|
51
51
|
:type => :setting,
|
52
52
|
:desc => "Whether to use colors when logging to the console. Valid values are
|
53
|
-
`ansi` (equivalent to `true`), `html`, and `false`, which produces no color.
|
54
|
-
Defaults to false on Windows, as its console does not support ansi colors.",
|
53
|
+
`ansi` (equivalent to `true`), `html`, and `false`, which produces no color.",
|
55
54
|
},
|
56
55
|
:mkusers => [false,
|
57
56
|
"Whether to create the necessary user and group that puppet agent will
|
@@ -2,10 +2,9 @@
|
|
2
2
|
|
3
3
|
Puppet::Face.define(:module, '1.0.0') do
|
4
4
|
action(:install) do
|
5
|
-
summary "Install a module from
|
5
|
+
summary "Install a module from the Puppet Forge or a release archive."
|
6
6
|
description <<-EOT
|
7
|
-
Installs a module from the Puppet Forge
|
8
|
-
on-disk, or from a private Forge-like repository.
|
7
|
+
Installs a module from the Puppet Forge or from a release archive file.
|
9
8
|
|
10
9
|
The specified module will be installed into the directory
|
11
10
|
specified with the `--target-dir` option, which defaults to
|
@@ -149,6 +148,7 @@ Puppet::Face.define(:module, '1.0.0') do
|
|
149
148
|
when_invoked do |name, options|
|
150
149
|
sep = File::PATH_SEPARATOR
|
151
150
|
if options[:target_dir]
|
151
|
+
options[:target_dir] = File.expand_path(options[:target_dir])
|
152
152
|
options[:modulepath] = "#{options[:target_dir]}#{sep}#{options[:modulepath]}"
|
153
153
|
end
|
154
154
|
|
@@ -2,16 +2,16 @@ require 'puppet/util/terminal'
|
|
2
2
|
|
3
3
|
Puppet::Face.define(:module, '1.0.0') do
|
4
4
|
action(:search) do
|
5
|
-
summary "Search
|
5
|
+
summary "Search the Puppet Forge for a module."
|
6
6
|
description <<-EOT
|
7
|
-
Searches
|
7
|
+
Searches the Puppet Forge for modules whose names, descriptions, or keywords
|
8
8
|
match the provided search term.
|
9
9
|
EOT
|
10
10
|
|
11
11
|
returns "Array of module metadata hashes"
|
12
12
|
|
13
13
|
examples <<-EOT
|
14
|
-
Search the
|
14
|
+
Search the Puppet Forge for a module:
|
15
15
|
|
16
16
|
$ puppet module search puppetlabs
|
17
17
|
NAME DESCRIPTION AUTHOR KEYWORDS
|
@@ -72,7 +72,7 @@ class Puppet::Indirector::Face < Puppet::Face
|
|
72
72
|
|
73
73
|
action :save do
|
74
74
|
summary "API only: create or overwrite an object."
|
75
|
-
arguments "<
|
75
|
+
arguments "<key>"
|
76
76
|
description <<-EOT
|
77
77
|
API only: create or overwrite an object. As the Faces framework does not
|
78
78
|
currently accept data from STDIN, save actions cannot currently be invoked
|
@@ -11,14 +11,23 @@ module Puppet::Network::HttpPool
|
|
11
11
|
|
12
12
|
# Use cert information from a Puppet client to set up the http object.
|
13
13
|
def self.cert_setup(http)
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
14
|
+
if FileTest.exist?(Puppet[:hostcert]) and FileTest.exist?(Puppet[:localcacert])
|
15
|
+
http.cert_store = ssl_host.ssl_store
|
16
|
+
http.ca_file = Puppet[:localcacert]
|
17
|
+
http.cert = ssl_host.certificate.content
|
18
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
19
|
+
http.key = ssl_host.key.content
|
20
|
+
else
|
21
|
+
# We don't have the local certificates, so we don't do any verification
|
22
|
+
# or setup at this early stage. REVISIT: Shouldn't we supply the local
|
23
|
+
# certificate details if we have them? The original code didn't.
|
24
|
+
# --daniel 2012-06-03
|
25
|
+
|
26
|
+
# Ruby 1.8 defaulted to this, but 1.9 defaults to peer verify, and we
|
27
|
+
# almost always talk to a dedicated, not-standard CA that isn't trusted
|
28
|
+
# out of the box. This forces the expected state.
|
29
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
30
|
+
end
|
22
31
|
end
|
23
32
|
|
24
33
|
# Retrieve a cached http instance if caching is enabled, else return
|
data/lib/puppet/parser/ast.rb
CHANGED
@@ -103,7 +103,7 @@ class Puppet::Parser::AST
|
|
103
103
|
value = Puppet::Parser::Scope.number?(value) || value
|
104
104
|
|
105
105
|
# "" == undef for case/selector/if
|
106
|
-
obj == value or (obj == "" and value == :undef)
|
106
|
+
obj == value or (obj == "" and value == :undef) or (obj == :undef and value == "")
|
107
107
|
end
|
108
108
|
end
|
109
109
|
|
@@ -27,7 +27,7 @@ class Puppet::Parser::Compiler
|
|
27
27
|
raise Puppet::Error, "#{detail} on node #{node.name}"
|
28
28
|
end
|
29
29
|
|
30
|
-
attr_reader :node, :facts, :collections, :catalog, :
|
30
|
+
attr_reader :node, :facts, :collections, :catalog, :resources, :relationships, :topscope
|
31
31
|
|
32
32
|
# Add a collection to the global list.
|
33
33
|
def add_collection(coll)
|
@@ -127,7 +127,7 @@ class Puppet::Parser::Compiler
|
|
127
127
|
|
128
128
|
# Evaluate all of the classes specified by the node.
|
129
129
|
def evaluate_node_classes
|
130
|
-
evaluate_classes(@node.classes, topscope)
|
130
|
+
evaluate_classes(@node.classes, @node_scope || topscope)
|
131
131
|
end
|
132
132
|
|
133
133
|
# Evaluate each specified class in turn. If there are any classes we can't
|
@@ -201,12 +201,6 @@ class Puppet::Parser::Compiler
|
|
201
201
|
@resource_overrides[resource.ref]
|
202
202
|
end
|
203
203
|
|
204
|
-
# The top scope is usually the top-level scope, but if we're using AST nodes,
|
205
|
-
# then it is instead the node's scope.
|
206
|
-
def topscope
|
207
|
-
node_scope || @topscope
|
208
|
-
end
|
209
|
-
|
210
204
|
private
|
211
205
|
|
212
206
|
# If ast nodes are enabled, then see if we can find and evaluate one.
|
@@ -229,8 +223,6 @@ class Puppet::Parser::Compiler
|
|
229
223
|
|
230
224
|
resource.evaluate
|
231
225
|
|
232
|
-
# Now set the node scope appropriately, so that :topscope can
|
233
|
-
# behave differently.
|
234
226
|
@node_scope = topscope.class_scope(astnode)
|
235
227
|
end
|
236
228
|
|
@@ -17,8 +17,9 @@ Puppet::Parser::Functions::newfunction(:template, :type => :rvalue, :doc =>
|
|
17
17
|
begin
|
18
18
|
wrapper.result
|
19
19
|
rescue => detail
|
20
|
+
info = detail.backtrace.first.split(':')
|
20
21
|
raise Puppet::ParseError,
|
21
|
-
"Failed to parse template #{file}: #{detail}"
|
22
|
+
"Failed to parse template #{file}:\n Filepath: #{info[0]}\n Line: #{info[1]}\n Detail: #{detail}\n"
|
22
23
|
end
|
23
24
|
end.join("")
|
24
25
|
end
|
data/lib/puppet/parser/lexer.rb
CHANGED
@@ -240,11 +240,11 @@ class Puppet::Parser::Lexer
|
|
240
240
|
end
|
241
241
|
#:startdoc:
|
242
242
|
|
243
|
-
TOKENS.add_token :DOLLAR_VAR, %r{\$(::)?(
|
243
|
+
TOKENS.add_token :DOLLAR_VAR, %r{\$(::)?(\w+::)*\w+} do |lexer, value|
|
244
244
|
[TOKENS[:VARIABLE],value[1..-1]]
|
245
245
|
end
|
246
246
|
|
247
|
-
TOKENS.add_token :VARIABLE, %r{(::)?(
|
247
|
+
TOKENS.add_token :VARIABLE, %r{(::)?(\w+::)*\w+}
|
248
248
|
#:stopdoc: # Issue #4161
|
249
249
|
def (TOKENS[:VARIABLE]).acceptable?(context={})
|
250
250
|
[:DQPRE,:DQMID].include? context[:after]
|
data/lib/puppet/parser/scope.rb
CHANGED
@@ -241,6 +241,7 @@ class Puppet::Parser::Scope
|
|
241
241
|
# Save the originating scope for the request
|
242
242
|
options[:origin] = self unless options[:origin]
|
243
243
|
table = ephemeral?(name) ? @ephemeral.last : @symtable
|
244
|
+
|
244
245
|
if name =~ /^(.*)::(.+)$/
|
245
246
|
begin
|
246
247
|
qualified_scope($1).twoscope_lookupvar($2, options.merge({:origin => nil}))
|
@@ -250,10 +251,10 @@ class Puppet::Parser::Scope
|
|
250
251
|
:undefined
|
251
252
|
end
|
252
253
|
# If the value is present and either we are top/node scope or originating scope...
|
253
|
-
elsif (ephemeral_include?(name) or table.include?(name)) and (compiler and self == compiler.topscope or (
|
254
|
+
elsif (ephemeral_include?(name) or table.include?(name)) and (compiler and self == compiler.topscope or (resource and resource.type == "Node") or self == options[:origin])
|
254
255
|
table[name]
|
255
256
|
elsif resource and resource.type == "Class" and parent_type = resource.resource_type.parent
|
256
|
-
|
257
|
+
qualified_scope(parent_type).twoscope_lookupvar(name,options.merge({:origin => nil}))
|
257
258
|
elsif parent
|
258
259
|
parent.twoscope_lookupvar(name, options)
|
259
260
|
else
|
@@ -26,7 +26,9 @@ Puppet::Type.type(:package).provide :gem, :parent => Puppet::Provider::Package d
|
|
26
26
|
end
|
27
27
|
|
28
28
|
begin
|
29
|
-
list = execute(gem_list_command).lines.
|
29
|
+
list = execute(gem_list_command).lines.
|
30
|
+
map {|set| gemsplit(set) }.
|
31
|
+
reject {|x| x.nil? }
|
30
32
|
rescue Puppet::ExecutionFailure => detail
|
31
33
|
raise Puppet::Error, "Could not list gems: #{detail}"
|
32
34
|
end
|
@@ -22,8 +22,8 @@ Puppet::Type.type(:package).provide :pkg, :parent => Puppet::Provider::Package d
|
|
22
22
|
packages
|
23
23
|
end
|
24
24
|
|
25
|
-
self::REGEX = /^(\S+)(?:\s+\(.*?\))?\s+(\S+)\s+(\S+)\
|
26
|
-
self::FIELDS = [:name, :version, :status]
|
25
|
+
self::REGEX = /^(\S+)(?:\s+\(.*?\))?\s+(\S+)\s+(\S+)?\s+(\S+)$/
|
26
|
+
self::FIELDS = [:name, :version, :status, :flags]
|
27
27
|
|
28
28
|
def self.parse_line(line)
|
29
29
|
hash = {}
|
@@ -35,6 +35,22 @@ Puppet::Type.type(:package).provide :pkg, :parent => Puppet::Provider::Package d
|
|
35
35
|
|
36
36
|
hash[:provider] = self.name
|
37
37
|
|
38
|
+
# on solaris 11 we do not have a status field because the status
|
39
|
+
# seems to be merged in the flags field. Simulate old behaviour on
|
40
|
+
# solaris 11
|
41
|
+
flags = hash.delete(:flags)
|
42
|
+
unless hash[:status]
|
43
|
+
hash[:status] = case flags
|
44
|
+
when /^i/
|
45
|
+
'installed'
|
46
|
+
when /^-/
|
47
|
+
'known'
|
48
|
+
else
|
49
|
+
warning "unknown package state for #{hash[:name]}: #{flags}"
|
50
|
+
'unknown'
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
38
54
|
if hash[:status] == "installed"
|
39
55
|
hash[:ensure] = :present
|
40
56
|
else
|