puppet 3.0.0 → 3.0.1.rc1

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 (70) hide show
  1. data/Rakefile +24 -19
  2. data/bin/puppet +0 -6
  3. data/examples/modules/{sample-module.pp → sample_module.pp} +1 -1
  4. data/examples/modules/{sample-module → sample_module}/lib/puppet/parser/functions/hostname_to_dn.rb +0 -0
  5. data/examples/modules/{sample-module → sample_module}/manifests/init.pp +1 -1
  6. data/examples/modules/{sample-module → sample_module}/templates/sample.erb +0 -0
  7. data/ext/debian/puppetmaster.README.debian +1 -2
  8. data/ext/debian/puppetmaster.default +1 -28
  9. data/ext/debian/puppetmaster.init +49 -70
  10. data/ext/project_data.yaml +2 -2
  11. data/ext/rack/README +0 -15
  12. data/ext/rack/files/config.ru +4 -2
  13. data/ext/redhat/logrotate +1 -1
  14. data/ext/redhat/server.init +34 -49
  15. data/ext/redhat/server.sysconfig +2 -20
  16. data/ext/suse/client.init +10 -9
  17. data/ext/suse/puppet.spec +12 -25
  18. data/ext/suse/server.init +25 -15
  19. data/ext/windows/service/daemon.bat +1 -1
  20. data/ext/windows/service/daemon.rb +1 -1
  21. data/lib/puppet.rb +0 -6
  22. data/lib/puppet/application/agent.rb +1 -0
  23. data/lib/puppet/defaults.rb +2 -9
  24. data/lib/puppet/feature/eventlog.rb +0 -1
  25. data/lib/puppet/feature/rack.rb +1 -6
  26. data/lib/puppet/feature/rails.rb +0 -2
  27. data/lib/puppet/feature/rubygems.rb +5 -1
  28. data/lib/puppet/feature/ssh.rb +0 -1
  29. data/lib/puppet/feature/stomp.rb +0 -1
  30. data/lib/puppet/feature/zlib.rb +0 -1
  31. data/lib/puppet/network/http/rack/rest.rb +4 -1
  32. data/lib/puppet/rails/inventory_node.rb +26 -13
  33. data/lib/puppet/run.rb +1 -1
  34. data/lib/puppet/settings.rb +12 -7
  35. data/lib/puppet/util/command_line.rb +11 -0
  36. data/lib/puppet/util/rubygems.rb +7 -6
  37. data/lib/puppet/util/run_mode.rb +12 -11
  38. data/lib/puppet/util/zaml.rb +1 -1
  39. data/lib/puppet/version.rb +1 -1
  40. data/man/man5/puppet.conf.5 +4 -4
  41. data/spec/integration/defaults_spec.rb +4 -4
  42. data/spec/unit/network/http/rack/rest_spec.rb +13 -0
  43. data/spec/unit/run_spec.rb +11 -5
  44. data/spec/unit/util/rubygems_spec.rb +4 -2
  45. data/spec/unit/util/run_mode_spec.rb +9 -0
  46. data/spec/unit/util/zaml_spec.rb +53 -25
  47. metadata +2189 -2210
  48. data/examples/modules/sample-module/README.txt +0 -17
  49. data/ext/packaging/README-Solaris.md +0 -117
  50. data/ext/packaging/README.md +0 -89
  51. data/ext/packaging/tasks/00_utils.rb +0 -290
  52. data/ext/packaging/tasks/10_setupvars.rake +0 -64
  53. data/ext/packaging/tasks/apple.rake +0 -201
  54. data/ext/packaging/tasks/clean.rake +0 -5
  55. data/ext/packaging/tasks/deb.rake +0 -103
  56. data/ext/packaging/tasks/gem.rake +0 -55
  57. data/ext/packaging/tasks/ips.rake +0 -80
  58. data/ext/packaging/tasks/mock.rake +0 -88
  59. data/ext/packaging/tasks/release.rake +0 -56
  60. data/ext/packaging/tasks/rpm.rake +0 -39
  61. data/ext/packaging/tasks/ship.rake +0 -36
  62. data/ext/packaging/tasks/sign.rake +0 -79
  63. data/ext/packaging/tasks/tag.rake +0 -8
  64. data/ext/packaging/tasks/tar.rake +0 -20
  65. data/ext/packaging/tasks/version.rake +0 -20
  66. data/ext/suse/fileserver.conf +0 -12
  67. data/ext/suse/logrotate +0 -10
  68. data/ext/suse/puppet.conf +0 -25
  69. data/lib/puppet/network/http/mongrel/rest.rb +0 -104
  70. data/spec/integration/network/server/mongrel_spec.rb +0 -64
@@ -5,27 +5,9 @@
5
5
  # Specify syslog to send log messages to the system log.
6
6
  #PUPPETMASTER_LOG=syslog
7
7
 
8
- # You may specify an alternate port or an array of ports on which
9
- # puppetmaster should listen. Default is: 8140
10
- # If you specify more than one port, the puppetmaster ist automatically
11
- # started with the servertype set to mongrel. This might be interesting
12
- # if you'd like to run your puppetmaster in a loadbalanced cluster.
13
- # Please note: this won't setup nor start any loadbalancer.
14
- # If you'd like to run puppetmaster with mongrel as servertype but only
15
- # on one (specified) port, you have to add --servertype=mongrel to
16
- # PUPPETMASTER_EXTRA_OPTS.
17
- # Default: Empty (Puppetmaster isn't started with mongrel, nor on a
18
- # specific port)
19
- #
20
- # Please note: Due to reduced options in the rc-functions lib in RHEL/Centos
21
- # versions prior to 5, this feature won't work. Fedora versions >= 8 are
22
- # known to work.
23
- #PUPPETMASTER_PORTS=""
24
- # Puppetmaster on a different port, run with standard webrick servertype
8
+ # You may specify an alternate port on which your puppetmaster should listen. Default is: 8140
9
+ # An example with puppetmaster on a different port, run with standard webrick servertype
25
10
  #PUPPETMASTER_PORTS="8141"
26
- # Example with multiple ports which will start puppetmaster with mongrel
27
- # as a servertype
28
- #PUPPETMASTER_PORTS=( 18140 18141 18142 18143 )
29
11
 
30
12
  # You may specify other parameters to the puppetmaster here
31
13
  #PUPPETMASTER_EXTRA_OPTS=--no-ca
@@ -34,10 +34,11 @@
34
34
  [ -f /etc/rc.status ] && . /etc/rc.status
35
35
  [ -f /etc/sysconfig/puppet ] && . /etc/sysconfig/puppet
36
36
  lockfile=${LOCKFILE-/var/lock/subsys/puppet}
37
- pidfile=${PIDFILE-/var/run/puppet.pid}
38
- puppetd=${PUPPETD-/usr/sbin/puppetd}
37
+ pidfile=${PIDFILE-/var/run/puppet/agent.pid}
38
+ puppetd=${PUPPETD-/usr/bin/puppet}
39
+ RETVAL=0
39
40
 
40
- PUPPET_OPTS=""
41
+ PUPPET_OPTS="agent"
41
42
  [ -n "${PUPPET_SERVER}" ] && PUPPET_OPTS="--server=${PUPPET_SERVER}"
42
43
  [ -n "$PUPPET_LOG" ] && PUPPET_OPTS="${PUPPET_OPTS} --logdest=${PUPPET_LOG}"
43
44
  [ -n "$PUPPET_PORT" ] && PUPPET_OPTS="${PUPPET_OPTS} --port=${PUPPET_PORT}"
@@ -67,7 +68,7 @@ case "$1" in
67
68
 
68
69
  # startproc should return 0, even if service is
69
70
  # already running to match LSB spec.
70
- startproc $puppetd ${PUPPET_OPTS} ${PUPPET_EXTRA_OPTS} && touch ${lockfile}
71
+ startproc -p ${pidfile} $puppetd ${PUPPET_OPTS} ${PUPPET_EXTRA_OPTS} && touch ${lockfile}
71
72
  # Remember status and be verbose
72
73
  rc_status -v
73
74
  ;;
@@ -76,7 +77,7 @@ case "$1" in
76
77
  ## Stop daemon with killproc(8) and if this fails
77
78
  ## set echo the echo return value.
78
79
 
79
- killproc -QUIT $puppetd && rm -f ${lockfile} ${pidfile}
80
+ killproc -QUIT -p ${pidfile} $puppetd && rm -f ${lockfile} ${pidfile}
80
81
 
81
82
  # Remember status and be verbose
82
83
  rc_status -v
@@ -105,7 +106,7 @@ case "$1" in
105
106
 
106
107
  echo -n "Reload service puppet"
107
108
  ## if it supports it:
108
- killproc -HUP $puppetd
109
+ killproc -HUP -p ${pidfile} $puppetd
109
110
  rc_status -v
110
111
  ;;
111
112
  reload)
@@ -114,7 +115,7 @@ case "$1" in
114
115
 
115
116
  # If it supports signalling:
116
117
  echo -n "Reload puppet services."
117
- killproc -HUP $puppetd
118
+ killproc -HUP -p ${pidfile} $puppetd
118
119
  rc_status -v
119
120
  ;;
120
121
  status)
@@ -129,12 +130,12 @@ case "$1" in
129
130
  # 3 - service not running
130
131
 
131
132
  # NOTE: checkproc returns LSB compliant status values.
132
- checkproc $puppetd
133
+ checkproc -p ${pidfile} $puppetd
133
134
  rc_status -v
134
135
  ;;
135
136
  once)
136
137
  shift
137
- $puppetd -o ${PUPPET_OPTS} ${PUPPET_EXTRA_OPTS} $@
138
+ $puppetd ${PUPPET_OPTS} --onetime ${PUPPET_EXTRA_OPTS} $@
138
139
  ;;
139
140
  *)
140
141
  echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|once}"
@@ -5,8 +5,7 @@
5
5
  Summary: A network tool for managing many disparate systems
6
6
  Name: puppet
7
7
  Version: 3.0.0
8
- Release: 0.1rc4%{?dist}
9
- #Release: 1%{?dist}
8
+ Release: 1%{?dist}
10
9
  License: Apache 2.0
11
10
  Group: Productivity/Networking/System
12
11
 
@@ -14,11 +13,11 @@ URL: http://puppetlabs.com/projects/puppet/
14
13
  Source0: http://puppetlabs.com/downloads/puppet/%{name}-%{version}.tar.gz
15
14
 
16
15
  PreReq: %{insserv_prereq} %{fillup_prereq}
17
- Requires: ruby >= 1.8.2
16
+ Requires: ruby >= 1.8.7
18
17
  Requires: facter >= 1.6.11
19
18
  Requires: cron
20
19
  BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
21
- BuildRequires: ruby >= 1.8.2
20
+ BuildRequires: ruby >= 1.8.7
22
21
 
23
22
  %description
24
23
  Puppet lets you centrally manage every important aspect of your system using a
@@ -39,12 +38,11 @@ The server can also function as a certificate authority and file server.
39
38
  %setup -q -n %{name}-%{version}
40
39
 
41
40
  %build
42
- for f in bin/* sbin/*; do
41
+ for f in bin/*; do
43
42
  sed -i -e '1s,^#!.*ruby$,#!/usr/bin/ruby,' $f
44
43
  done
45
44
 
46
45
  %install
47
- %{__install} -d -m0755 %{buildroot}%{_sbindir}
48
46
  %{__install} -d -m0755 %{buildroot}%{_bindir}
49
47
  %{__install} -d -m0755 %{buildroot}%{_confdir}
50
48
  %{__install} -d -m0755 %{buildroot}%{ruby_sitelibdir}
@@ -54,34 +52,25 @@ done
54
52
  %{__install} -d -m0755 %{buildroot}%{_localstatedir}/run/puppet
55
53
  %{__install} -d -m0755 %{buildroot}%{_localstatedir}/log/puppet
56
54
  %{__install} -Dp -m0755 %{pbuild}/bin/* %{buildroot}%{_bindir}
57
- %{__install} -Dp -m0755 %{pbuild}/sbin/* %{buildroot}%{_sbindir}
58
55
  %{__install} -Dp -m0644 %{pbuild}/lib/puppet.rb %{buildroot}%{ruby_sitelibdir}/puppet.rb
59
56
  %{__cp} -a %{pbuild}/lib/puppet %{buildroot}%{ruby_sitelibdir}
60
57
  find %{buildroot}%{ruby_sitelibdir} -type f -perm +ugo+x -exec chmod a-x '{}' \;
61
- %{__cp} -a %{pbuild}/conf/redhat/client.sysconfig %{buildroot}%{_confdir}/client.sysconfig
58
+ %{__cp} -a %{pbuild}/ext/redhat/client.sysconfig %{buildroot}%{_confdir}/client.sysconfig
62
59
  %{__install} -Dp -m0644 %{buildroot}%{_confdir}/client.sysconfig %{buildroot}/var/adm/fillup-templates/sysconfig.puppet
63
- %{__cp} -a %{pbuild}/conf/redhat/server.sysconfig %{buildroot}%{_confdir}/server.sysconfig
60
+ %{__cp} -a %{pbuild}/ext/redhat/server.sysconfig %{buildroot}%{_confdir}/server.sysconfig
64
61
  %{__install} -Dp -m0644 %{buildroot}%{_confdir}/server.sysconfig %{buildroot}/var/adm/fillup-templates/sysconfig.puppetmaster
65
- %{__cp} -a %{pbuild}/conf/redhat/fileserver.conf %{buildroot}%{_confdir}/fileserver.conf
62
+ %{__cp} -a %{pbuild}/ext/redhat/fileserver.conf %{buildroot}%{_confdir}/fileserver.conf
66
63
  %{__install} -Dp -m0644 %{buildroot}%{_confdir}/fileserver.conf %{buildroot}%{_sysconfdir}/puppet/fileserver.conf
67
- %{__cp} -a %{pbuild}/conf/redhat/puppet.conf %{buildroot}%{_confdir}/puppet.conf
64
+ %{__cp} -a %{pbuild}/ext/redhat/puppet.conf %{buildroot}%{_confdir}/puppet.conf
68
65
  %{__install} -Dp -m0644 %{buildroot}%{_confdir}/puppet.conf %{buildroot}%{_sysconfdir}/puppet/puppet.conf
69
- %{__cp} -a %{pbuild}/conf/redhat/logrotate %{buildroot}%{_confdir}/logrotate
66
+ %{__cp} -a %{pbuild}/ext/redhat/logrotate %{buildroot}%{_confdir}/logrotate
70
67
  %{__install} -Dp -m0644 %{buildroot}%{_confdir}/logrotate %{buildroot}%{_sysconfdir}/logrotate.d/puppet
71
68
  %{__install} -Dp -m0755 %{confdir}/client.init %{buildroot}%{_initrddir}/puppet
72
69
  %{__install} -Dp -m0755 %{confdir}/server.init %{buildroot}%{_initrddir}/puppetmaster
73
- %{__ln_s} %{_initrddir}/puppet %{buildroot}%{_sbindir}/rcpuppet
74
- %{__ln_s} %{_initrddir}/puppetmaster %{buildroot}%{_sbindir}/rcpuppetmaster
75
70
 
76
71
  %files
77
72
  %defattr(-, root, root, 0755)
78
73
  %{_bindir}/puppet
79
- %{_bindir}/puppetdoc
80
- %{_bindir}/filebucket
81
- %{_bindir}/ralsh
82
- %{_bindir}/pi
83
- %{_sbindir}/puppetd
84
- %{_sbindir}/rcpuppet
85
74
  %{ruby_sitelibdir}/*
86
75
  %{_initrddir}/puppet
87
76
  /var/adm/fillup-templates/sysconfig.puppet
@@ -97,11 +86,6 @@ find %{buildroot}%{ruby_sitelibdir} -type f -perm +ugo+x -exec chmod a-x '{}' \;
97
86
 
98
87
  %files server
99
88
  %defattr(-, root, root, 0755)
100
- %{_sbindir}/puppetmasterd
101
- %{_sbindir}/rcpuppetmaster
102
- %{_sbindir}/puppetqd
103
- %{_sbindir}/puppetrun
104
- %{_sbindir}/puppetca
105
89
  %{_initrddir}/puppetmaster
106
90
  %config(noreplace) %{_sysconfdir}/puppet/*
107
91
  %exclude %{_sysconfdir}/puppet/puppet.conf
@@ -137,6 +121,9 @@ find %{buildroot}%{ruby_sitelibdir} -type f -perm +ugo+x -exec chmod a-x '{}' \;
137
121
  %{__rm} -rf %{buildroot}
138
122
 
139
123
  %changelog
124
+ * Mon Oct 08 2012 Matthaus Owens <matthaus@puppetlabs.com> - 3.0.0-1
125
+ - Update for deprecated binary removal, ruby version requirements
126
+
140
127
  * Fri Aug 24 2012 Eric Sorenson <eric0@puppetlabs.com> - 3.0.0-0.1rc4
141
128
  - Update facter version dependency
142
129
  - Update for 3.0.0-0.1rc4
@@ -31,7 +31,7 @@
31
31
  # rc_exit exit appropriate to overall rc status
32
32
 
33
33
  lockfile=/var/lock/subsys/puppetmaster
34
- pidfile=/var/run/puppet/puppetmasterd.pid
34
+ pidfile=/var/run/puppet/master.pid
35
35
 
36
36
  # Source function library.
37
37
  [ -f /etc/rc.status ] && . /etc/rc.status
@@ -40,19 +40,28 @@ if [ -f /etc/sysconfig/puppetmaster ]; then
40
40
  . /etc/sysconfig/puppetmaster
41
41
  fi
42
42
 
43
- PUPPETMASTER_OPTS=""
44
- [ -n "$PUPPETMASTER_MANIFEST" ] && PUPPETMASTER_OPTS="--manifest=${PUPPETMASTER_MANIFEST}"
45
- if [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -gt 1 ]; then
46
- PUPPETMASTER_OPTS="$PUPPETMASTER_OPTS --servertype=mongrel"
47
- elif [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -eq 1 ]; then
48
- PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} --masterport=${PUPPETMASTER_PORTS[0]}"
49
- fi
43
+ PUPPETMASTER_OPTS="master "
44
+ [ -n "$PUPPETMASTER_MANIFEST" ] && PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} --manifest=${PUPPETMASTER_MANIFEST}"
45
+ [ -n "$PUPPETMASTER_PORTS" ] && PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} --masterport=${PUPPETMASTER_PORTS[0]}"
50
46
  [ -n "$PUPPETMASTER_LOG" ] && PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} --logdest ${PUPPETMASTER_LOG}"
51
47
  PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} \
52
48
  ${PUPPETMASTER_EXTRA_OPTS}"
53
49
 
54
- prog=puppetmasterd
55
- PUPPETMASTER=/usr/sbin/$prog
50
+ RETVAL=0
51
+
52
+ PUPPETMASTER=/usr/bin/puppet
53
+
54
+ mongrel_warning="The mongrel servertype is no longer built-in to Puppet. It appears
55
+ as though mongrel is being used, as the number of ports is greater than
56
+ one. Starting the puppetmaster service will not behave as expected until this
57
+ is resolved. Only the first port has been used in the service. These settings
58
+ are defined at /etc/sysconfig/puppetmaster"
59
+
60
+ # Warn about removed and unsupported mongrel servertype
61
+ if [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -gt 1 ]; then
62
+ echo $mongrel_warning
63
+ echo
64
+ fi
56
65
 
57
66
  start() {
58
67
  echo -n $"Starting puppetmaster: "
@@ -60,6 +69,7 @@ start() {
60
69
  echo
61
70
  return $RETVAL
62
71
  }
72
+
63
73
  # First reset status of this service
64
74
  rc_reset
65
75
 
@@ -87,7 +97,7 @@ case "$1" in
87
97
  # already running to match LSB spec.
88
98
  # Confirm the manifest exists
89
99
  if [ -r $PUPPETMASTER_MANIFEST ]; then
90
- startproc $PUPPETMASTER $PUPPETMASTER_OPTS && touch "$lockfile"
100
+ startproc -p ${pidfile} $PUPPETMASTER $PUPPETMASTER_OPTS && touch "$lockfile"
91
101
  else
92
102
  rc_failed
93
103
  echo "Manifest does not exist: $PUPPETMASTER_MANIFEST"
@@ -100,7 +110,7 @@ case "$1" in
100
110
  ## Stop daemon with killproc(8) and if this fails
101
111
  ## set echo the echo return value.
102
112
 
103
- killproc -QUIT $PUPPETMASTER && rm -f ${lockfile} ${pidfile}
113
+ killproc -QUIT -p ${pidfile} $PUPPETMASTER && rm -f ${lockfile} ${pidfile}
104
114
 
105
115
  # Remember status and be verbose
106
116
  rc_status -v
@@ -129,7 +139,7 @@ case "$1" in
129
139
 
130
140
  echo -n "Reload service puppet"
131
141
  ## if it supports it:
132
- killproc -HUP $PUPPETMASTER
142
+ killproc -HUP -p ${pidfile} $PUPPETMASTER
133
143
  rc_status -v
134
144
  ;;
135
145
  reload)
@@ -138,7 +148,7 @@ case "$1" in
138
148
 
139
149
  # If it supports signalling:
140
150
  echo -n "Reload puppet services."
141
- killproc -HUP $PUPPETMASTER
151
+ killproc -HUP -p ${pidfile} $PUPPETMASTER
142
152
  rc_status -v
143
153
  ;;
144
154
  status)
@@ -153,7 +163,7 @@ case "$1" in
153
163
  # 3 - service not running
154
164
 
155
165
  # NOTE: checkproc returns LSB compliant status values.
156
- checkproc $PUPPETMASTER
166
+ checkproc -p ${pidfile} $PUPPETMASTER
157
167
  rc_status -v
158
168
  ;;
159
169
  *)
@@ -3,4 +3,4 @@ SETLOCAL
3
3
 
4
4
  call "%~dp0..\bin\environment.bat" %0 %*
5
5
 
6
- rubyw "%~dp0daemon.rb" %*
6
+ rubyw -rubygems "%~dp0daemon.rb" %*
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- require 'rubygems'
2
+
3
3
  require 'fileutils'
4
4
  require 'win32/daemon'
5
5
  require 'win32/dir'
@@ -1,11 +1,5 @@
1
1
  require 'puppet/version'
2
2
 
3
- # Try to load rubygems. Hey rubygems, I hate you.
4
- begin
5
- require 'rubygems'
6
- rescue LoadError
7
- end
8
-
9
3
  # see the bottom of the file for further inclusions
10
4
  require 'facter'
11
5
  require 'puppet/error'
@@ -1,4 +1,5 @@
1
1
  require 'puppet/application'
2
+ require 'puppet/run'
2
3
 
3
4
  class Puppet::Application::Agent < Puppet::Application
4
5
 
@@ -1375,12 +1375,6 @@ EOT
1375
1375
 
1376
1376
  define_settings(
1377
1377
  :ldap,
1378
- :ldapnodes => {
1379
- :default => false,
1380
- :type => :boolean,
1381
- :desc => "Whether to search for node configurations in LDAP. See
1382
- http://projects.puppetlabs.com/projects/puppet/wiki/LDAP_Nodes for more information.",
1383
- },
1384
1378
  :ldapssl => {
1385
1379
  :default => false,
1386
1380
  :type => :boolean,
@@ -1397,11 +1391,11 @@ EOT
1397
1391
  },
1398
1392
  :ldapserver => {
1399
1393
  :default => "ldap",
1400
- :desc => "The LDAP server. Only used if `ldapnodes` is enabled.",
1394
+ :desc => "The LDAP server. Only used if `node_terminus` is set to `ldap`.",
1401
1395
  },
1402
1396
  :ldapport => {
1403
1397
  :default => 389,
1404
- :desc => "The LDAP port. Only used if `ldapnodes` is enabled.",
1398
+ :desc => "The LDAP port. Only used if `node_terminus` is set to `ldap`.",
1405
1399
  },
1406
1400
 
1407
1401
  :ldapstring => {
@@ -1471,7 +1465,6 @@ You can adjust the backend using the storeconfigs_backend setting.",
1471
1465
  Puppet.settings[:catalog_cache_terminus] = :store_configs
1472
1466
  end
1473
1467
  Puppet::Node::Facts.indirection.cache_class = :store_configs
1474
- Puppet::Node.indirection.cache_class = :store_configs
1475
1468
 
1476
1469
  Puppet::Resource.indirection.terminus_class = :store_configs
1477
1470
  end
@@ -1,6 +1,5 @@
1
1
  require 'puppet/util/feature'
2
2
 
3
3
  if Puppet.features.microsoft_windows?
4
- Puppet.features.rubygems?
5
4
  Puppet.features.add(:eventlog, :libs => %{win32/eventlog})
6
5
  end
@@ -3,12 +3,7 @@ require 'puppet/util/feature'
3
3
  # See if we have rack available, an HTTP Application Stack
4
4
  # Explicitly depend on rack library version >= 1.0.0
5
5
  Puppet.features.add(:rack) do
6
- begin
7
- require 'rack'
8
- rescue LoadError => detail
9
- require 'rubygems'
10
- require 'rack'
11
- end
6
+ require 'rack'
12
7
 
13
8
  if ! (defined?(::Rack) and defined?(::Rack.release))
14
9
  false
@@ -1,7 +1,5 @@
1
1
  require 'puppet/util/feature'
2
2
 
3
- Puppet.features.rubygems?
4
-
5
3
  Puppet.features.add(:rails) do
6
4
  begin
7
5
  # Turn off the constant watching parts of ActiveSupport, which have a huge
@@ -1,3 +1,7 @@
1
1
  require 'puppet/util/feature'
2
2
 
3
- Puppet.features.add(:rubygems, :libs => "rubygems")
3
+ Puppet.features.add(:rubygems) do
4
+ Puppet.deprecation_warning "Puppet.features.rubygems? is deprecated. Require rubygems in your application's entry point if you need it."
5
+
6
+ require 'rubygems'
7
+ end
@@ -1,4 +1,3 @@
1
1
  require 'puppet/util/feature'
2
2
 
3
- Puppet.features.rubygems?
4
3
  Puppet.features.add(:ssh, :libs => %{net/ssh})
@@ -2,5 +2,4 @@ require 'puppet/util/feature'
2
2
 
3
3
  # We want this to load if possible, but it's not automatically
4
4
  # required.
5
- Puppet.features.rubygems?
6
5
  Puppet.features.add(:stomp, :libs => %{stomp})
@@ -2,5 +2,4 @@ require 'puppet/util/feature'
2
2
 
3
3
  # We want this to load if possible, but it's not automatically
4
4
  # required.
5
- Puppet.features.rubygems?
6
5
  Puppet.features.add(:zlib, :libs => %{zlib})
@@ -82,7 +82,10 @@ class Puppet::Network::HTTP::RackREST < Puppet::Network::HTTP::RackHttpHandler
82
82
  def client_cert(request)
83
83
  # This environment variable is set by mod_ssl, note that it
84
84
  # requires the `+ExportCertData` option in the `SSLOptions` directive
85
- return nil unless cert = request.env['SSL_CLIENT_CERT']
85
+ cert = request.env['SSL_CLIENT_CERT']
86
+ # NOTE: The SSL_CLIENT_CERT environment variable will be the empty string
87
+ # when Puppet agent nodes have not yet obtained a signed certificate.
88
+ return nil if cert.nil? or cert.empty?
86
89
  OpenSSL::X509::Certificate.new(cert)
87
90
  end
88
91
 
@@ -4,23 +4,36 @@ class Puppet::Rails::InventoryNode < ::ActiveRecord::Base
4
4
  has_many :facts, :class_name => "Puppet::Rails::InventoryFact", :foreign_key => :node_id, :dependent => :delete_all
5
5
 
6
6
  if Puppet::Util.activerecord_version < 3.0
7
- # For backward compatibility, add the newer name to older implementations.
8
- ActiveRecord::NamedScope::ClassMethods.module_eval { alias :scope :named_scope }
9
- end
7
+ # For backward compatibility, use the old named_scope with pre 3.0 activerecord
8
+ named_scope :has_fact_with_value, lambda { |name,value|
9
+ {
10
+ :conditions => ["inventory_facts.name = ? AND inventory_facts.value = ?", name, value.to_s],
11
+ :joins => :facts
12
+ }
13
+ }
10
14
 
11
- scope :has_fact_with_value, lambda { |name,value|
12
- {
13
- :conditions => ["inventory_facts.name = ? AND inventory_facts.value = ?", name, value.to_s],
14
- :joins => :facts
15
+ named_scope :has_fact_without_value, lambda { |name,value|
16
+ {
17
+ :conditions => ["inventory_facts.name = ? AND inventory_facts.value != ?", name, value.to_s],
18
+ :joins => :facts
19
+ }
20
+ }
21
+ else
22
+ # Use scope for activerecord >= 3.0
23
+ scope :has_fact_with_value, lambda { |name,value|
24
+ {
25
+ :conditions => ["inventory_facts.name = ? AND inventory_facts.value = ?", name, value.to_s],
26
+ :joins => :facts
27
+ }
15
28
  }
16
- }
17
29
 
18
- scope :has_fact_without_value, lambda { |name,value|
19
- {
20
- :conditions => ["inventory_facts.name = ? AND inventory_facts.value != ?", name, value.to_s],
21
- :joins => :facts
30
+ scope :has_fact_without_value, lambda { |name,value|
31
+ {
32
+ :conditions => ["inventory_facts.name = ? AND inventory_facts.value != ?", name, value.to_s],
33
+ :joins => :facts
34
+ }
22
35
  }
23
- }
36
+ end
24
37
 
25
38
  def facts_to_hash
26
39
  facts.inject({}) do |fact_hash,fact|