Removed extra whitespace from end of lines

This commit is contained in:
Ian Taylor 2009-06-05 12:39:04 -04:00 коммит произвёл James Turnbull
Родитель 97e6975d69
Коммит 4f2c066a97
422 изменённых файлов: 3029 добавлений и 3029 удалений

148
CHANGELOG
Просмотреть файл

@ -1,5 +1,5 @@
0.25.0
Fixed #2280 - Detailed exit codes fix
Fixed #2280 - Detailed exit codes fix
Fixed #198 - Puppet man pages added
@ -25,7 +25,7 @@
0.24.8
Fixed #2077 - ralsh user broken on OSX
Fixed #2004 - ssh_authorized_key fails if no target is defined
Fixed #1629 - incorrect permissions on ssh_authorized_keys created files
@ -44,9 +44,9 @@
Fixed #1871 - Sensitive information leaked in log reports
Fixed #1956 - Cleaned up variable names to be more sane, clarified error messages
Fixed #1956 - Cleaned up variable names to be more sane, clarified error messages
and fixed incorrect use of 'value' variable rather than 'member'.
Fixed #1831 - Added sprintf function
Fixed #1830 - Added regsubst function
@ -55,7 +55,7 @@
Fixing #1948 and #1953 - augeas ins bug: wrong number of arguments (1 for 3)
Fixing #944 - changing error message from warning to info - connection recycled
Fixing #944 - changing error message from warning to info - connection recycled
Fixed #961 - puppetd creating too many/not closing TCP connections
@ -70,7 +70,7 @@
Fixed #1884 - Exported resources are marked as unexported when collected on the exporting host
Fixed #1922 - Functions squash all arguments into a single hash
Fixed #1538 - Yumrepo sets permissions wrongly on files in /etc/yum.repos.d
Fixed #1936 - Added /* */ support to the vim file
@ -78,7 +78,7 @@
Fixed #1541 - nagios objects write files to clientbucket on every change
Fixed #1542 - cannot purge nagios objects
Fixing #1912 - gid still works with no 'should' value fixing ralsh issues
Fixing the Rakefile to use 'git format-patch'
@ -93,8 +93,8 @@
Updated Red Hat spec file 0.24.7
Fixed #1920 - Shadow password corruption
Fixed #1920 - Shadow password corruption
0.24.7
Fixed #1804 - Added VDev and MultiVDev properties to the ZPool type
@ -156,14 +156,14 @@
Fixed #1711 - fileserver test fails due to incorrect mocking
Fixed #1751 - Mac OS X DirectoryService nameservice provider support for
plist output and password hash fil
Fixed #1752 - Add an optional argument to Puppet::Util.execute to determine
Fixed #1751 - Mac OS X DirectoryService nameservice provider support for
plist output and password hash fil
Fixed #1752 - Add an optional argument to Puppet::Util.execute to determine
whether stderr and stdout are combined in the output
Added versionable feature to the RPM provider
Fixed #1668 - puppetca can't clean unsigned certs
Moved RRD feature from util/metric.rb to feature/base.rb
@ -200,7 +200,7 @@
Updated Red Hat spec file for 0.24.6
Removed conf/debian directory - Debian packaging information
Removed conf/debian directory - Debian packaging information
now maintained downstream
Added augeas type
@ -211,7 +211,7 @@
Added multiline comment support
0.24.6
Adding support to the user type for: profiles, auths, project,
Adding support to the user type for: profiles, auths, project,
key/value pairs (extension to Solaris RBAC support added in
0.24.6)
@ -223,21 +223,21 @@
Fixed #1655 - Provider::Confine::Variable tests are broken
Fixed #1646 - service puppet status does not work as non-root
Fixed #1646 - service puppet status does not work as non-root
on redhat system
Fixed #1649 - Updated OSX package cleanup
Fixed #1647 - puppetdoc -r providers now working again
Fixed #1639 - uninitialized constant Puppet::Type::User::ProviderUseradd
Fixed #1637 - With an inexistant (global) templatedir, modules
Fixed #1637 - With an inexistant (global) templatedir, modules
can't access their templates
Fixed #1202 - Collection attribute matching doesn't parse arrays
Fixed #1473 - Puppetd stops with error after puppetmasterd
Fixed #1473 - Puppetd stops with error after puppetmasterd
is unavailable
Fixed #1354 - yum provider problems with RHEL 3
@ -249,21 +249,21 @@
Fixing #947 - pluginsync no longer fails poorly when no plugins exist
Fixed #981 - Removed 'Adding aliases' info message
Fixing #1089 - Log messages are now tagged with the log level,
making it easier to match messages in the 'tagmail' report.
Fixing #1098 - Multiline strings now correctly increment the line count
Fixing #1614 - Environments no longer have to be listed out
Fixed #1628 - Changed node search to use certname rather than Facter
Fixed #1628 - Changed node search to use certname rather than Facter
hostname
Fixed #1613 - The client environment will be substituted when looking
Fixed #1613 - The client environment will be substituted when looking
up settings.
Updated puppet binary documentation
Updated puppet binary documentation
Feature #1624 - Added RBAC roles to solaris user provider
@ -292,13 +292,13 @@
Fixed #791 - You should now be able to create and find a user/group in one transaction.
Fixed #1610 - Raise "Filebucketed" messages to Notice priority
FIxed #1530 - ssh_authorized_keys provider does not crash anymore on SSH type 1 keys
Added a number of confines to package providers
Fixed #1609 - Added confines for the Gentoo, FreeBSD and
SMF (Solaris) service providers
Fixed #1609 - Added confines for the Gentoo, FreeBSD and
SMF (Solaris) service providers
Fixed #1608 - Added ubuntu to defaultfor for apt provider
@ -306,14 +306,14 @@
provider
Fixed #1045 - Multiple metaparams all get added to resources.
Fixed #1472 -- defined, exported resources in the current compile
Fixed #1472 -- defined, exported resources in the current compile
now get expanded correctly.
Fixed #1595 - Internally, Property#retrieve is no longer called
when no 'should' value is available for a resource.
Fixed #1588 - Fixed puppetca --clean --all
Fixed #1588 - Fixed puppetca --clean --all
Fixed #1584 - Added support for appended variables
@ -324,7 +324,7 @@
Fixed #1579 and #1580 - errors in the Puppet RPM spec file
Fixed #1572 -- file purging now fails if remote sources do not exist.
Fixed #1521 -- ldap user and password are now used with the default connection.
Fixed issues with file descriptors leaking into subprocesses
@ -338,7 +338,7 @@
Adjusted hpuxuseradd user provider to confine to HP-UX and fixed HP-UX user provider path regression
Fixed debug messages in package type - thanks to Todd Zullinger for this fix
Fixed #1566 - changed password property of the user type
Fixed debug messages in package type
@ -362,10 +362,10 @@
Fixed #1526 - Fixed leak in template
Fixed #1506 - Removed storeconfig duplicate indexes
Fixed #1457 - case insensitive match for error
Fixed #1488 - Moved individual functions out of functions.rb into
Fixed #1488 - Moved individual functions out of functions.rb into
lib/puppet/parser/functions directory. New functions should be create in this directory.
Fixed #1508 - Added HP-UX package provider
@ -377,7 +377,7 @@
Add the -P/--ping option to puppetrun, fixes #1501
Fixed #1394 - Added stored configuration clearing script to /ext
Fixed #1442 - replaced use of Facter for report titling with certname
Fixed $1456 - add proxy configuration capability to yum repo
@ -390,7 +390,7 @@
Expose all puppet variables as instance member variables of the template wrapper.
This helps resolve redmine #1427, by providing a safe mechanism to access variables.
* Implement Puppet::Parser::Scope#to_hash, which returns a hash containing all the
variable bindings in the current and, optionally, parent scope.
* Use that to set instance member variables into Puppet::Parser::Templatewrapper
@ -403,17 +403,17 @@
interpolation, not both, to avoid issues where a #{} interpolated value
contains a % character.
Feature #1476: Allow specification of --bindir --sbindir --sitelibdir --mandir --destdir
Feature #1476: Allow specification of --bindir --sbindir --sitelibdir --mandir --destdir
in installation
Added feature #1241 : Improve performance of group lookups
Fixed bug #1448: Puppet CA incorrectly writes out all certs to inventory .txt on each
Fixed bug #1448: Puppet CA incorrectly writes out all certs to inventory .txt on each
certificate signing
Fixing puppetlast to make it work with 0.24.5 / 0.25. Made puppetlast work on 0.24.5
Fixing puppetlast to make it work with 0.24.5 / 0.25. Made puppetlast work on 0.24.5
by using the YAML indirector
0.24.5
You can now select the encoding format when transferring the catalog,
with 'yaml' still being the default but 'marshal' being an option.
@ -433,12 +433,12 @@
Updated /spec/unit/rails.rb test
Fix #1426 - services on redhat are restarted again and status is
Fix #1426 - services on redhat are restarted again and status is
called from the Red Hat provider
Fixed #1414 - Return code from waitpid now right shifted 8 bits
Fixed #174 - a native type type for managing ssh authorized_keys
Fixed #174 - a native type type for managing ssh authorized_keys
files is available.
Further moves from the examples directory and ext directory
@ -448,14 +448,14 @@
Moved debian to conf and updated examples directory
Fixed #1368 - updated Red Hat init scripts
Added message referencing ReductiveLabs build library
Fixed #1396 - Added sha1 function from DavidS to core
Fixed #1399 - the ldap user provider now knows it can manage
passwords.
Fixed #1272 - if you provide a group name as the gid to an ldap
user, the name will be converted to a gid. Note that this only
looks up ldap groups, at this point; if you want to set an ldap
@ -468,7 +468,7 @@
Fixed 1240 - puppet will function more like puppetd if graphing
or reporting are enabled.
Fixed #1231 - Exceptions during initialization should now be clearer.
Fixed #1006 - puppetrun --class works again. I added the class
@ -484,9 +484,9 @@
Fixed #1367 - Updated Rakefile for new daily builds
Fixed #1370 - removed test/util/loadedfile.rb tests
Fixed #1221 - aliases to titles now work for resources.
Fixed #1012 - templates in the templatedir are preferred to module templates.
Fixed #707 - special '@reboot'-style cron jobs work again.
@ -495,14 +495,14 @@
Fixed #1369 - the init service provider now supports HP-UX.
Removed support for the 'node_name' setting in LDAP and external node
Removed support for the 'node_name' setting in LDAP and external node
lookups.
Also removed support for 'default' nodes in external nodes.
LDAP nodes now use the certificate name, the short name, and 'default',
but external nodes just use the certificate name and any custom terminus
types will use just the certificate name.
Fixing #1168 (for 0.24.x) -- automatically downcasing the fqdn.
Also requiring that passed in certnames be downcased; the setting
system isn't currently flexible enough to automatically downcase
@ -520,7 +520,7 @@
The Master handler previously provided the support for the :node_name
setting, and that functionality has now been moved into the Node
class. At the same time, the names to search through have been
changed somewhat: Previously, the certificate name and the
changed somewhat: Previously, the certificate name and the
hostname were both used for searching, but now, the cert name
is always searched first (unless node_name == facter), but only
the Facter hostname, domain, and fqdn are used otherwise. We no
@ -530,28 +530,28 @@
Adding support for settings within the existing Facter provider confines.
Moving all confine code out of the Provider class, and fixing #1197.
Created a Confiner module for the Provider class methods, enhanced
the interface between it and the Confine class to make sure binary
Moving all confine code out of the Provider class, and fixing #1197.
Created a Confiner module for the Provider class methods, enhanced
the interface between it and the Confine class to make sure binary
paths are searched for fresh each time.
Modified the 'factpath' setting to automatically configure
Facter to load facts there if a new enough version of
Facter is used.
Crontab provider: fix a parse error when a line begins with a space
Crontab provider: fix a parse error when a line begins with a space
character (fixes #1216)
Instead of deleting the init scripts (with --del) we should simply
disable it with chkconfig service off, and respectfully do the same
Instead of deleting the init scripts (with --del) we should simply
disable it with chkconfig service off, and respectfully do the same
for enable => true;
Added ldap providers for users and groups.
Added support for the --all option to puppetca --clean. If
puppetca --clean --all is issued then all client certificates
are removed.
Resources now return the 'should' value for properties from
the [] accessor method (they previously threw an exception when
this method was used with properties). This shouldn't have any
@ -617,7 +617,7 @@
that it can cause corruption, especially in file serving (but
it's client-side corruption).
Applying patch by Ryan McBride to fix OpenBSD package
Applying patch by Ryan McBride to fix OpenBSD package
matching. The actual problem was caused by the fix to #1001.
Found all instances of methods where split() is used without
@ -867,7 +867,7 @@
the bootproto (#762).
You now must specify an environment and you are required to specify
the valid environments for your site. (#911)
the valid environments for your site. (#911)
Certificates now always specify a subjectAltName, but it defaults
to '*', meaning that it doesn't require DNS names to match. You
@ -998,7 +998,7 @@
exactly the feature asked for, but I could not find a
way to directly copy ActiveRecord's concept of an environment.
External node sources can now return undefined classes (#687).
External node sources can now return undefined classes (#687).
Puppet clients now have http proxy support (#701).
@ -1051,7 +1051,7 @@
Only ONE node source can be used -- you can use LDAP, code, or
an external node program, but not more than one.
LDAP node support has two changes: First, the "ldapattrs" attribute is
now used for setting the attributes to retrieve from the server (in
addition to required attriutes), and second, all retrieved attributes
@ -1066,8 +1066,8 @@
handle that on its own.
Reworked the database schema used to store configurations with the
storeconfigs option.
storeconfigs option.
Replaced the obsolete RRD ruby library with the maintained
RubyRRDtool library (which requires rrdtool2) (#659).
@ -1140,7 +1140,7 @@
fail on cycles.
Added a 'dynamicfacts' configuration option; any facts in that
comma-separated list will be ignored when comparing facts to
comma-separated list will be ignored when comparing facts to
see if they have changed and thus whether a recompile is necessary.
Renamed some poorly named internal variables:
@ -1312,7 +1312,7 @@
Fixing a bug related to link recursion that caused link directories
to always be considered out of sync.
The bind address for puppetmasterd can now be specified with
The bind address for puppetmasterd can now be specified with
--bindaddress.
Added (probably experimental) mongrel support. At this point you're
@ -1492,7 +1492,7 @@
Correctly handling spaces in file sources.
Moved documentation into svn tree.
0.18.0
Added support for a "default" node.
@ -1690,7 +1690,7 @@
0.9.4
Small fix to wrap the StatusServer class in the checks for required classes.
0.9.3
Fixed some significant bugs in cron job management.

Просмотреть файл

@ -3,8 +3,8 @@ Puppet - Automating Configuration Management. Copyright (C) 2005 Reductive Labs
Reductive Labs can be contacted at: info@reductivelabs.com
This program and entire repository is free software; you can
redistribute it and/or modify it under the terms of the GNU
General Public License as published by the Free Software
redistribute it and/or modify it under the terms of the GNU
General Public License as published by the Free Software
Foundation; either version 2 of the License, or any later version.
This program is distributed in the hope that it will be useful,

2
README
Просмотреть файл

@ -1,4 +1,4 @@
Documentation (and detailed install instructions) can be found
Documentation (and detailed install instructions) can be found
online at http://reductivelabs.com/trac/puppet/wiki/DocumentationStart .
Generally, you need the following things installed:

Просмотреть файл

@ -1,11 +1,11 @@
Puppet
======
Puppet, an automated administrative engine for your Linux and Unix systems, performs
administrative tasks (such as adding users, installing packages, and updating server
Puppet, an automated administrative engine for your Linux and Unix systems, performs
administrative tasks (such as adding users, installing packages, and updating server
configurations) based on a centralized specification.
Documentation (and detailed install instructions) can be found
Documentation (and detailed install instructions) can be found
online at the `Puppet Wiki`_.
Installation
@ -32,7 +32,7 @@ Generally, you need the following things installed:
the library.
* Facter => 1.1.1
You can get this from your package management system or the `Facter site`_
You can get this from your package management system or the `Facter site`_
.. _Puppet Wiki: http://reductivelabs.com/trac/puppet/wiki/DocumentationStart
.. _Facter site: http://reductivelabs.com/projects/facter

Просмотреть файл

@ -54,7 +54,7 @@ end
task :tracdocs do
require 'puppet'
require 'puppet/util/reference'
Puppet::Util::Reference.references.each do |ref|
Puppet::Util::Reference.references.each do |ref|
sh "puppetdoc -m trac -r #{ref.to_s}"
end
end
@ -65,7 +65,7 @@ task :spec do
require 'spec/rake/spectask'
# require 'rcov'
Spec::Rake::SpecTask.new do |t|
t.spec_opts = ['--format','s', '--loadby','mtime']
t.spec_opts = ['--format','s', '--loadby','mtime']
t.spec_files = FileList['spec/**/*.rb']
end
end
@ -83,9 +83,9 @@ task :ci_prep do
require 'ci/reporter/rake/rspec'
require 'ci/reporter/rake/test_unit'
ENV['CI_REPORTS'] = 'results'
rescue LoadError
rescue LoadError
puts 'Missing ci_reporter gem. You must have the ci_reporter gem installed to run the CI spec tests'
end
end
end
desc "Run the CI RSpec tests"
@ -104,7 +104,7 @@ task :mail_patches do
raise "Could not get branch from 'git status'"
end
branch = $1
unless branch =~ %r{^([^\/]+)/([^\/]+)/([^\/]+)$}
raise "Branch name does not follow <type>/<parent>/<name> model; cannot autodetect parent branch"
end
@ -136,9 +136,9 @@ task :changelog do
mkdir(CHANGELOG_DIR) unless File.directory?(CHANGELOG_DIR)
change_body=`git log --pretty=format:'%aD%n%an <%ae>%n%s%n'`
File.open(File.join(CHANGELOG_DIR, "CHANGELOG.git"), 'w') do |f|
f << change_body
f << change_body
end
# Changelog commit
`git add #{CHANGELOG_DIR}/CHANGELOG.git`
`git commit -m "Update CHANGELOG.git"`

Просмотреть файл

@ -45,7 +45,7 @@
# /etc/passwd: 429b225650b912a2ee067b0a4cf1e949
# $ filebucket restore /tmp/passwd 429b225650b912a2ee067b0a4cf1e949
# $
#
#
# = Options
#
# Note that any configuration parameter that's valid in the configuration file
@ -98,4 +98,4 @@ require 'puppet/application'
require 'puppet/application/filebucket'
# launch the filebucket
Puppet::Application[:filebucket].run
Puppet::Application[:filebucket].run

Просмотреть файл

@ -8,7 +8,7 @@
#
# = Usage
#
# puppetdoc [-a|--all] [-h|--help] [-o|--outputdir <rdoc outputdir>] [-m|--mode <text|pdf|trac|rdoc>]
# puppetdoc [-a|--all] [-h|--help] [-o|--outputdir <rdoc outputdir>] [-m|--mode <text|pdf|trac|rdoc>]
# [-r|--reference <[type]|configuration|..>] [manifest-file]
#
# = Description
@ -19,7 +19,7 @@
# available on the Reductive Labs web site.
#
# In 'rdoc' mode, this command generates an html RDoc hierarchy describing the manifests that
# are in 'manifestdir' and 'modulepath' configuration directives.
# are in 'manifestdir' and 'modulepath' configuration directives.
# The generated documentation directory is doc by default but can be changed with the 'outputdir' option.
#
# If the command is started with 'manifest-file' command-line arguments, puppetdoc generate a single

Просмотреть файл

@ -64,7 +64,7 @@
# = Example
#
# This example uses ``ralsh`` to return Puppet configuration for the user ``luke``::
#
#
# $ ralsh user luke
# user { 'luke':
# home => '/home/luke',

Просмотреть файл

@ -1,11 +1,11 @@
# This is an example auth.conf file, it mimics the puppetmasterd defaults
#
#
# The ACL are checked in order of appearance in this file.
#
#
# Supported syntax:
# This file supports two different syntax depending on how
# This file supports two different syntax depending on how
# you want to express the ACL.
#
#
# Path syntax (the one used below):
# ---------------------------------
# path /path/to/resource
@ -14,35 +14,35 @@
# [auth[enthicated] {yes|no|on|off|any}]
# allow [host|ip|*]
# deny [host|ip]
#
#
# The path is matched as a prefix. That is /file match at
# the same time /file_metadat and /file_content.
#
#
# Regex syntax:
# -------------
# This one is differenciated from the path one by a '~'
#
#
# path ~ regex
# [environment envlist]
# [method methodlist]
# [auth[enthicated] {yes|no|on|off|any}]
# allow [host|ip|*]
# deny [host|ip]
#
#
# The regex syntax is the same as ruby ones.
#
#
# Ex:
# path ~ .pp$
# will match every resource ending in .pp (manifests files for instance)
#
#
# path ~ ^/path/to/resource
# is essentially equivalent to path /path/to/resource
#
#
# environment:: restrict an ACL to a specific set of environments
# method:: restrict an ACL to a specific set of methods
# auth:: restrict an ACL to an authenticated or unauthenticated request
# the default when unspecified is to restrict the ACL to authenticated requests
# (ie exactly as if auth yes was present).
# (ie exactly as if auth yes was present).
#
### Authenticated ACL - those applies only when the client

Просмотреть файл

@ -7,13 +7,13 @@
# Last Updated: 2008-07-31
#
# Copyright 2008 Google Inc.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -30,7 +30,7 @@ PREFLIGHT="preflight"
function find_installer() {
# we walk up three directories to make this executable from the root,
# we walk up three directories to make this executable from the root,
# root/conf or root/conf/osx
if [ -f "./${INSTALLRB}" ]; then
installer="$(pwd)/${INSTALLRB}"
@ -63,7 +63,7 @@ function prepare_package() {
# to look at for package creation and substitue the version strings out.
# Major/Minor versions can only be integers, so we have "0" and "245" for
# puppet version 0.24.5
# Note too that for 10.5 compatibility this Info.plist *must* be set to
# Note too that for 10.5 compatibility this Info.plist *must* be set to
# follow symlinks.
VER1=$(echo ${puppet_version} | awk -F "." '{print $1}')
VER2=$(echo ${puppet_version} | awk -F "." '{print $2}')
@ -74,12 +74,12 @@ function prepare_package() {
sed -i '' "s/{SHORTVERSION}/${puppet_version}/g" "${pkgtemp}/${PROTO_PLIST}"
sed -i '' "s/{MAJORVERSION}/${major_version}/g" "${pkgtemp}/${PROTO_PLIST}"
sed -i '' "s/{MINORVERSION}/${minor_version}/g" "${pkgtemp}/${PROTO_PLIST}"
# We need to create a preflight script to remove traces of previous
# puppet installs due to limitations in Apple's pkg format.
mkdir "${pkgtemp}/scripts"
cp "${puppet_root}/conf/osx/${PREFLIGHT}" "${pkgtemp}/scripts"
# substitute in the sitelibdir specified above on the assumption that this
# is where any previous puppet install exists that should be cleaned out.
sed -i '' "s|{SITELIBDIR}|${SITELIBDIR}|g" "${pkgtemp}/scripts/${PREFLIGHT}"
@ -123,44 +123,44 @@ function main() {
fi
find_installer
if [ ! "${installer}" ]; then
echo "Unable to find ${INSTALLRB}"
cleanup_and_exit 1
fi
find_puppet_root
if [ ! "${puppet_root}" ]; then
echo "Unable to find puppet repository root."
cleanup_and_exit 1
fi
pkgroot=$(mktemp -d -t puppetpkg)
if [ ! "${pkgroot}" ]; then
echo "Unable to create temporary package root."
cleanup_and_exit 1
fi
pkgtemp=$(mktemp -d -t puppettmp)
if [ ! "${pkgtemp}" ]; then
echo "Unable to create temporary package root."
cleanup_and_exit 1
fi
install_puppet
get_puppet_version
if [ ! "${puppet_version}" ]; then
echo "Unable to retrieve puppet version"
cleanup_and_exit 1
fi
prepare_package
create_package
cleanup_and_exit 0
}

Просмотреть файл

@ -26,7 +26,7 @@ PUPPETMASTER_OPTS=""
if [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -gt 1 ]; then
PUPPETMASTER_OPTS="$PUPPETMASTER_OPTS --servertype=mongrel"
elif [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -eq 1 ]; then
PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} --masterport=${PUPPETMASTER_PORTS[0]}"
PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} --masterport=${PUPPETMASTER_PORTS[0]}"
fi
[ -n "$PUPPETMASTER_LOG" ] && PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} --logdest=${PUPPETMASTER_LOG}"
PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} \
@ -67,7 +67,7 @@ stop() {
if [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -gt 1 ]; then
for ((i=0; i<${#PUPPETMASTER_PORTS[@]}; i++)); do
echo -en "\nPort: ${PUPPETMASTER_PORTS[$i]}"
killproc -p /var/run/puppet/puppetmaster.${PUPPETMASTER_PORTS[$i]}.pid puppetmaster
killproc -p /var/run/puppet/puppetmaster.${PUPPETMASTER_PORTS[$i]}.pid puppetmaster
ret=$?; [ $ret != 0 ] && RETVAL=$ret
done
else
@ -93,9 +93,9 @@ puppetmaster_status() {
if [ -n "$PUPPETMASTER_PORTS" ] && [ ${#PUPPETMASTER_PORTS[@]} -gt 1 ]; then
for ((i=0; i<${#PUPPETMASTER_PORTS[@]}; i++)); do
echo -en "Port ${PUPPETMASTER_PORTS[$i]}: "
status -p /var/run/puppet/puppetmaster.${PUPPETMASTER_PORTS[$i]}.pid puppetmaster
status -p /var/run/puppet/puppetmaster.${PUPPETMASTER_PORTS[$i]}.pid puppetmaster
ret=$?; [ $ret != 0 ] && RETVAL=$ret
done
done
else
status $PUPPETMASTER
RETVAL=$?

Просмотреть файл

@ -5,20 +5,20 @@
# Specify syslog to send log messages to the system log.
#PUPPETMASTER_LOG=syslog
# You may specify an alternate port or an array of ports on which
# You may specify an alternate port or an array of ports on which
# puppetmaster should listen. Default is: 8140
# If you specify more than one port, the puppetmaster ist automatically
# started with the servertype set to mongrel. This might be interesting
# if you'd like to run your puppetmaster in a loadbalanced cluster.
# Please note: this won't setup nor start any loadbalancer.
# Please note: this won't setup nor start any loadbalancer.
# If you'd like to run puppetmaster with mongrel as servertype but only
# on one (specified) port, you have to add --servertype=mongrel to
# PUPPETMASTER_EXTRA_OPTS.
# Default: Empty (Puppetmaster isn't started with mongrel, nor on a
# Default: Empty (Puppetmaster isn't started with mongrel, nor on a
# specific port)
#
# Please note: Due to reduced options in the rc-functions lib in RHEL/Centos
# versions prior to 5, this feature won't work. Fedora versions >= 8 are
# versions prior to 5, this feature won't work. Fedora versions >= 8 are
# known to work.
#PUPPETMASTER_PORTS=""
# Puppetmaster on a different port, run with standard webrick servertype

Просмотреть файл

@ -20,7 +20,7 @@
type='path'>
<service_fmri value='file:///etc/puppet/puppet.conf'/>
</dependency>
<dependency name='loopback'
grouping='require_all'
restart_on='error'

Просмотреть файл

@ -20,7 +20,7 @@
type='path'>
<service_fmri value='file:///etc/puppet/puppet.conf'/>
</dependency>
<dependency name='loopback'
grouping='require_all'
restart_on='error'

Просмотреть файл

@ -14,7 +14,7 @@
### BEGIN INIT INFO
# Provides: puppet
# Required-Start: $local_fs $network $syslog
# Should-Start:
# Should-Start:
# Required-Stop:
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6

Просмотреть файл

@ -22,9 +22,9 @@ BuildArchitectures: noarch
BuildRequires: ruby >= 1.8.6
%description
Puppet lets you centrally manage every important aspect of your system using a
cross-platform specification language that manages all the separate elements
normally aggregated in different files, like users, cron jobs, and hosts,
Puppet lets you centrally manage every important aspect of your system using a
cross-platform specification language that manages all the separate elements
normally aggregated in different files, like users, cron jobs, and hosts,
along with obviously discrete elements like packages, services, and files.
%package server
@ -132,13 +132,13 @@ fi
* Sat Feb 16 2008 James Turnbull <james@lovedthanlost.net> - 0.24.1-1
- Fixed puppet configuation file references to match single puppet.conf file
- Update versions for 0.24.1 release
* Tue Aug 3 2006 Martin Vuk <martin.vuk@fri.uni-lj.si> - 0.18.4-3
- Replaced puppet-bin.patch with %build section from David's spec
* Tue Aug 1 2006 Martin Vuk <martin.vuk@fri.uni-lj.si> - 0.18.4-2
- Added supprot for enabling services in SuSE
* Tue Aug 1 2006 Martin Vuk <martin.vuk@fri.uni-lj.si> - 0.18.4-1
- New version and support for SuSE
@ -150,7 +150,7 @@ fi
* Mon Jun 19 2006 David Lutterkort <dlutter@redhat.com> - 0.18.0-1
- Patch config for LSB compliance (lsb-config.patch)
- Changed config moves /var/puppet to /var/lib/puppet, /etc/puppet/ssl
- Changed config moves /var/puppet to /var/lib/puppet, /etc/puppet/ssl
to /var/lib/puppet, /etc/puppet/clases.txt to /var/lib/puppet/classes.txt,
/etc/puppet/localconfig.yaml to /var/lib/puppet/localconfig.yaml
@ -173,7 +173,7 @@ fi
- Rebuilt for new version
* Wed Mar 22 2006 David Lutterkort <dlutter@redhat.com> - 0.15.1-1
- Patch0: Run puppetmaster as root; running as puppet is not ready
- Patch0: Run puppetmaster as root; running as puppet is not ready
for primetime
* Mon Mar 13 2006 David Lutterkort <dlutter@redhat.com> - 0.15.0-1
@ -188,7 +188,7 @@ fi
allocate the puppet uid/gid dynamically
* Sun Feb 19 2006 David Lutterkort <dlutter@redhat.com> - 0.13.0-4
- Use fedora-usermgmt to create puppet user/group. Use uid/gid 24. Fixed
- Use fedora-usermgmt to create puppet user/group. Use uid/gid 24. Fixed
problem with listing fileserver.conf and puppetmaster.conf twice
* Wed Feb 8 2006 David Lutterkort <dlutter@redhat.com> - 0.13.0-3
@ -213,7 +213,7 @@ problem with listing fileserver.conf and puppetmaster.conf twice
- Added basic fileserver.conf
* Wed Jan 11 2006 David Lutterkort <dlutter@redhat.com> - 0.10.1-1
- Updated. Moved installation of library files to sitelibdir. Pulled
- Updated. Moved installation of library files to sitelibdir. Pulled
initscripts into separate files. Folded tools rpm into server
* Thu Nov 24 2005 Duane Griffin <d.griffin@psenterprise.com>

Просмотреть файл

@ -12,7 +12,7 @@
### BEGIN INIT INFO
# Provides: puppetmaster
# Required-Start: $local_fs $network $syslog
# Should-Start:
# Should-Start:
# Required-Stop:
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6

Просмотреть файл

@ -7,7 +7,7 @@ User { provider => "directoryservice" }
Group { provider => "directoryservice" }
user {
"testgone":
"testgone":
ensure => absent,
uid => 550;
"testhere":
@ -25,4 +25,4 @@ group {
ensure => present,
gid => 551;
}
}

Просмотреть файл

@ -7,7 +7,7 @@ User { provider => "directoryservice" }
Group { provider => "directoryservice" }
user {
"testgone":
"testgone":
ensure => absent,
uid => 550;
"testhere":

Просмотреть файл

@ -1,6 +1,6 @@
# Copyright (C) David Schmitt <david@schmitt.edv-bus.at>
# All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
@ -12,7 +12,7 @@
# 3. Neither the name of the Author nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE

Просмотреть файл

@ -1,12 +1,12 @@
# Jeff McCune <jeff.mccune@northstarlabs.net>
#
#
# Demonstration of a custom parser function and erb template within
# a module, working in concert.
class sample-module {
$fqdn_to_dn = hostname_to_dn($domain)
$sample_template = template("sample-module/sample.erb")
notice("hostname_to_dn module function returned: [$fqdn_to_dn]")
info("sample.erb looks like:\n$sample_template")
}

Просмотреть файл

@ -28,7 +28,7 @@ define sleeper {
files { }
sleeper {
sleeper {
require => files["yay"],
schedule => true
}

Просмотреть файл

@ -5,7 +5,7 @@ require 'autotest/redgreen'
require 'autotest/timestamp'
Autotest.send(:alias_method, :real_find_files, :find_files)
Autotest.send(:define_method, :find_files) do |*args|
Autotest.send(:define_method, :find_files) do |*args|
real_find_files.reject do |k, v|
if (ENV['AUTOTEST'] and !ENV['AUTOTEST'].empty?)
!Regexp.new(ENV['AUTOTEST']).match(k)
@ -15,19 +15,19 @@ end
module Autotest::Growl
def self.growl title, msg, img, pri=0, sticky=""
system "growlnotify -n autotest --image #{img} -p #{pri} -m #{msg.inspect} #{title} #{sticky}"
def self.growl title, msg, img, pri=0, sticky=""
system "growlnotify -n autotest --image #{img} -p #{pri} -m #{msg.inspect} #{title} #{sticky}"
end
Autotest.add_hook :ran_command do |at|
image_root = "~/.autotest_images"
image_root = "~/.autotest_images"
results = [at.results].flatten.join("\n")
output = results.slice(/(\d+)\stests,\s(\d+)\sassertions,\s(\d+)\sfailures,\s(\d+)\serrors/)
if output
if $~[3].to_i > 0 || $~[4].to_i > 0
growl "FAIL", "#{output}", "#{image_root}/fail.png", 2
else
growl "Pass", "#{output}", "#{image_root}/pass.png"
growl "Pass", "#{output}", "#{image_root}/pass.png"
end
end
@ -36,7 +36,7 @@ module Autotest::Growl
if $~[2].to_i > 0 || $~[4].to_i > 0
growl "FAIL", "#{output}", "#{image_root}/fail.png", 2
else
growl "Pass", "#{output}", "#{image_root}/pass.png"
growl "Pass", "#{output}", "#{image_root}/pass.png"
end
end
end

Просмотреть файл

@ -1,5 +1,5 @@
-- MySQL DB consistency check/fix
--
--
-- Usage:
-- cat dbfix.sql | mysql -u user -p puppet
--
@ -13,11 +13,11 @@ FROM resources AS bad_rows
FROM resources
GROUP BY title,restype,host_id
HAVING count(*) > 1
) AS good_rows
ON
good_rows.title = bad_rows.title AND
good_rows.restype = bad_rows.restype AND
good_rows.host_id = bad_rows.host_id AND
) AS good_rows
ON
good_rows.title = bad_rows.title AND
good_rows.restype = bad_rows.restype AND
good_rows.host_id = bad_rows.host_id AND
good_rows.max_id <> bad_rows.id;
-- Remove duplicate param_values, and keep the latest one
@ -28,17 +28,17 @@ FROM param_values AS bad_rows
FROM param_values
GROUP BY value,param_name_id,resource_id
HAVING count(*) > 1
) AS good_rows
ON
good_rows.value = bad_rows.value AND
good_rows.param_name_id = bad_rows.param_name_id AND
good_rows.resource_id = bad_rows.resource_id AND
) AS good_rows
ON
good_rows.value = bad_rows.value AND
good_rows.param_name_id = bad_rows.param_name_id AND
good_rows.resource_id = bad_rows.resource_id AND
good_rows.max_id <> bad_rows.id;
-- rewrite param_values that points to duplicated param_names
-- to point to the highest param_name id.
UPDATE
param_values v
UPDATE
param_values v
INNER JOIN
param_names n
ON n.id = v.param_name_id
@ -60,8 +60,8 @@ FROM param_names AS bad_rows
FROM param_names
GROUP BY name
HAVING count(*) > 1
) AS good_rows
ON
) AS good_rows
ON
good_rows.name = bad_rows.name AND
good_rows.max_id <> bad_rows.id;
@ -73,16 +73,16 @@ FROM resource_tags AS bad_rows
FROM resource_tags
GROUP BY resource_id,puppet_tag_id
HAVING count(*) > 1
) AS good_rows
ON
) AS good_rows
ON
good_rows.resource_id = bad_rows.resource_id AND
good_rows.puppet_tag_id = bad_rows.puppet_tag_id AND
good_rows.max_id <> bad_rows.id;
-- rewrite resource_tags that points to duplicated puppet_tags
-- to point to the highest puppet_tags id.
UPDATE
resource_tags v
UPDATE
resource_tags v
INNER JOIN
puppet_tags n
ON n.id = v.puppet_tag_id
@ -104,8 +104,8 @@ FROM puppet_tags AS bad_rows
FROM puppet_tags
GROUP BY name
HAVING count(*) > 1
) AS good_rows
ON
) AS good_rows
ON
good_rows.name = bad_rows.name AND
good_rows.max_id <> bad_rows.id;

Просмотреть файл

@ -1,6 +1,6 @@
;;;
;;; puppet-mode.el
;;;
;;;
;;; Author: lutter
;;; Author: Russ Allbery <rra@stanford.edu>
;;;
@ -152,23 +152,23 @@ of the initial include plus puppet-include-indent."
;; Indent the line to the same indentation as the first
;; element in that array. That is, this...
;;
;; exec {
;; exec {
;; "add_puppetmaster_mongrel_startup_links":
;; command => "string1",
;; creates => [ "string2", "string3",
;; "string4", "string5",
;; creates => [ "string2", "string3",
;; "string4", "string5",
;; "string6", "string7",
;; "string3" ],
;; refreshonly => true,
;; }
;;
;;
;; ...should instead look like this:
;;
;; exec {
;; exec {
;; "add_puppetmaster_mongrel_startup_links":
;; command => "string1",
;; creates => [ "string2", "string3",
;; "string4", "string5",
;; creates => [ "string2", "string3",
;; "string4", "string5",
;; "string6", "string7",
;; "string8" ],
;; refreshonly => true,
@ -216,12 +216,12 @@ of the initial include plus puppet-include-indent."
;; if there is more than one block opened and closed on the same
;; line but it's still unbalanced; hopefully people don't do that.
((looking-at "^.*{[^\n}]*$")
(setq cur-indent (+ (current-indentation) puppet-indent-level))
(setq cur-indent (+ (current-indentation) puppet-indent-level))
(setq not-indented nil))
;; Indent by one level if the line ends with an open paren.
((looking-at "^.*\(\\s-*$")
(setq cur-indent (+ (current-indentation) puppet-indent-level))
(setq cur-indent (+ (current-indentation) puppet-indent-level))
(setq not-indented nil))
;; Semicolon ends a block for a resource when multiple resources

Просмотреть файл

@ -1,5 +1,5 @@
#!/usr/bin/env ruby
# == Synopsis
# == Synopsis
#
# Test individual client performance. Can compile configurations, describe
# files, or retrieve files.
@ -309,7 +309,7 @@ Suite.new :rails, "Rails Interactions" do
Puppet::Rails.init
@facts = Facter.to_hash
if num = ENV["RESOURCECOUNT"]
if num = ENV["RESOURCECOUNT"]
@resources = Integer(num)
else
@resources = 10

Просмотреть файл

@ -46,7 +46,7 @@ File.open(Puppet[:authconfig]).each do |line|
end
# be a daemon
sock = TCPServer.new(port)
sock = TCPServer.new(port)
ssls = OpenSSL::SSL::SSLServer.new(sock, ctx)
loop do

Просмотреть файл

@ -2,7 +2,7 @@
PUPPETMASTER AS A RACK APPLICATION
==================================
puppetmaster can now be hosted as a standard Rack application. A proper
puppetmaster can now be hosted as a standard Rack application. A proper
config.ru is provided for this.
For more details about rack, see http://rack.rubyforge.org/ .
@ -17,14 +17,14 @@ to work.
WEBrick
-------
WEBrick is currently not supported as a Rack host. You'll be better off
WEBrick is currently not supported as a Rack host. You'll be better off
just running puppetmasterd directly.
Mongrel
-------
If you like Mongrel, and want to replicate wiki:UsingMongrel, you could
If you like Mongrel, and want to replicate wiki:UsingMongrel, you could
probably start your backend mongrels this way:
cd ext/rack
@ -48,7 +48,7 @@ Requirements:
Apache 2.x
SSL Module loaded
Apache configuration snippet is in files/apache2.conf. You need to
Apache configuration snippet is in files/apache2.conf. You need to
edit it to reflect your servername.
Required puppet.conf settings:
@ -60,8 +60,8 @@ To set up most of the boring stuff, you can use this command:
puppet --verbose --modulepath ./ext ext/rack/manifest.pp
Or use manifest.pp as a starting point for your own module.
Note: Passenger will not let applications run as root or the Apache user,
instead an implicit setuid will be done, to the user whom owns
Note: Passenger will not let applications run as root or the Apache user,
instead an implicit setuid will be done, to the user whom owns
config.ru. Therefore, config.ru shall be owned by the puppet user.

Просмотреть файл

@ -30,7 +30,7 @@ package { ["rack", "passenger"]:
service { "apache2":
}
case $lsbdistid {
case $lsbdistid {
"Debian": {
package { ["apache2-mpm-worker", "apache2-threaded-dev", "apache2"]:
ensure => installed,

Просмотреть файл

@ -2,9 +2,9 @@
" Filename: puppet.vim
" Language: puppet configuration file
" Maintainer: Luke Kanies <luke@madstop.com>
" URL:
" Last Change:
" Version:
" URL:
" Last Change:
" Version:
"
" Copied from the cfengine, ruby, and perl syntax files

Просмотреть файл

@ -51,10 +51,10 @@ begin
if $haverdoc
rst2man = %x{which rst2man.py}
$haveman = true
else
else
$haveman = false
end
rescue
rescue
puts "Missing rst2man; skipping man page creation"
$haveman = false
end
@ -233,19 +233,19 @@ def prepare_installation
Config::CONFIG['bindir'] = "/usr/bin"
Config::CONFIG['sbindir'] = "/usr/sbin"
end
if not InstallOptions.bindir.nil?
bindir = InstallOptions.bindir
else
bindir = Config::CONFIG['bindir']
end
if not InstallOptions.sbindir.nil?
sbindir = InstallOptions.sbindir
else
sbindir = Config::CONFIG['sbindir']
end
if not InstallOptions.sitelibdir.nil?
sitelibdir = InstallOptions.sitelibdir
else
@ -259,11 +259,11 @@ def prepare_installation
end
end
end
if not InstallOptions.mandir.nil?
mandir = InstallOptions.mandir
else
mandir = Config::CONFIG['mandir']
mandir = Config::CONFIG['mandir']
end
# To be deprecated once people move over to using --destdir option
@ -342,13 +342,13 @@ def build_man(bins)
File.unlink("./puppet.conf.rst")
# Create binary man pages
bins.each do |bin|
bins.each do |bin|
b = bin.gsub( "bin/", "")
%x{#{bin} --help > ./#{b}.rst}
%x{#{rst2man} ./#{b}.rst ./man/man8/#{b}.8}
File.unlink("./#{b}.rst")
end
rescue SystemCallError
rescue SystemCallError
$stderr.puts "Couldn't build man pages: " + $!
$stderr.puts "Continuing with install..."
end
@ -388,7 +388,7 @@ def install_binfile(from, op_file, target)
break
end
end
fail "Cannot find a temporary directory" unless tmp_dir
tmp_file = File.join(tmp_dir, '_tmp')
ruby = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name'])

Просмотреть файл

@ -59,7 +59,7 @@ module Puppet
# I keep wanting to use Puppet.error
# XXX this isn't actually working right now
alias :error :err
# The feature collection
@features = Puppet::Util::Feature.new('puppet/feature')

Просмотреть файл

@ -14,14 +14,14 @@ require 'optparse'
# The executable uses the application object like this:
# Puppet::Application[:example].run
#
#
#
# Puppet::Application.new(:example) do
#
#
# preinit do
# # perform some pre initialization
# @all = false
# end
#
#
# # dispatch is called to know to what command to call
# dispatch do
# ARGV.shift
@ -30,15 +30,15 @@ require 'optparse'
# option("--arg ARGUMENT") do |v|
# @args << v
# end
#
#
# option("--debug", "-d") do |v|
# @debug = v
# end
#
#
# option("--all", "-a:) do |v|
# @all = v
# end
#
#
# unknown do |opt,arg|
# # last chance to manage an option
# ...
@ -49,11 +49,11 @@ require 'optparse'
# command(:read) do
# # read action
# end
#
#
# command(:write) do
# # writeaction
# end
#
#
# end
#
# === Preinit
@ -62,7 +62,7 @@ require 'optparse'
#
# === Options
# Puppet::Application uses +OptionParser+ to manage the application options.
# Options are defined with the +option+ method to which are passed various
# Options are defined with the +option+ method to which are passed various
# arguments, including the long option, the short option, a description...
# Refer to +OptionParser+ documentation for the exact format.
# * If the option method is given a block, this one will be called whenever
@ -142,7 +142,7 @@ class Puppet::Application
end
end
# used to declare accessor in a more natural way in the
# used to declare accessor in a more natural way in the
# various applications
def attr_accessor(*args)
args.each do |arg|
@ -186,7 +186,7 @@ class Puppet::Application
# initialize default application behaviour
def init_default
setup do
setup do
default_setup
end

Просмотреть файл

@ -161,7 +161,7 @@ class TypeDoc
a.to_s <=> b.to_s
}.each { |prov|
puts "\n- **%s**" % prov
puts @format.wrap(type.provider(prov).doc,
puts @format.wrap(type.provider(prov).doc,
:indent => 4, :scrub => true)
}
end

Просмотреть файл

@ -164,7 +164,7 @@ Puppet::Application.new(:puppetd) do
# to clients. In the meantime, we just disable CRL checking if
# the CRL file doesn't exist
unless File::exist?(Puppet[:cacrl])
Puppet[:cacrl] = 'false'
Puppet[:cacrl] = 'false'
end
handlers = nil
@ -199,7 +199,7 @@ Puppet::Application.new(:puppetd) do
args[:Server] = Puppet[:server]
if options[:fqdn]
args[:FQDN] = options[:fqdn]
Puppet[:certname] = options[:fqdn]
Puppet[:certname] = options[:fqdn]
end
if options[:centrallogs]

Просмотреть файл

@ -58,7 +58,7 @@ class Puppet::Configurer
end
end
end
# Just so we can specify that we are "the" instance.
def initialize
Puppet.settings.use(:main, :ssl, :puppetd)
@ -124,7 +124,7 @@ class Puppet::Configurer
return catalog
end
# The code that actually runs the catalog.
# The code that actually runs the catalog.
# This just passes any options on to the catalog,
# which accepts :tags and :ignoreschedules.
def run(options = {})

Просмотреть файл

@ -17,7 +17,7 @@ class Puppet::Daemon
Process.detach(pid)
exit(0)
end
create_pidfile()
# Get rid of console logging

Просмотреть файл

@ -39,7 +39,7 @@ module Puppet
logopts = ["$vardir/log", "The Puppet log directory."]
end
setdefaults(:main, :logdir => logopts)
# This name hackery is necessary so that the rundir is set reasonably during
# unit tests.
if Process.uid == 0 and %w{puppetd puppetmasterd}.include?(self.name)
@ -60,7 +60,7 @@ module Puppet
this directory can be removed without causing harm (although it
might result in spurious service restarts)."
},
:rundir => {
:rundir => {
:default => rundir,
:mode => 01777,
:desc => "Where Puppet PID files are kept."
@ -192,7 +192,7 @@ module Puppet
end
Puppet.setdefaults(:main,
# We have to downcase the fqdn, because the current ssl stuff (as oppsed to in master) doesn't have good facilities for
# We have to downcase the fqdn, because the current ssl stuff (as oppsed to in master) doesn't have good facilities for
# manipulating naming.
:certname => {:default => fqdn.downcase, :desc => "The name to use when handling certificates. Defaults
to the fully qualified domain name.",
@ -320,13 +320,13 @@ module Puppet
autosigns any key request, and is a very bad idea), false (which
never autosigns any key request), and the path to a file, which
uses that configuration file to determine which keys to sign."},
:ca_days => ["", "How long a certificate should be valid.
:ca_days => ["", "How long a certificate should be valid.
This parameter is deprecated, use ca_ttl instead"],
:ca_ttl => ["5y", "The default TTL for new certificates; valid values
must be an integer, optionally followed by one of the units
'y' (years of 365 days), 'd' (days), 'h' (hours), or
:ca_ttl => ["5y", "The default TTL for new certificates; valid values
must be an integer, optionally followed by one of the units
'y' (years of 365 days), 'd' (days), 'h' (hours), or
's' (seconds). The unit defaults to seconds. If this parameter
is set, ca_days is ignored. Examples are '3600' (one hour)
is set, ca_days is ignored. Examples are '3600' (one hour)
and '1825d', which is the same as '5y' (5 years) "],
:ca_md => ["md5", "The type of hash used in certificates."],
:req_bits => [2048, "The bit length of the certificates."],
@ -382,11 +382,11 @@ module Puppet
},
:masterport => [8140, "Which port puppetmasterd listens on."],
:parseonly => [false, "Just check the syntax of the manifests."],
:node_name => ["cert", "How the puppetmaster determines the client's identity
and sets the 'hostname', 'fqdn' and 'domain' facts for use in the manifest,
in particular for determining which 'node' statement applies to the client.
Possible values are 'cert' (use the subject's CN in the client's
certificate) and 'facter' (use the hostname that the client
:node_name => ["cert", "How the puppetmaster determines the client's identity
and sets the 'hostname', 'fqdn' and 'domain' facts for use in the manifest,
in particular for determining which 'node' statement applies to the client.
Possible values are 'cert' (use the subject's CN in the client's
certificate) and 'facter' (use the hostname that the client
reported in its facts)"],
:bucketdir => {
:default => "$vardir/bucket",
@ -642,7 +642,7 @@ module Puppet
:typecheck => [true, "Whether to validate types during parsing."],
:paramcheck => [true, "Whether to validate parameters during parsing."]
)
setdefaults(:main,
:casesensitive => [false,
"Whether matching in case statements and selectors

Просмотреть файл

@ -1,5 +1,5 @@
# Just quick mess-around to see what a DSL would look like.
#
#
# This is what the executable could look like:
##!/usr/bin/env ruby
#
@ -28,22 +28,22 @@
#
# require 'puppet'
# require 'puppet/dsl'
#
#
# include Puppet::DSL
# init()
#
#
# aspect :webserver do
# file "/tmp/testone", :content => "yaytest"
#
#
# exec "testing", :command => "/bin/echo this is a test"
# end
#
#
# aspect :other, :inherits => :webserver do
# file "/tmp/testone", :mode => "755"
# end
#
#
# acquire :other
#
#
# apply
require 'puppet'

26
lib/puppet/external/dot.rb поставляемый
Просмотреть файл

@ -1,5 +1,5 @@
# rdot.rb
#
#
#
# This is a modified version of dot.rb from Dave Thomas's rdoc project. I [Horst Duchene]
# renamed it to rdot.rb to avoid collision with an installed rdoc/dot.
@ -7,19 +7,19 @@
# It also supports undirected edges.
module DOT
# These glogal vars are used to make nice graph source.
$tab = ' '
$tab2 = $tab * 2
# if we don't like 4 spaces, we can change it any time
def change_tab (t)
$tab = t
$tab2 = t * 2
end
# options for node declaration
NODE_OPTS = [
@ -56,7 +56,7 @@ module DOT
'bgcolor',
'rank'
]
# options for edge declaration
EDGE_OPTS = [
@ -96,7 +96,7 @@ module DOT
# maintained for backward compatibility or rdot internal
'id'
]
# options for graph declaration
GRAPH_OPTS = [
@ -111,7 +111,7 @@ module DOT
'rank', 'rankdir', 'ranksep', 'ratio',
'size'
]
# a root class for any element in dot notation
class DOTSimpleElement
@ -126,7 +126,7 @@ module DOT
@name
end
end
# an element that has options ( node, edge, or graph )
class DOTElement < DOTSimpleElement
@ -159,8 +159,8 @@ module DOT
#end
end
# This is used when we build nodes that have shape=record
# ports don't have options :)
@ -177,7 +177,7 @@ module DOT
( @name && @name != "" ? "<#{@name}>" : "" ) + "#{@label}"
end
end
# node element
class DOTNode < DOTElement
@ -300,7 +300,7 @@ module DOT
@from = params['from'] ? params['from'] : nil
@to = params['to'] ? params['to'] : nil
end
def edge_link
'--'
end
@ -315,7 +315,7 @@ module DOT
end
end # class DOTEdge
class DOTDirectedEdge < DOTEdge
def edge_link

Просмотреть файл

@ -172,7 +172,7 @@ class Module
def define_methods (*names, &body)
names.each { |name| define_method(name, &body) }
end
def define_private_methods (*names, &body)
define_methods(*names, &body)
names.each { |name| private name }
@ -280,7 +280,7 @@ if __FILE__ == $0
assert_equal @y.baz, 321
assert_equal @y.quux, 654
end
def test_define_soft_aliases
@X.define_method(:foo) { 123 }
@X.define_method(:baz) { 321 }

2
lib/puppet/external/lock.rb поставляемый
Просмотреть файл

@ -36,7 +36,7 @@ class File
flush
flock(LOCK_UN)
end
# Get a shared (i.e., read) lock on the file, and yield to the block.
# If the lock is not available, wait for it without blocking other ruby
# threads.

6
lib/puppet/external/nagios/base.rb поставляемый
Просмотреть файл

@ -231,9 +231,9 @@ class Nagios::Base
# This is probably a bad idea.
def name=(value)
unless self.class.namevar.to_s == "name"
send(self.class.namevar.to_s + "=", value)
end
unless self.class.namevar.to_s == "name"
send(self.class.namevar.to_s + "=", value)
end
end
def namevar

2
lib/puppet/external/nagios/parser.rb поставляемый
Просмотреть файл

@ -402,7 +402,7 @@ module Racc
toks.each {|t| out.print ' ', racc_token2str(t) }
end
out.puts " --> #{racc_token2str(sim)}"
racc_print_stacks tstack, vstack
@racc_debug_out.puts
end

Просмотреть файл

@ -48,7 +48,7 @@ class Puppet::FileServing::Base
def links=(value)
value = value.to_sym
value = :manage if value == :ignore
raise(ArgumentError, ":links can only be set to :manage or :follow") unless [:manage, :follow].include?(value)
raise(ArgumentError, ":links can only be set to :manage or :follow") unless [:manage, :follow].include?(value)
@links = value
end

Просмотреть файл

@ -55,7 +55,7 @@ class Puppet::FileServing::Configuration::Parser < Puppet::Util::LoadedFile
# Allow a given pattern access to a mount.
def allow(mount, value)
# LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
# LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
x = value.split(/\s*,\s*/).each { |val|
begin
mount.info "allowing %s access" % val
@ -69,7 +69,7 @@ class Puppet::FileServing::Configuration::Parser < Puppet::Util::LoadedFile
# Deny a given pattern access to a mount.
def deny(mount, value)
# LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
# LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
x = value.split(/\s*,\s*/).each { |val|
begin
mount.info "denying %s access" % val

Просмотреть файл

@ -36,7 +36,7 @@ class Puppet::FileServing::Content < Puppet::FileServing::Base
def content
unless defined?(@content) and @content
# This stat can raise an exception, too.
raise(ArgumentError, "Cannot read the contents of links unless following links") if stat().ftype == "symlink"
raise(ArgumentError, "Cannot read the contents of links unless following links") if stat().ftype == "symlink"
@content = ::File.read(full_path())
end

Просмотреть файл

@ -111,14 +111,14 @@ class Puppet::FileServing::Fileset
elsif request.options.include?(param.to_s)
value = request.options[param.to_s]
end
next if value.nil?
next if value.nil?
value = true if value == "true"
value = false if value == "false"
value = Integer(value) if value.is_a?(String) and value =~ /^\d+$/
send(param.to_s + "=", value)
end
end
private
# Pull the recursion logic into one place. It's moderately hairy, and this

Просмотреть файл

@ -15,7 +15,7 @@ class Puppet::FileServing::Mount < Puppet::Network::AuthStore
include Puppet::Util::Logging
attr_reader :name
# Determine the environment to use, if any.
def environment(node_name)
if node_name and node = Puppet::Node.find(node_name)

Просмотреть файл

@ -79,7 +79,7 @@ class Puppet::FileServing::Mount::File < Puppet::FileServing::Mount
# Create a map for a specific node.
def clientmap(node)
{
"h" => node.sub(/\..*$/, ""),
"h" => node.sub(/\..*$/, ""),
"H" => node,
"d" => node.sub(/[^.]+\./, "") # domain name
}
@ -101,7 +101,7 @@ class Puppet::FileServing::Mount::File < Puppet::FileServing::Mount
path.gsub(/%(.)/) do |v|
key = $1
if key == "%"
if key == "%"
"%"
else
map[key] || v

Просмотреть файл

@ -12,7 +12,7 @@ class Puppet::Resource::Catalog::ActiveRecord < Puppet::Indirector::ActiveRecord
return nil unless host = ar_model.find_by_name(request.key)
catalog = Puppet::Resource::Catalog.new(host.name)
host.resources.each do |resource|
catalog.add_resource resource.to_transportable
end

Просмотреть файл

@ -42,7 +42,7 @@ class Puppet::Indirector::Exec < Puppet::Indirector::Terminus
Puppet.err "Failed to find %s via exec: %s" % [name, detail]
return nil
end
if output =~ /\A\s*\Z/ # all whitespace
Puppet.debug "Empty response for %s from exec %s terminus" % [name, self.name]
return nil

Просмотреть файл

@ -28,7 +28,7 @@ class Puppet::Node::Facts::ActiveRecord < Puppet::Indirector::ActiveRecord
facts = request.instance
host = ar_model.find_by_name(facts.name) || ar_model.create(:name => facts.name)
host.merge_facts(facts.values)
host.save

Просмотреть файл

@ -23,14 +23,14 @@ class Puppet::Indirector::Indirection
def self.instances
@@indirections.collect { |i| i.name }
end
# Find an indirected model by name. This is provided so that Terminus classes
# can specifically hook up with the indirections they are associated with.
def self.model(name)
return nil unless match = @@indirections.find { |i| i.name == name }
match.model
end
attr_accessor :name, :model
# Create and return our cache terminus.
@ -126,7 +126,7 @@ class Puppet::Indirector::Indirection
unless terminus_name ||= terminus_class
raise Puppet::DevError, "No terminus specified for %s; cannot redirect" % self.name
end
return termini[terminus_name] ||= make_terminus(terminus_name)
end

Просмотреть файл

@ -9,7 +9,7 @@ class Puppet::Node::Ldap < Puppet::Indirector::Ldap
# The attributes that Puppet class information is stored in.
def class_attributes
# LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
# LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
x = Puppet[:ldapclassattrs].split(/\s*,\s*/)
end

Просмотреть файл

@ -10,7 +10,7 @@ require 'yaml'
# and specifies a default queue type of <tt>:stomp</tt>, appropriate for use with a variety of message brokers.
#
# It's up to the queue client type to instantiate itself correctly based on Puppet configuration information.
#
#
# A single queue client is maintained for the abstract terminus, meaning that you can only use one type
# of queue client, one message broker solution, etc., with the indirection mechanism.
#

Просмотреть файл

@ -45,7 +45,7 @@ class Puppet::Transaction::Report::Processor < Puppet::Indirector::Code
# Handle the parsing of the reports attribute.
def reports
# LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
# LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
x = Puppet[:reports].gsub(/(^\s+)|(\s+$)/, '').split(/\s*,\s*/)
end
end

Просмотреть файл

@ -6,7 +6,7 @@ require 'puppet/network/http/api/v1'
# Access objects via REST
class Puppet::Indirector::REST < Puppet::Indirector::Terminus
include Puppet::Network::HTTP::API::V1
include Puppet::Network::HTTP::API::V1
class << self
attr_reader :server_setting, :port_setting
@ -58,7 +58,7 @@ class Puppet::Indirector::REST < Puppet::Indirector::Terminus
def headers
{"Accept" => model.supported_formats.join(", ")}
end
def network(request)
Puppet::Network::HttpPool.http_instance(request.server || self.class.server, request.port || self.class.port)
end
@ -66,19 +66,19 @@ class Puppet::Indirector::REST < Puppet::Indirector::Terminus
def find(request)
deserialize network(request).get(indirection2uri(request), headers)
end
def search(request)
unless result = deserialize(network(request).get(indirection2uri(request), headers), true)
return []
end
return result
end
def destroy(request)
raise ArgumentError, "DELETE does not accept options" unless request.options.empty?
deserialize network(request).delete(indirection2uri(request), headers)
end
def save(request)
raise ArgumentError, "PUT does not accept options" unless request.options.empty?
deserialize network(request).put(indirection2uri(request), request.instance.render, headers)

Просмотреть файл

@ -54,7 +54,7 @@ class Puppet::Indirector::SslFile < Puppet::Indirector::Terminus
# Use a setting to determine our path.
def path(name)
if ca?(name) and ca_location
if ca?(name) and ca_location
ca_location
elsif collection_directory
File.join(collection_directory, name.to_s + ".pem")

Просмотреть файл

@ -111,7 +111,7 @@ class Puppet::Indirector::Terminus
# Return all terminus classes for a given indirection.
def terminus_classes(indirection_name)
setup_instance_loading indirection_name
# Load them all.
instance_loader(indirection_name).loadall
@ -137,15 +137,15 @@ class Puppet::Indirector::Terminus
raise Puppet::DevError, "Cannot create instances of abstract terminus types"
end
end
def model
self.class.model
end
def name
self.class.name
end
def terminus_type
self.class.terminus_type
end

Просмотреть файл

@ -52,7 +52,7 @@ class Puppet::Indirector::Yaml < Puppet::Indirector::Terminus
def path(name)
File.join(base, self.class.indirection_name.to_s, name.to_s + ".yaml")
end
# Do a glob on the yaml directory, loading each file found
def search(request)
Dir.glob(File.join(base, self.class.indirection_name.to_s, request.key)).collect { |f| YAML.load_file(f) }

Просмотреть файл

@ -19,7 +19,7 @@ module Manager
@types.each do |name, type|
# Only consider types that have names
#if ! type.parameters.empty? or ! type.validproperties.empty?
yield type
yield type
#end
end
end
@ -94,14 +94,14 @@ module Manager
klass
end
# Remove an existing defined type. Largely used for testing.
def rmtype(name)
# Then create the class.
klass = rmclass(name,
:hash => @types
)
if respond_to?("new" + name.to_s)
metaclass.send(:remove_method, "new" + name.to_s)
end

Просмотреть файл

@ -29,7 +29,7 @@ class Puppet::Module
end
end
end
# Return an array of paths by splitting the +modulepath+ config
# parameter. Only consider paths that are absolute and existing
# directories

Просмотреть файл

@ -16,7 +16,7 @@ module Puppet
[:allow, :deny].each do |method|
define_method(method) do |*args|
@rights.send(method, *args)
end
end
end
# Here we add a little bit of semantics. They can set auth on a whole
@ -77,7 +77,7 @@ module Puppet
else
return
end
else
else
Puppet.notice "%s and %s" % [@configtimeout, @configstatted]
end
end

Просмотреть файл

@ -2,7 +2,7 @@
class Puppet::Network::Client::Dipper < Puppet::Network::Client
@handler = Puppet::Network::Handler.handler(:filebucket)
@drivername = :Bucket
attr_accessor :name
# Create our bucket client

Просмотреть файл

@ -96,7 +96,7 @@ module Puppet::Network::FormatHandler
end
def supported_formats
result = format_handler.formats.collect { |f| format_handler.format(f) }.find_all { |f| f.supported?(self) }.collect { |f| f.name }.sort do |a, b|
result = format_handler.formats.collect { |f| format_handler.format(f) }.find_all { |f| f.supported?(self) }.collect { |f| f.name }.sort do |a, b|
# It's an inverse sort -- higher weight formats go first.
format_handler.format(b).weight <=> format_handler.format(a).weight
end

Просмотреть файл

@ -129,7 +129,7 @@ class Puppet::Network::Handler # :nodoc:
File.open(bfile) { |of|
contents = of.read
}
if client
return Base64.encode64(contents)
else

Просмотреть файл

@ -53,7 +53,7 @@ class Puppet::Network::Handler
mount = Mount.new(MODULES)
mount.allow("*")
@mounts[MODULES] = mount
Puppet.debug "No file server configuration file; autocreating #{PLUGINS} mount with default permissions"
mount = PluginMount.new(PLUGINS)
mount.allow("*")
@ -145,7 +145,7 @@ class Puppet::Network::Handler
desc.collect { |sub| sub.join("\t") }.join("\n")
end
def local?
self.local
end
@ -349,14 +349,14 @@ class Puppet::Network::Handler
mount.allow("*")
newmounts[MODULES] = mount
end
unless newmounts[PLUGINS]
Puppet.debug "No #{PLUGINS} mount given; autocreating with default permissions"
mount = PluginMount.new(PLUGINS)
mount.allow("*")
newmounts[PLUGINS] = mount
end
unless newmounts[PLUGINS].valid?
Puppet.debug "No path given for #{PLUGINS} mount; creating a special PluginMount"
# We end up here if the user has specified access rules for
@ -372,7 +372,7 @@ class Puppet::Network::Handler
)
newmounts[PLUGINS] = mount
end
# Verify each of the mounts are valid.
# We let the check raise an error, so that it can raise an error
# pointing to the specific problem.
@ -433,7 +433,7 @@ class Puppet::Network::Handler
# Create a map for a specific client.
def clientmap(client)
{
"h" => client.sub(/\..*$/, ""),
"h" => client.sub(/\..*$/, ""),
"H" => client,
"d" => client.sub(/[^.]+\./, "") # domain name
}
@ -454,7 +454,7 @@ class Puppet::Network::Handler
end
path.gsub(/%(.)/) do |v|
key = $1
if key == "%"
if key == "%"
"%"
else
map[key] || v
@ -698,7 +698,7 @@ class Puppet::Network::Handler
# A special mount class specifically for the plugins mount -- just
# has some magic to effectively do a union mount of the 'plugins'
# directory of all modules.
#
#
class PluginMount < Mount
def path(client)
''
@ -719,7 +719,7 @@ class Puppet::Network::Handler
def mod_file_path(mod, relpath, client = nil)
File.join(mod, PLUGINS, relpath)
end
def file_path(relpath, client = nil)
return nil unless mod = valid_modules(client).find { |m| m.plugin(relpath) }
mod.plugin(relpath)
@ -746,7 +746,7 @@ class Puppet::Network::Handler
def valid_modules(client)
Puppet::Node::Environment.new.modules.find_all { |mod| mod.exist? }
end
def add_to_filetree(f, filetree)
first, rest = f.split(File::SEPARATOR, 2)
end

Просмотреть файл

@ -74,7 +74,7 @@ class Puppet::Network::Handler
end
end
#
#
def decode_facts(facts)
if @local
# we don't need to do anything, since we should already

Просмотреть файл

@ -79,7 +79,7 @@ class Puppet::Network::Handler
# Handle the parsing of the reports attribute.
def reports
# LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
# LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
x = Puppet[:reports].gsub(/(^\s+)|(\s+$)/, '').split(/\s*,\s*/)
end
end

Просмотреть файл

@ -7,7 +7,7 @@ class Puppet::Network::Handler
desc "An interface for interacting with client-based resources that can
be used for querying or managing remote machines without using Puppet's
central server tools.
The ``describe`` and ``list`` methods return TransBuckets containing
TransObject instances (``describe`` returns a single TransBucket),
and the ``apply`` method accepts a TransBucket of TransObjects and
@ -44,7 +44,7 @@ class Puppet::Network::Handler
# And then apply the catalog. This way we're reusing all
# the code in there. It should probably just be separated out, though.
transaction = catalog.apply
# And then clean up
catalog.clear(true)
@ -173,14 +173,14 @@ class Puppet::Network::Handler
end
# Deal with ignore parameters.
def handleignore(children, path, ignore)
ignore.each { |ignore|
def handleignore(children, path, ignore)
ignore.each { |ignore|
Dir.glob(File.join(path,ignore), File::FNM_DOTMATCH) { |match|
children.delete(File.basename(match))
}
}
}
return children
end
end
def to_s
"resource"

Просмотреть файл

@ -7,7 +7,7 @@ module Puppet::Network::HTTP
when :mongrel
raise ArgumentError, "Mongrel is not installed on this platform" unless Puppet.features.mongrel?
require 'puppet/network/http/mongrel'
return Puppet::Network::HTTP::Mongrel
return Puppet::Network::HTTP::Mongrel
else
raise ArgumentError, "Unknown HTTP server name [#{kind}]"
end

Просмотреть файл

@ -165,7 +165,7 @@ module Puppet::Network::HTTP::Handler
def path(request)
raise NotImplementedError
end
end
def request_key(request)
raise NotImplementedError

Просмотреть файл

@ -6,7 +6,7 @@ class Puppet::Network::HTTP::Mongrel
def initialize(args = {})
@listening = false
end
def listen(args = {})
raise ArgumentError, ":protocols must be specified." if !args[:protocols] or args[:protocols].empty?
raise ArgumentError, ":address must be specified." unless args[:address]
@ -15,26 +15,26 @@ class Puppet::Network::HTTP::Mongrel
@protocols = args[:protocols]
@xmlrpc_handlers = args[:xmlrpc_handlers]
@server = Mongrel::HttpServer.new(args[:address], args[:port])
@server = Mongrel::HttpServer.new(args[:address], args[:port])
setup_handlers
@listening = true
@server.run
end
def unlisten
raise "Mongrel server is not listening" unless listening?
@server.stop
@server = nil
@listening = false
end
def listening?
@listening
end
private
def setup_handlers
# Register our REST support at /
klass = class_for_protocol(:rest)
@ -49,7 +49,7 @@ class Puppet::Network::HTTP::Mongrel
def setup_xmlrpc_handlers
@server.register('/RPC2', Puppet::Network::HTTPServer::Mongrel.new(@xmlrpc_handlers))
end
def class_for_protocol(protocol)
return Puppet::Network::HTTP::MongrelREST if protocol.to_sym == :rest
raise ArgumentError, "Unknown protocol [#{protocol}]."

Просмотреть файл

@ -30,7 +30,7 @@ class Puppet::Network::HTTP::MongrelREST < Mongrel::HttpHandler
# what path was requested?
def path(request)
# LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
# LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
#x = '/' + request.params[Mongrel::Const::REQUEST_PATH]
request.params[Mongrel::Const::REQUEST_PATH]
end

Просмотреть файл

@ -12,19 +12,19 @@ class Puppet::Network::HTTP::WEBrick
@listening = false
@mutex = Mutex.new
end
def self.class_for_protocol(protocol)
return Puppet::Network::HTTP::WEBrickREST if protocol.to_sym == :rest
raise "Unknown protocol [#{protocol}]."
end
def listen(args = {})
raise ArgumentError, ":protocols must be specified." if !args[:protocols] or args[:protocols].empty?
raise ArgumentError, ":address must be specified." unless args[:address]
raise ArgumentError, ":port must be specified." unless args[:port]
@protocols = args[:protocols]
@xmlrpc_handlers = args[:xmlrpc_handlers]
@xmlrpc_handlers = args[:xmlrpc_handlers]
arguments = {:BindAddress => args[:address], :Port => args[:port]}
arguments.merge!(setup_logger)
@ -35,12 +35,12 @@ class Puppet::Network::HTTP::WEBrick
setup_handlers
@mutex.synchronize do
raise "WEBrick server is already listening" if @listening
raise "WEBrick server is already listening" if @listening
@listening = true
@thread = Thread.new { @server.start }
end
end
def unlisten
@mutex.synchronize do
raise "WEBrick server is not listening" unless @listening
@ -50,7 +50,7 @@ class Puppet::Network::HTTP::WEBrick
@listening = false
end
end
def listening?
@mutex.synchronize do
@listening
@ -110,7 +110,7 @@ class Puppet::Network::HTTP::WEBrick
end
private
def setup_handlers
# Set up the new-style protocols.
klass = self.class.class_for_protocol(:rest)

Просмотреть файл

@ -10,7 +10,7 @@ module Puppet::Network::HttpPool
include Puppet::Util::Cacher
private
cached_attr(:http_cache) { Hash.new }
end

Просмотреть файл

@ -3,7 +3,7 @@
# Author: Manuel Holtgrewe <purestorm at ggnore.net>
#
# Copyright (c) 2006 Manuel Holtgrewe, 2007 Luke Kanies
#
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
@ -11,10 +11,10 @@
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@ -113,7 +113,7 @@ module Puppet::Network
end
end
end
private
def client_info(request)
@ -144,7 +144,7 @@ module Puppet::Network
def parse_content_type(str)
a, *b = str.split(";")
return a.strip, *b
end
end
end
end

Просмотреть файл

@ -18,7 +18,7 @@ module Puppet
include Puppet::SSLCertificates::Support
# Read the CA cert and CRL and populate an OpenSSL::X509::Store
# with them, with flags appropriate for checking client
# with them, with flags appropriate for checking client
# certificates for revocation
def x509store
if Puppet[:cacrl] == 'false'

Просмотреть файл

@ -16,7 +16,7 @@ module Puppet::Network
@authconfig
end
# Verify that our client has access.
# Verify that our client has access.
def check_authorization(request)
authconfig.allowed?(request)
end

Просмотреть файл

@ -42,7 +42,7 @@ class Rights
res = :nomatch
right = @rights.find do |acl|
found = false
# an acl can return :dunno, which means "I'm not qualified to answer your question,
# an acl can return :dunno, which means "I'm not qualified to answer your question,
# please ask someone else". This is used when for instance an acl matches, but not for the
# current rest method, where we might think some other acl might be more specific.
if match = acl.match?(name)

Просмотреть файл

@ -83,7 +83,7 @@ class Puppet::Network::Server
@routes[name.to_sym] = true
end
end
# Unregister Indirector handlers.
def unregister(*indirections)
raise "Cannot unregister indirections while server is listening." if listening?
@ -92,7 +92,7 @@ class Puppet::Network::Server
indirections.flatten.each do |i|
raise(ArgumentError, "Indirection [%s] is unknown." % i) unless @routes[i.to_sym]
end
indirections.flatten.each do |i|
@routes.delete(i.to_sym)
end
@ -106,7 +106,7 @@ class Puppet::Network::Server
@xmlrpc_routes[name.to_sym] = true
end
end
# Unregister xmlrpc handlers.
def unregister_xmlrpc(*namespaces)
raise "Cannot unregister xmlrpc handlers while server is listening." if listening?
@ -115,7 +115,7 @@ class Puppet::Network::Server
namespaces.flatten.each do |i|
raise(ArgumentError, "XMLRPC handler '%s' is unknown." % i) unless @xmlrpc_routes[i.to_sym]
end
namespaces.flatten.each do |i|
@xmlrpc_routes.delete(i.to_sym)
end
@ -124,19 +124,19 @@ class Puppet::Network::Server
def listening?
@listening
end
def listen
raise "Cannot listen -- already listening." if listening?
@listening = true
http_server.listen(:address => address, :port => port, :handlers => @routes.keys, :xmlrpc_handlers => @xmlrpc_routes.keys, :protocols => protocols)
end
def unlisten
raise "Cannot unlisten -- not currently listening." unless listening?
http_server.unlisten
http_server.unlisten
@listening = false
end
def http_server_class
http_server_class_by_type(@server_type)
end
@ -152,11 +152,11 @@ class Puppet::Network::Server
end
private
def http_server
@http_server ||= http_server_class.new
end
def http_server_class_by_type(kind)
Puppet::Network::HTTP.server_class_by_type(kind)
end

Просмотреть файл

@ -82,7 +82,7 @@ module Puppet::Network
if detail.message.include?(str)
Puppet.warning "Certificate validation failed; consider using the certname configuration option"
end
end
end
raise XMLRPCClientError, "Certificates were not trusted: %s" % detail
end
@ -90,7 +90,7 @@ module Puppet::Network
if detail.message.to_s =~ /^Wrong size\. Was \d+, should be \d+$/
Puppet.warning "XMLRPC returned wrong size. Retrying."
return :retry
end
end
Puppet.err "Could not call %s.%s: %s" % [namespace, method, detail.inspect]
error = XMLRPCClientError.new(detail.to_s)
error.set_backtrace detail.backtrace
@ -107,7 +107,7 @@ module Puppet::Network
if detail.message.include?(str)
Puppet.warning "Certificate validation failed; consider using the certname configuration option"
end
end
end
raise XMLRPCClientError, "Certificates were not trusted: %s" % detail
end
@ -185,7 +185,7 @@ module Puppet::Network
)
@http = Puppet::Network::HttpPool.http_instance(@host, @port)
end
# Get rid of our existing connection, replacing it with a new one.
# This should only happen if we lose our connection somehow (e.g., an EPIPE)
# or we've just downloaded certs and we need to create new http instances
@ -197,7 +197,7 @@ module Puppet::Network
@http = nil
self.http # force a new one
end
def start
begin
@http.start unless @http.started?

Просмотреть файл

@ -42,7 +42,7 @@ module Puppet::Network::XMLRPC
# we need to pass a ClientRequest object to process() so we can do
# authorization. It's the only way to stay thread-safe.
def service(request, response)
if @valid_ip
if @valid_ip
raise WEBrick::HTTPStatus::Forbidden unless @valid_ip.any? { |ip| request.peeraddr[3] =~ ip }
end
@ -51,9 +51,9 @@ module Puppet::Network::XMLRPC
"unsupported method `#{request.request_method}'."
end
if parse_content_type(request['Content-type']).first != "text/xml"
if parse_content_type(request['Content-type']).first != "text/xml"
raise WEBrick::HTTPStatus::BadRequest
end
end
length = (request['Content-length'] || 0).to_i
@ -66,14 +66,14 @@ module Puppet::Network::XMLRPC
end
resp = process(data, client_request(request))
if resp.nil? or resp.size <= 0
if resp.nil? or resp.size <= 0
raise WEBrick::HTTPStatus::InternalServerError
end
response.status = 200
response['Content-Length'] = resp.size
response['Content-Type'] = "text/xml; charset=utf-8"
response.body = resp
response.body = resp
end
private
@ -97,7 +97,7 @@ module Puppet::Network::XMLRPC
if cert = request.client_cert
nameary = cert.subject.to_a.find { |ary|
ary[0] == "CN"
}
}
if nameary.nil?
Puppet.warning "Could not retrieve server name from cert"

Просмотреть файл

@ -64,7 +64,7 @@ class Puppet::Parameter
end
private
# A standard way of converting all of our values, so we're always
# comparing apples to apples.
def convert(value)
@ -130,7 +130,7 @@ class Puppet::Parameter
if value = @strings.find { |v| v.match?(test_value) }
return value
end
# Then look for a regex match
@regexes.find { |v| v.match?(test_value) }
end
@ -158,7 +158,7 @@ class Puppet::Parameter
# * <tt>:event</tt>: The event that should be returned when this value is set.
# * <tt>:call</tt>: When to call any associated block. The default value
# is ``instead``, which means to call the value instead of calling the
# provider. You can also specify ``before`` or ``after``, which will
# provider. You can also specify ``before`` or ``after``, which will
# call both the block and the provider, according to the order you specify
# (the ``first`` refers to when the block is called, not the provider).
def newvalue(name, options = {}, &block)

Просмотреть файл

@ -19,7 +19,7 @@ class Puppet::Parser::AST
# Make a new array, so we don't have to deal with the details of
# flattening and such
items = []
# First clean out any AST::ASTArrays
@children.each { |child|
if child.instance_of?(AST::ASTArray)

Просмотреть файл

@ -16,7 +16,7 @@ class Puppet::Parser::AST
def evaluate(scope)
# evaluate the first operand, should return a boolean value
lval = @lval.safeevaluate(scope)
# return result
# lazy evaluate right operand
case @operator
@ -27,8 +27,8 @@ class Puppet::Parser::AST
else # false and false == false
false
end
when "or";
if Puppet::Parser::Scope.true?(lval)
when "or";
if Puppet::Parser::Scope.true?(lval)
true
else
rval = @rval.safeevaluate(scope)

Просмотреть файл

@ -17,7 +17,7 @@ class Puppet::Parser::AST
retvalue = nil
found = false
# Iterate across the options looking for a match.
default = nil
@options.each { |option|

Просмотреть файл

@ -67,7 +67,7 @@ class CollExpr < AST::Branch
else
str = "(%s) %s (%s)" % [str1, oper, str2]
end
return str, code
end

Просмотреть файл

@ -21,7 +21,7 @@ class Puppet::Parser::AST
# convert to number if operands are number
lval = Puppet::Parser::Scope.number?(lval) || lval
rval = Puppet::Parser::Scope.number?(rval) || rval
# return result
unless @operator == '!='
lval.send(@operator,rval)

Просмотреть файл

@ -2,7 +2,7 @@ require 'puppet/parser/ast/branch'
class Puppet::Parser::AST
# A statement syntactically similar to an ResourceDef, but uses a
# capitalized object type and cannot have a name.
# capitalized object type and cannot have a name.
class ResourceDefaults < AST::Branch
attr_accessor :type, :params

Просмотреть файл

@ -34,7 +34,7 @@ class Puppet::Parser::AST
# Now we just create a normal resource, but we call a very different
# method on the scope.
resource = [resource] unless resource.is_a?(Array)
resource = resource.collect do |r|
res = Puppet::Parser::Resource.new(
:type => r.type,

Просмотреть файл

@ -25,7 +25,7 @@ class Puppet::Parser::AST
def evaluate(scope)
title = @title.safeevaluate(scope)
title = [title] unless title.is_a?(Array)
if @type.to_s.downcase == "class"
resource_type = "class"
title = title.collect { |t| qualified_class(scope, t) }

Просмотреть файл

@ -17,9 +17,9 @@ class Puppet::Parser::AST
# Get our parameter.
paramvalue = @param.safeevaluate(scope)
sensitive = Puppet[:casesensitive]
if ! sensitive and paramvalue.respond_to?(:downcase)
paramvalue = paramvalue.downcase
end

Просмотреть файл

@ -120,7 +120,7 @@ module Functions
return false
end
end
# Runs a newfunction to create a function for each of the log levels
Puppet::Util::Log.levels.each do |level|

Просмотреть файл

@ -1,6 +1,6 @@
Puppet::Parser::Functions::newfunction(:fqdn_rand, :type => :rvalue, :doc =>
"Generates random numbers based on the node's fqdn. The first argument
sets the range. The second argument specifies a number to add to the
Puppet::Parser::Functions::newfunction(:fqdn_rand, :type => :rvalue, :doc =>
"Generates random numbers based on the node's fqdn. The first argument
sets the range. The second argument specifies a number to add to the
seed and is optional.") do |args|
require 'md5'
max = args[0]

Просмотреть файл

@ -1,7 +1,7 @@
Puppet::Parser::Functions::newfunction(:inline_template, :type => :rvalue, :doc =>
"Evaluate a template string and return its value. See `the templating docs
</trac/puppet/wiki/PuppetTemplating>`_ for more information. Note that
if multiple template strings are specified, their output is all concatenated
Puppet::Parser::Functions::newfunction(:inline_template, :type => :rvalue, :doc =>
"Evaluate a template string and return its value. See `the templating docs
</trac/puppet/wiki/PuppetTemplating>`_ for more information. Note that
if multiple template strings are specified, their output is all concatenated
and returned as the output of the function.") do |vals|
require 'erb'

Просмотреть файл

@ -1,7 +1,7 @@
module Puppet::Parser::Functions
newfunction(:regsubst, :type => :rvalue,
:doc => "
Perform regexp replacement on a string.
Perform regexp replacement on a string.
- **Parameters** (in order):
@ -19,7 +19,7 @@ module Puppet::Parser::Functions
- **G** Global replacement; all occurrences of the regexp in the string will be replaced. Without this, only the first occurrence will be replaced.
:lang: Optional. How to handle multibyte characters. A single-character string with the following values:
- **N** None
- **E** EUC
- **S** SJIS

Просмотреть файл

@ -1,7 +1,7 @@
Puppet::Parser::Functions::newfunction(:template, :type => :rvalue, :doc =>
"Evaluate a template and return its value. See `the templating docs
</trac/puppet/wiki/PuppetTemplating>`_ for more information. Note that
if multiple templates are specified, their output is all concatenated
Puppet::Parser::Functions::newfunction(:template, :type => :rvalue, :doc =>
"Evaluate a template and return its value. See `the templating docs
</trac/puppet/wiki/PuppetTemplating>`_ for more information. Note that
if multiple templates are specified, their output is all concatenated
and returned as the output of the function.") do |vals|
require 'erb'

Просмотреть файл

@ -471,10 +471,10 @@ else: # nothing
# Unlike yacc/bison, it seems racc
# gives tons of shift/reduce warnings
# with the following syntax:
#
#
# expression: ...
# | expression arithop expressio { ... }
#
#
# arithop: PLUS | MINUS | DIVIDE | TIMES ...
#
# So I had to develop the expression by adding one rule
@ -525,10 +525,10 @@ expression: rvalue
}
| expression AND expression {
result = ast AST::BooleanOperator, :operator => val[1], :lval => val[0], :rval => val[2]
}
}
| expression OR expression {
result = ast AST::BooleanOperator, :operator => val[1], :lval => val[0], :rval => val[2]
}
}
| LPAREN expression RPAREN {
result = val[1]
}
@ -578,9 +578,9 @@ selector: selectlhand QMARK svalues {
}
svalues: selectval
| LBRACE sintvalues endcomma RBRACE {
| LBRACE sintvalues endcomma RBRACE {
@lexer.commentpop
result = val[1]
result = val[1]
}
sintvalues: selectval
@ -670,7 +670,7 @@ classname: NAME
# Multiple hostnames, as used for node names. These are all literal
# strings, not AST objects.
hostnames: hostname
hostnames: hostname
| hostnames COMMA hostname {
result = val[0]
result = [result] unless result.is_a?(Array)

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше