summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMatt Robinson <matt@puppetlabs.com>2011-03-18 14:41:30 -0700
committerMatt Robinson <matt@puppetlabs.com>2011-03-18 14:41:30 -0700
commit7e71840e29cb09c772668a51ada3cab1e319e50f (patch)
tree9b0c15f2c93fa6c60364bd78dcbe17a40b740a23 /lib
parentea348761df0b5297dbac50c7f1c48d22746524fa (diff)
parent2ae88067492f7922a3c4d53b6fa8c849b193f76a (diff)
downloadpuppet-7e71840e29cb09c772668a51ada3cab1e319e50f.tar.gz
puppet-7e71840e29cb09c772668a51ada3cab1e319e50f.tar.xz
puppet-7e71840e29cb09c772668a51ada3cab1e319e50f.zip
Merge branch 'next'
* next: (198 commits) (#6722) load all functions before testing... Updated CHANGELOG for 2.6.7rc1 (#5073) Download plugins even if you're filtering on tags Fix #5610: Prevent unnecessary RAL lookups Revert "Merge branch 'ticket/2.6.x/5605' of git://github.com/stschulte/puppet into 2.6.next" (#6723) Fix withenv environment restoration bug (#6689) Remove extraneous include of Puppet::Util in InventoryActiveRecord Remove extra trailing whitespace from lib/puppet/resource.rb (#5428) More fully "stub" Puppet::Resource::Reference for use with storedconfigs (#6707) Fix typo in rest_authconfig.rb (#6689) Make inventory_active_record terminus search quickly (#5479) Test that we auto-require the zone dataset. (#5479) Autorequire zfs filesystem when zone dataset is configured (#5392) Give a better error when realizing a non-existant resource (#2645) Adding a less-stubby test to verify the "system" attribute's behavior Update CHANGELOG for 2.6.6 maint: Remove serialization of InventoryFact values maint: Rename InventoryHost to InventoryNode (#6441) Add mount fixture for AIX's /etc/filesystems Fixed #2645 - Added support for creating system users ...
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet.rb2
-rw-r--r--lib/puppet/application.rb37
-rw-r--r--lib/puppet/application/agent.rb215
-rw-r--r--lib/puppet/application/apply.rb101
-rw-r--r--lib/puppet/application/cert.rb161
-rw-r--r--lib/puppet/application/describe.rb54
-rw-r--r--lib/puppet/application/doc.rb99
-rw-r--r--lib/puppet/application/filebucket.rb105
-rw-r--r--lib/puppet/application/inspect.rb174
-rw-r--r--lib/puppet/application/kick.rb145
-rw-r--r--lib/puppet/application/master.rb88
-rw-r--r--lib/puppet/application/queue.rb77
-rw-r--r--lib/puppet/application/resource.rb103
-rw-r--r--lib/puppet/configurer/downloader.rb1
-rw-r--r--lib/puppet/configurer/plugin_handler.rb9
-rwxr-xr-xlib/puppet/daemon.rb2
-rw-r--r--lib/puppet/defaults.rb10
-rwxr-xr-xlib/puppet/external/nagios.rb2
-rwxr-xr-xlib/puppet/external/nagios/base.rb2
-rw-r--r--lib/puppet/file_bucket/dipper.rb5
-rw-r--r--lib/puppet/indirector/facts/inventory_active_record.rb97
-rw-r--r--lib/puppet/indirector/facts/yaml.rb75
-rw-r--r--lib/puppet/indirector/file_bucket_file/file.rb55
-rw-r--r--lib/puppet/module.rb2
-rw-r--r--lib/puppet/network/http/api/v1.rb4
-rw-r--r--lib/puppet/network/http/compression.rb5
-rw-r--r--lib/puppet/network/http/rack/rest.rb4
-rw-r--r--lib/puppet/network/rest_authconfig.rb2
-rwxr-xr-xlib/puppet/network/rights.rb2
-rwxr-xr-xlib/puppet/node/facts.rb6
-rw-r--r--lib/puppet/parser/ast/collection.rb9
-rw-r--r--lib/puppet/parser/ast/leaf.rb2
-rw-r--r--lib/puppet/parser/functions/regsubst.rb21
-rw-r--r--lib/puppet/parser/functions/split.rb14
-rw-r--r--lib/puppet/parser/grammar.ra6
-rw-r--r--lib/puppet/parser/lexer.rb5
-rw-r--r--lib/puppet/parser/parser.rb3547
-rw-r--r--lib/puppet/provider/computer/computer.rb4
-rw-r--r--lib/puppet/provider/mount.rb28
-rwxr-xr-xlib/puppet/provider/mount/parsed.rb75
-rwxr-xr-xlib/puppet/provider/parsedfile.rb4
-rw-r--r--lib/puppet/provider/service/daemontools.rb12
-rw-r--r--lib/puppet/provider/service/gentoo.rb2
-rw-r--r--lib/puppet/provider/service/launchd.rb19
-rw-r--r--lib/puppet/provider/service/runit.rb8
-rw-r--r--lib/puppet/provider/user/useradd.rb7
-rw-r--r--lib/puppet/provider/zpool/solaris.rb12
-rw-r--r--lib/puppet/rails/database/004_add_inventory_service_tables.rb36
-rw-r--r--lib/puppet/rails/database/schema.rb17
-rw-r--r--lib/puppet/rails/fact_name.rb2
-rw-r--r--lib/puppet/rails/fact_value.rb2
-rw-r--r--lib/puppet/rails/inventory_fact.rb5
-rw-r--r--lib/puppet/rails/inventory_node.rb25
-rw-r--r--lib/puppet/reference/configuration.rb2
-rw-r--r--lib/puppet/reference/metaparameter.rb2
-rw-r--r--lib/puppet/reports/store.rb5
-rw-r--r--lib/puppet/resource.rb64
-rw-r--r--lib/puppet/simple_graph.rb194
-rw-r--r--lib/puppet/type.rb35
-rw-r--r--lib/puppet/type/augeas.rb8
-rw-r--r--lib/puppet/type/computer.rb6
-rwxr-xr-xlib/puppet/type/exec.rb13
-rw-r--r--lib/puppet/type/file.rb4
-rwxr-xr-xlib/puppet/type/file/content.rb40
-rwxr-xr-xlib/puppet/type/file/ensure.rb28
-rw-r--r--lib/puppet/type/file/selcontext.rb16
-rwxr-xr-xlib/puppet/type/file/source.rb14
-rw-r--r--lib/puppet/type/file/target.rb15
-rw-r--r--lib/puppet/type/k5login.rb2
-rw-r--r--lib/puppet/type/macauthorization.rb5
-rw-r--r--lib/puppet/type/mcx.rb5
-rwxr-xr-xlib/puppet/type/mount.rb60
-rw-r--r--lib/puppet/type/package.rb6
-rwxr-xr-xlib/puppet/type/schedule.rb40
-rw-r--r--lib/puppet/type/selmodule.rb4
-rw-r--r--lib/puppet/type/ssh_authorized_key.rb6
-rwxr-xr-xlib/puppet/type/user.rb15
-rwxr-xr-xlib/puppet/type/zfs.rb4
-rw-r--r--lib/puppet/type/zone.rb21
-rwxr-xr-xlib/puppet/type/zpool.rb12
-rw-r--r--lib/puppet/util.rb5
-rw-r--r--lib/puppet/util/command_line.rb10
-rwxr-xr-xlib/puppet/util/command_line/filebucket97
-rwxr-xr-xlib/puppet/util/command_line/pi48
-rwxr-xr-xlib/puppet/util/command_line/puppet69
-rwxr-xr-xlib/puppet/util/command_line/puppetca110
-rwxr-xr-xlib/puppet/util/command_line/puppetd188
-rwxr-xr-xlib/puppet/util/command_line/puppetdoc67
-rwxr-xr-xlib/puppet/util/command_line/puppetmasterd74
-rwxr-xr-xlib/puppet/util/command_line/puppetqd53
-rwxr-xr-xlib/puppet/util/command_line/puppetrun126
-rwxr-xr-xlib/puppet/util/command_line/ralsh89
-rw-r--r--lib/puppet/util/execution.rb9
-rw-r--r--lib/puppet/util/execution_stub.rb26
-rw-r--r--lib/puppet/util/log.rb6
-rw-r--r--lib/puppet/util/log/destinations.rb2
-rw-r--r--lib/puppet/util/monkey_patches.rb21
-rw-r--r--lib/puppet/util/rdoc.rb14
-rw-r--r--lib/puppet/util/rdoc/code_objects.rb39
-rw-r--r--lib/puppet/util/rdoc/generators/puppet_generator.rb18
-rw-r--r--lib/puppet/util/rdoc/parser.rb10
-rw-r--r--lib/puppet/util/settings.rb2
-rw-r--r--lib/puppet/util/zaml.rb1
103 files changed, 4129 insertions, 3087 deletions
diff --git a/lib/puppet.rb b/lib/puppet.rb
index a58d3c801..ef5fb7f06 100644
--- a/lib/puppet.rb
+++ b/lib/puppet.rb
@@ -24,7 +24,7 @@ require 'puppet/util/run_mode'
# it's also a place to find top-level commands like 'debug'
module Puppet
- PUPPETVERSION = '2.6.4'
+ PUPPETVERSION = '2.6.7'
def Puppet.version
PUPPETVERSION
diff --git a/lib/puppet/application.rb b/lib/puppet/application.rb
index 17ad69cee..7ef71bc81 100644
--- a/lib/puppet/application.rb
+++ b/lib/puppet/application.rb
@@ -250,7 +250,8 @@ class Application
# Every app responds to --help
option("--help", "-h") do |v|
- help
+ puts help
+ exit
end
def should_parse_config?
@@ -264,9 +265,21 @@ class Application
def initialize(command_line = nil)
require 'puppet/util/command_line'
@command_line = command_line || Puppet::Util::CommandLine.new
- @run_mode = self.class.run_mode
+ set_run_mode self.class.run_mode
@options = {}
+ require 'puppet'
+ end
+
+ # WARNING: This is a totally scary, frightening, and nasty internal API. We
+ # strongly advise that you do not use this, and if you insist, we will
+ # politely allow you to keep both pieces of your broken code.
+ #
+ # We plan to provide a supported, long-term API to deliver this in a way
+ # that you can use. Please make sure that you let us know if you do require
+ # this, and this message is still present in the code. --daniel 2011-02-03
+ def set_run_mode(mode)
+ @run_mode = mode
$puppet_application_mode = @run_mode
$puppet_application_name = name
@@ -281,8 +294,6 @@ class Application
Puppet.settings.set_value(:rundir, Puppet.run_mode.run_dir, :mutable_defaults)
Puppet.settings.set_value(:run_mode, Puppet.run_mode.name.to_s, :mutable_defaults)
end
-
- require 'puppet'
end
# This is the main application entry point
@@ -375,23 +386,7 @@ class Application
end
def help
- if Puppet.features.usage?
- # RH:FIXME: My goodness, this is ugly.
- ::RDoc.const_set("PuppetSourceFile", name)
- #:stopdoc: # Issue #4161
- def (::RDoc).caller
- docfile = `grep -l 'Puppet::Application\\[:#{::RDoc::PuppetSourceFile}\\]' #{DOCPATTERN}`.chomp
- super << "#{docfile}:0"
- end
- #:startdoc:
- ::RDoc::usage && exit
- else
- puts "No help available unless you have RDoc::usage installed"
- exit
- end
- rescue Errno::ENOENT
- puts "No help available for puppet #{name}"
- exit
+ "No help available for puppet #{name}"
end
private
diff --git a/lib/puppet/application/agent.rb b/lib/puppet/application/agent.rb
index 96f33296f..2ee40227e 100644
--- a/lib/puppet/application/agent.rb
+++ b/lib/puppet/application/agent.rb
@@ -9,7 +9,7 @@ class Puppet::Application::Agent < Puppet::Application
def preinit
# Do an initial trap, so that cancels don't get a stack trace.
- trap(:INT) do
+ Signal.trap(:INT) do
$stderr.puts "Cancelling startup"
exit(0)
end
@@ -83,6 +83,217 @@ class Puppet::Application::Agent < Puppet::Application
@args[:Port] = arg
end
+ def help
+ <<-HELP
+
+puppet-agent(8) -- The puppet agent daemon
+========
+
+SYNOPSIS
+--------
+Retrieves the client configuration from the puppet master and applies it to
+the local host.
+
+This service may be run as a daemon, run periodically using cron (or something
+similar), or run interactively for testing purposes.
+
+
+USAGE
+-----
+puppet agent [-D|--daemonize|--no-daemonize] [-d|--debug]
+ [--detailed-exitcodes] [--disable] [--enable] [-h|--help]
+ [--certname <host name>] [-l|--logdest syslog|<file>|console]
+ [-o|--onetime] [--serve <handler>] [-t|--test] [--noop]
+ [--digest <digest>] [--fingerprint] [-V|--version]
+ [-v|--verbose] [-w|--waitforcert <seconds>]
+
+
+DESCRIPTION
+-----------
+This is the main puppet client. Its job is to retrieve the local
+machine's configuration from a remote server and apply it. In order to
+successfully communicate with the remote server, the client must have a
+certificate signed by a certificate authority that the server trusts;
+the recommended method for this, at the moment, is to run a certificate
+authority as part of the puppet server (which is the default). The
+client will connect and request a signed certificate, and will continue
+connecting until it receives one.
+
+Once the client has a signed certificate, it will retrieve its
+configuration and apply it.
+
+
+USAGE NOTES
+-----------
+'puppet agent' does its best to find a compromise between interactive
+use and daemon use. Run with no arguments and no configuration, it will
+go into the background, attempt to get a signed certificate, and retrieve
+and apply its configuration every 30 minutes.
+
+Some flags are meant specifically for interactive use -- in particular,
+'test', 'tags' or 'fingerprint' are useful. 'test' enables verbose
+logging, causes the daemon to stay in the foreground, exits if the
+server's configuration is invalid (this happens if, for instance, you've
+left a syntax error on the server), and exits after running the
+configuration once (rather than hanging around as a long-running
+process).
+
+'tags' allows you to specify what portions of a configuration you want
+to apply. Puppet elements are tagged with all of the class or definition
+names that contain them, and you can use the 'tags' flag to specify one
+of these names, causing only configuration elements contained within
+that class or definition to be applied. This is very useful when you are
+testing new configurations -- for instance, if you are just starting to
+manage 'ntpd', you would put all of the new elements into an 'ntpd'
+class, and call puppet with '--tags ntpd', which would only apply that
+small portion of the configuration during your testing, rather than
+applying the whole thing.
+
+'fingerprint' is a one-time flag. In this mode 'puppet agent' will run
+once and display on the console (and in the log) the current certificate
+(or certificate request) fingerprint. Providing the '--digest' option
+allows to use a different digest algorithm to generate the fingerprint.
+The main use is to verify that before signing a certificate request on
+the master, the certificate request the master received is the same as
+the one the client sent (to prevent against man-in-the-middle attacks
+when signing certificates).
+
+
+OPTIONS
+-------
+Note that any configuration parameter that's valid in the configuration
+file is also a valid long argument. For example, 'server' is a valid
+configuration parameter, so you can specify '--server <servername>' as
+an argument.
+
+See the configuration file documentation at
+http://docs.puppetlabs.com/references/stable/configuration.html for the
+full list of acceptable parameters. A commented list of all
+configuration options can also be generated by running puppet agent with
+'--genconfig'.
+
+* --daemonize:
+ Send the process into the background. This is the default.
+
+* --no-daemonize:
+ Do not send the process into the background.
+
+* --debug:
+ Enable full debugging.
+
+* --digest:
+ Change the certificate fingerprinting digest algorithm. The default is
+ MD5. Valid values depends on the version of OpenSSL installed, but
+ should always at least contain MD5, MD2, SHA1 and SHA256.
+
+* --detailed-exitcodes:
+ Provide transaction information via exit codes. If this is enabled, an
+ exit code of '2' means there were changes, and an exit code of '4'
+ means that there were failures during the transaction. This option
+ only makes sense in conjunction with --onetime.
+
+* --disable:
+ Disable working on the local system. This puts a lock file in place,
+ causing 'puppet agent' not to work on the system until the lock file
+ is removed. This is useful if you are testing a configuration and do
+ not want the central configuration to override the local state until
+ everything is tested and committed.
+
+ 'puppet agent' uses the same lock file while it is running, so no more
+ than one 'puppet agent' process is working at a time.
+
+ 'puppet agent' exits after executing this.
+
+* --enable:
+ Enable working on the local system. This removes any lock file,
+ causing 'puppet agent' to start managing the local system again
+ (although it will continue to use its normal scheduling, so it might
+ not start for another half hour).
+
+ 'puppet agent' exits after executing this.
+
+* --certname:
+ Set the certname (unique ID) of the client. The master reads this
+ unique identifying string, which is usually set to the node's
+ fully-qualified domain name, to determine which configurations the
+ node will receive. Use this option to debug setup problems or
+ implement unusual node identification schemes.
+
+* --help:
+ Print this help message
+
+* --logdest:
+ Where to send messages. Choose between syslog, the console, and a log
+ file. Defaults to sending messages to syslog, or the console if
+ debugging or verbosity is enabled.
+
+* --no-client:
+ Do not create a config client. This will cause the daemon to run
+ without ever checking for its configuration automatically, and only
+ makes sense
+
+* --onetime:
+ Run the configuration once. Runs a single (normally daemonized) Puppet
+ run. Useful for interactively running puppet agent when used in
+ conjunction with the --no-daemonize option.
+
+* --fingerprint:
+ Display the current certificate or certificate signing request
+ fingerprint and then exit. Use the '--digest' option to change the
+ digest algorithm used.
+
+* --serve:
+ Start another type of server. By default, 'puppet agent' will start a
+ service handler that allows authenticated and authorized remote nodes
+ to trigger the configuration to be pulled down and applied. You can
+ specify any handler here that does not require configuration, e.g.,
+ filebucket, ca, or resource. The handlers are in
+ 'lib/puppet/network/handler', and the names must match exactly, both
+ in the call to 'serve' and in 'namespaceauth.conf'.
+
+* --test:
+ Enable the most common options used for testing. These are 'onetime',
+ 'verbose', 'ignorecache', 'no-daemonize', 'no-usecacheonfailure',
+ 'detailed-exit-codes', 'no-splay', and 'show_diff'.
+
+* --noop:
+ Use 'noop' mode where the daemon runs in a no-op or dry-run mode. This
+ is useful for seeing what changes Puppet will make without actually
+ executing the changes.
+
+* --verbose:
+ Turn on verbose reporting.
+
+* --version:
+ Print the puppet version number and exit.
+
+* --waitforcert:
+ This option only matters for daemons that do not yet have certificates
+ and it is enabled by default, with a value of 120 (seconds). This
+ causes 'puppet agent' to connect to the server every 2 minutes and ask
+ it to sign a certificate request. This is useful for the initial setup
+ of a puppet client. You can turn off waiting for certificates by
+ specifying a time of 0.
+
+
+EXAMPLE
+-------
+ $ puppet agent --server puppet.domain.com
+
+
+AUTHOR
+------
+Luke Kanies
+
+
+COPYRIGHT
+---------
+Copyright (c) 2005, 2006 Puppet Labs, LLC Licensed under the GNU Public
+License
+
+ HELP
+ end
+
def run_command
return fingerprint if options[:fingerprint]
return onetime if Puppet[:onetime]
@@ -119,7 +330,7 @@ class Puppet::Application::Agent < Puppet::Application
if not report
exit(1)
- elsif not Puppet[:noop] and options[:detailed_exitcodes] then
+ elsif options[:detailed_exitcodes] then
exit(report.exit_status)
else
exit(0)
diff --git a/lib/puppet/application/apply.rb b/lib/puppet/application/apply.rb
index e5b4bb5b7..2b7c9f8fb 100644
--- a/lib/puppet/application/apply.rb
+++ b/lib/puppet/application/apply.rb
@@ -26,6 +26,103 @@ class Puppet::Application::Apply < Puppet::Application
end
end
+ def help
+ <<-HELP
+
+puppet-apply(8) -- Apply Puppet manifests locally
+========
+
+SYNOPSIS
+--------
+Applies a standalone Puppet manifest to the local system.
+
+
+USAGE
+-----
+puppet apply [-h|--help] [-V|--version] [-d|--debug] [-v|--verbose]
+ [-e|--execute] [--detailed-exitcodes] [-l|--logdest <file>]
+ [--apply <catalog>] <file>
+
+
+DESCRIPTION
+-----------
+This is the standalone puppet execution tool; use it to apply
+individual manifests.
+
+When provided with a modulepath, via command line or config file, puppet
+apply can effectively mimic the catalog that would be served by puppet
+master with access to the same modules, although there are some subtle
+differences. When combined with scheduling and an automated system for
+pushing manifests, this can be used to implement a serverless Puppet
+site.
+
+Most users should use 'puppet agent' and 'puppet master' for site-wide
+manifests.
+
+
+OPTIONS
+-------
+Note that any configuration parameter that's valid in the configuration
+file is also a valid long argument. For example, 'modulepath' is a
+valid configuration parameter, so you can specify '--tags <class>,<tag>'
+as an argument.
+
+See the configuration file documentation at
+http://docs.puppetlabs.com/references/stable/configuration.html for the
+full list of acceptable parameters. A commented list of all
+configuration options can also be generated by running puppet with
+'--genconfig'.
+
+* --debug:
+ Enable full debugging.
+
+* --detailed-exitcodes:
+ Provide transaction information via exit codes. If this is enabled, an
+ exit code of '2' means there were changes, and an exit code of '4'
+ means that there were failures during the transaction.
+
+* --help:
+ Print this help message
+
+* --loadclasses:
+ Load any stored classes. 'puppet agent' caches configured classes
+ (usually at /etc/puppet/classes.txt), and setting this option causes
+ all of those classes to be set in your puppet manifest.
+
+* --logdest:
+ Where to send messages. Choose between syslog, the console, and a log
+ file. Defaults to sending messages to the console.
+
+* --execute:
+ Execute a specific piece of Puppet code
+
+* --verbose:
+ Print extra information.
+
+* --apply:
+ Apply a JSON catalog (such as one generated with 'puppet master --compile'). You can
+ either specify a JSON file or pipe in JSON from standard input.
+
+
+EXAMPLE
+-------
+ $ puppet apply -l /tmp/manifest.log manifest.pp
+ $ puppet apply --modulepath=/root/dev/modules -e "include ntpd::server"
+
+
+AUTHOR
+------
+Luke Kanies
+
+
+COPYRIGHT
+---------
+Copyright (c) 2005 Puppet Labs, LLC Licensed under the GNU Public
+License
+
+ HELP
+ end
+
def run_command
if options[:catalog]
apply
@@ -125,7 +222,7 @@ class Puppet::Application::Apply < Puppet::Application
configurer = Puppet::Configurer.new
report = configurer.run(:skip_plugin_download => true, :catalog => catalog)
- exit( Puppet[:noop] ? 0 : options[:detailed_exitcodes] ? report.exit_status : 0 )
+ exit( options[:detailed_exitcodes] ? report.exit_status : 0 )
rescue => detail
puts detail.backtrace if Puppet[:trace]
$stderr.puts detail.message
@@ -143,7 +240,7 @@ class Puppet::Application::Apply < Puppet::Application
client = nil
server = nil
- trap(:INT) do
+ Signal.trap(:INT) do
$stderr.puts "Exiting"
exit(1)
end
diff --git a/lib/puppet/application/cert.rb b/lib/puppet/application/cert.rb
index 467b0c859..f02fc893c 100644
--- a/lib/puppet/application/cert.rb
+++ b/lib/puppet/application/cert.rb
@@ -5,17 +5,19 @@ class Puppet::Application::Cert < Puppet::Application
should_parse_config
run_mode :master
- attr_accessor :cert_mode, :all, :ca, :digest, :signed
+ attr_accessor :all, :ca, :digest, :signed
- def find_mode(opt)
- require 'puppet/ssl/certificate_authority'
- modes = Puppet::SSL::CertificateAuthority::Interface::INTERFACE_METHODS
- tmp = opt.sub("--", '').to_sym
- @cert_mode = modes.include?(tmp) ? tmp : nil
+ def subcommand
+ @subcommand
+ end
+ def subcommand=(name)
+ # Handle the nasty, legacy mapping of "clean" to "destroy".
+ sub = name.to_sym
+ @subcommand = (sub == :clean ? :destroy : sub)
end
option("--clean", "-c") do
- @cert_mode = :destroy
+ self.subcommand = "destroy"
end
option("--all", "-a") do
@@ -37,7 +39,7 @@ class Puppet::Application::Cert < Puppet::Application
require 'puppet/ssl/certificate_authority/interface'
Puppet::SSL::CertificateAuthority::Interface::INTERFACE_METHODS.reject {|m| m == :destroy }.each do |method|
option("--#{method}", "-#{method.to_s[0,1]}") do
- find_mode("--#{method}")
+ self.subcommand = method
end
end
@@ -45,6 +47,129 @@ class Puppet::Application::Cert < Puppet::Application
Puppet::Util::Log.level = :info
end
+ def help
+ puts <<-HELP
+
+puppet-cert(8) -- Manage certificates and requests
+========
+
+SYNOPSIS
+--------
+Standalone certificate authority. Capable of generating certificates,
+but mostly used for signing certificate requests from puppet clients.
+
+
+USAGE
+-----
+puppet cert [-h|--help] [-V|--version] [-d|--debug] [-v|--verbose]
+ [-g|--generate] [-l|--list] [-s|--sign] [-r|--revoke] [-p|--print]
+ [-c|--clean] [--verify] [--digest <digest>] [--fingerprint] [host]
+
+
+DESCRIPTION
+-----------
+Because the puppet master service defaults to not signing client
+certificate requests, this script is available for signing outstanding
+requests. It can be used to list outstanding requests and then either
+sign them individually or sign all of them.
+
+
+OPTIONS
+-------
+Note that any configuration parameter that's valid in the configuration
+file is also a valid long argument. For example, 'ssldir' is a valid
+configuration parameter, so you can specify '--ssldir <directory>' as an
+argument.
+
+See the configuration file documentation at
+http://docs.puppetlabs.com/references/stable/configuration.html for the
+full list of acceptable parameters. A commented list of all
+configuration options can also be generated by running puppet cert with
+'--genconfig'.
+
+* --all:
+ Operate on all items. Currently only makes sense with '--sign',
+ '--clean', or '--list'.
+
+* --digest:
+ Set the digest for fingerprinting (defaults to md5). Valid values
+ depends on your openssl and openssl ruby extension version, but should
+ contain at least md5, sha1, md2, sha256.
+
+* --clean:
+ Remove all files related to a host from puppet cert's storage. This is
+ useful when rebuilding hosts, since new certificate signing requests
+ will only be honored if puppet cert does not have a copy of a signed
+ certificate for that host. The certificate of the host is also
+ revoked. If '--all' is specified then all host certificates, both
+ signed and unsigned, will be removed.
+
+* --debug:
+ Enable full debugging.
+
+* --generate:
+ Generate a certificate for a named client. A certificate/keypair will
+ be generated for each client named on the command line.
+
+* --help:
+ Print this help message
+
+* --list:
+ List outstanding certificate requests. If '--all' is specified, signed
+ certificates are also listed, prefixed by '+', and revoked or invalid
+ certificates are prefixed by '-' (the verification outcome is printed
+ in parenthesis).
+
+* --print:
+ Print the full-text version of a host's certificate.
+
+* --fingerprint:
+ Print the DIGEST (defaults to md5) fingerprint of a host's
+ certificate.
+
+* --revoke:
+ Revoke the certificate of a client. The certificate can be specified
+ either by its serial number, given as a decimal number or a
+ hexadecimal number prefixed by '0x', or by its hostname. The
+ certificate is revoked by adding it to the Certificate Revocation List
+ given by the 'cacrl' config parameter. Note that the puppetmasterd
+ needs to be restarted after revoking certificates.
+
+* --sign:
+ Sign an outstanding certificate request. Unless '--all' is specified,
+ hosts must be listed after all flags.
+
+* --verbose:
+ Enable verbosity.
+
+* --version:
+ Print the puppet version number and exit.
+
+* --verify:
+ Verify the named certificate against the local CA certificate.
+
+
+EXAMPLE
+-------
+ $ puppet cert -l
+ culain.madstop.com
+ $ puppet cert -s culain.madstop.com
+
+
+AUTHOR
+------
+Luke Kanies
+
+
+COPYRIGHT
+---------
+Copyright (c) 2005 Puppet Labs, LLC Licensed under the GNU Public
+License
+
+ HELP
+ exit
+ end
+
def main
if @all
hosts = :all
@@ -54,8 +179,8 @@ class Puppet::Application::Cert < Puppet::Application
hosts = command_line.args.collect { |h| h.downcase }
end
begin
- @ca.apply(:revoke, :to => hosts) if @cert_mode == :destroy
- @ca.apply(@cert_mode, :to => hosts, :digest => @digest)
+ @ca.apply(:revoke, :to => hosts) if subcommand == :destroy
+ @ca.apply(subcommand, :to => hosts, :digest => @digest)
rescue => detail
puts detail.backtrace if Puppet[:trace]
puts detail.to_s
@@ -64,11 +189,12 @@ class Puppet::Application::Cert < Puppet::Application
end
def setup
+ require 'puppet/ssl/certificate_authority'
exit(Puppet.settings.print_configs ? 0 : 1) if Puppet.settings.print_configs?
Puppet::Util::Log.newdestination :console
- if [:generate, :destroy].include? @cert_mode
+ if [:generate, :destroy].include? subcommand
Puppet::SSL::Host.ca_location = :local
else
Puppet::SSL::Host.ca_location = :only
@@ -82,4 +208,17 @@ class Puppet::Application::Cert < Puppet::Application
exit(23)
end
end
+
+ def parse_options
+ # handle the bareword subcommand pattern.
+ result = super
+ unless self.subcommand then
+ if sub = self.command_line.args.shift then
+ self.subcommand = sub
+ else
+ help
+ end
+ end
+ result
+ end
end
diff --git a/lib/puppet/application/describe.rb b/lib/puppet/application/describe.rb
index e76b347f6..79643159e 100644
--- a/lib/puppet/application/describe.rb
+++ b/lib/puppet/application/describe.rb
@@ -180,6 +180,60 @@ class Puppet::Application::Describe < Puppet::Application
option("--list", "-l")
option("--meta","-m")
+ def help
+ <<-HELP
+
+puppet-describe(8) -- Display help about resource types
+========
+
+SYNOPSIS
+--------
+Prints help about Puppet resource types, providers, and metaparameters.
+
+
+USAGE
+-----
+puppet describe [-h|--help] [-s|--short] [-p|--providers] [-l|--list] [-m|--meta]
+
+
+OPTIONS
+-------
+* --help:
+ Print this help text
+
+* --providers:
+ Describe providers in detail for each type
+
+* --list:
+ List all types
+
+* --meta:
+ List all metaparameters
+
+* --short:
+ List only parameters without detail
+
+
+EXAMPLE
+-------
+ $ puppet describe --list
+ $ puppet describe file --providers
+ $ puppet describe user -s -m
+
+
+AUTHOR
+------
+David Lutterkort
+
+
+COPYRIGHT
+---------
+Copyright (c) 2005 Puppet Labs, LLC Licensed under the GNU Public
+License
+
+ HELP
+ end
+
def preinit
options[:parameters] = true
end
diff --git a/lib/puppet/application/doc.rb b/lib/puppet/application/doc.rb
index aaefd6e75..74811919e 100644
--- a/lib/puppet/application/doc.rb
+++ b/lib/puppet/application/doc.rb
@@ -1,7 +1,6 @@
require 'puppet/application'
class Puppet::Application::Doc < Puppet::Application
-
should_not_parse_config
run_mode :master
@@ -50,6 +49,99 @@ class Puppet::Application::Doc < Puppet::Application
options[:references] << arg.intern
end
+ def help
+ <<-HELP
+
+puppet-doc(8) -- Generate Puppet documentation and references
+========
+
+SYNOPSIS
+--------
+Generates a reference for all Puppet types. Largely meant for internal
+Puppet Labs use.
+
+
+USAGE
+-----
+puppet doc [-a|--all] [-h|--help] [-o|--outputdir <rdoc-outputdir>]
+ [-m|--mode text|pdf|rdoc] [-r|--reference <reference-name>]
+ [--charset <charset>] [<manifest-file>]
+
+
+DESCRIPTION
+-----------
+If mode is not 'rdoc', then this command generates a Markdown document
+describing all installed Puppet types or all allowable arguments to
+puppet executables. It is largely meant for internal use and is used to
+generate the reference document available on the Puppet Labs web site.
+
+In 'rdoc' mode, this command generates an html RDoc hierarchy describing
+the manifests that 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 run with the name of a manifest file as an argument,
+puppet doc will output a single manifest's documentation on stdout.
+
+
+OPTIONS
+-------
+* --all:
+ Output the docs for all of the reference types. In 'rdoc'
+ modes, this also outputs documentation for all resources
+
+* --help:
+ Print this help message
+
+* --outputdir:
+ Specifies the directory where to output the rdoc
+ documentation in 'rdoc' mode.
+
+* --mode:
+ Determine the output mode. Valid modes are 'text', 'pdf' and
+ 'rdoc'. The 'pdf' mode creates PDF formatted files in the
+ /tmp directory. The default mode is 'text'. In 'rdoc' mode
+ you must provide 'manifests-path'
+
+* --reference:
+ Build a particular reference. Get a list of references by
+ running 'puppet doc --list'.
+
+* --charset:
+ Used only in 'rdoc' mode. It sets the charset used in the
+ html files produced.
+
+
+EXAMPLE
+-------
+ $ puppet doc -r type > /tmp/type_reference.markdown
+
+or
+
+ $ puppet doc --outputdir /tmp/rdoc --mode rdoc /path/to/manifests
+
+or
+
+ $ puppet doc /etc/puppet/manifests/site.pp
+
+or
+
+ $ puppet doc -m pdf -r configuration
+
+
+AUTHOR
+------
+Luke Kanies
+
+
+COPYRIGHT
+---------
+Copyright (c) 2005-2007 Puppet Labs, LLC Licensed under the GNU Public
+License
+
+HELP
+ end
+
def handle_unknown( opt, arg )
@unknown_args << {:opt => opt, :arg => arg }
true
@@ -70,11 +162,6 @@ class Puppet::Application::Doc < Puppet::Application
files += command_line.args
Puppet.info "scanning: #{files.inspect}"
- Puppet.settings.setdefaults(
- "puppetdoc",
-
- "document_all" => [false, "Document all resources"]
- )
Puppet.settings[:document_all] = options[:all] || false
begin
require 'puppet/util/rdoc'
diff --git a/lib/puppet/application/filebucket.rb b/lib/puppet/application/filebucket.rb
index 9c3c79bc3..063d97db8 100644
--- a/lib/puppet/application/filebucket.rb
+++ b/lib/puppet/application/filebucket.rb
@@ -12,6 +12,109 @@ class Puppet::Application::Filebucket < Puppet::Application
attr :args
+ def help
+ <<-HELP
+
+puppet-filebucket(8) -- Store and retrieve files in a filebucket
+========
+
+SYNOPSIS
+--------
+A stand-alone Puppet filebucket client.
+
+
+USAGE
+-----
+puppet filebucket <mode> [-h|--help] [-V|--version] [-d|--debug]
+ [-v|--verbose] [-l|--local] [-r|--remote] [-s|--server <server>]
+ [-b|--bucket <directory>] <file> <file> ...
+
+Puppet filebucket can operate in three modes, with only one mode per call:
+
+backup:
+ Send one or more files to the specified file bucket. Each sent file is
+ printed with its resulting md5 sum.
+
+get:
+ Return the text associated with an md5 sum. The text is printed to
+ stdout, and only one file can be retrieved at a time.
+
+restore:
+ Given a file path and an md5 sum, store the content associated with
+ the sum into the specified file path. You can specify an entirely new
+ path to this argument; you are not restricted to restoring the content
+ to its original location.
+
+
+DESCRIPTION
+-----------
+This is a stand-alone filebucket client for sending files to a local or
+central filebucket.
+
+Note that 'filebucket' defaults to using a network-based filebucket
+available on the server named 'puppet'. To use this, you'll have to be
+running as a user with valid Puppet certificates. Alternatively, you can
+use your local file bucket by specifying '--local'.
+
+
+OPTIONS
+-------
+Note that any configuration parameter that's valid in the configuration
+file is also a valid long argument. For example, 'ssldir' is a valid
+configuration parameter, so you can specify '--ssldir <directory>' as an
+argument.
+
+See the configuration file documentation at
+http://docs.puppetlabs.com/references/stable/configuration.html for the
+full list of acceptable parameters. A commented list of all
+configuration options can also be generated by running puppet with
+'--genconfig'.
+
+* --debug:
+ Enable full debugging.
+
+* --help:
+ Print this help message
+
+* --local:
+ Use the local filebucket. This will use the default configuration
+ information.
+
+* --remote:
+ Use a remote filebucket. This will use the default configuration
+ information.
+
+* --server:
+ The server to send the file to, instead of locally.
+
+* --verbose:
+ Print extra information.
+
+* --version:
+ Print version information.
+
+
+EXAMPLE
+-------
+ $ puppet filebucket backup /etc/passwd
+ /etc/passwd: 429b225650b912a2ee067b0a4cf1e949
+ $ puppet filebucket restore /tmp/passwd 429b225650b912a2ee067b0a4cf1e949
+
+
+AUTHOR
+------
+Luke Kanies
+
+
+COPYRIGHT
+---------
+Copyright (c) 2005 Puppet Labs, LLC Licensed under the GNU Public
+License
+
+ HELP
+ end
+
+
def run_command
@args = command_line.args
command = args.shift
@@ -52,7 +155,7 @@ class Puppet::Application::Filebucket < Puppet::Application
@client = nil
@server = nil
- trap(:INT) do
+ Signal.trap(:INT) do
$stderr.puts "Cancelling"
exit(1)
end
diff --git a/lib/puppet/application/inspect.rb b/lib/puppet/application/inspect.rb
index 19324e285..e448cb9e8 100644
--- a/lib/puppet/application/inspect.rb
+++ b/lib/puppet/application/inspect.rb
@@ -19,6 +19,62 @@ class Puppet::Application::Inspect < Puppet::Application
end
end
+ def help
+ <<-HELP
+
+puppet-inspect(8) -- Send an inspection report
+========
+
+SYNOPSIS
+--------
+
+Prepares and submits an inspection report to the puppet master.
+
+
+USAGE
+-----
+puppet inspect
+
+
+DESCRIPTION
+-----------
+
+This command uses the cached catalog from the previous run of 'puppet
+agent' to determine which attributes of which resources have been
+marked as auditable with the 'audit' metaparameter. It then examines
+the current state of the system, writes the state of the specified
+resource attributes to a report, and submits the report to the puppet
+master.
+
+Puppet inspect does not run as a daemon, and must be run manually or
+from cron.
+
+
+OPTIONS
+-------
+
+Any configuration setting which is valid in the configuration file is
+also a valid long argument, e.g. '--server=master.domain.com'. See the
+configuration file documentation at
+http://docs.puppetlabs.com/references/latest/configuration.html for
+the full list of acceptable settings.
+
+
+AUTHOR
+------
+
+Puppet Labs
+
+
+COPYRIGHT
+---------
+
+Copyright (c) 2011 Puppet Labs, LLC
+Licensed under the GNU General Public License version 2
+
+ HELP
+ end
+
def setup
exit(Puppet.settings.print_configs ? 0 : 1) if Puppet.settings.print_configs?
@@ -29,7 +85,7 @@ class Puppet::Application::Inspect < Puppet::Application
Puppet::Util::Log.newdestination(@report)
Puppet::Util::Log.newdestination(:console) unless options[:logset]
- trap(:INT) do
+ Signal.trap(:INT) do
$stderr.puts "Exiting"
exit(1)
end
@@ -45,79 +101,81 @@ class Puppet::Application::Inspect < Puppet::Application
end
def run_command
- retrieval_starttime = Time.now
+ benchmark(:notice, "Finished inspection") do
+ retrieval_starttime = Time.now
- unless catalog = Puppet::Resource::Catalog.indirection.find(Puppet[:certname])
- raise "Could not find catalog for #{Puppet[:certname]}"
- end
+ unless catalog = Puppet::Resource::Catalog.indirection.find(Puppet[:certname])
+ raise "Could not find catalog for #{Puppet[:certname]}"
+ end
- @report.configuration_version = catalog.version
+ @report.configuration_version = catalog.version
- inspect_starttime = Time.now
- @report.add_times("config_retrieval", inspect_starttime - retrieval_starttime)
+ inspect_starttime = Time.now
+ @report.add_times("config_retrieval", inspect_starttime - retrieval_starttime)
- if Puppet[:archive_files]
- dipper = Puppet::FileBucket::Dipper.new(:Server => Puppet[:archive_file_server])
- end
+ if Puppet[:archive_files]
+ dipper = Puppet::FileBucket::Dipper.new(:Server => Puppet[:archive_file_server])
+ end
- catalog.to_ral.resources.each do |ral_resource|
- audited_attributes = ral_resource[:audit]
- next unless audited_attributes
+ catalog.to_ral.resources.each do |ral_resource|
+ audited_attributes = ral_resource[:audit]
+ next unless audited_attributes
- status = Puppet::Resource::Status.new(ral_resource)
+ status = Puppet::Resource::Status.new(ral_resource)
- begin
- audited_resource = ral_resource.to_resource
- rescue StandardError => detail
- puts detail.backtrace if Puppet[:trace]
- ral_resource.err "Could not inspect #{ral_resource}; skipping: #{detail}"
- audited_attributes.each do |name|
- event = ral_resource.event(
- :property => name,
- :status => "failure",
- :audited => true,
- :message => "failed to inspect #{name}"
- )
- status.add_event(event)
- end
- else
- audited_attributes.each do |name|
- next if audited_resource[name].nil?
- # Skip :absent properties of :absent resources. Really, it would be nicer if the RAL returned nil for those, but it doesn't. ~JW
- if name == :ensure or audited_resource[:ensure] != :absent or audited_resource[name] != :absent
+ begin
+ audited_resource = ral_resource.to_resource
+ rescue StandardError => detail
+ puts detail.backtrace if Puppet[:trace]
+ ral_resource.err "Could not inspect #{ral_resource}; skipping: #{detail}"
+ audited_attributes.each do |name|
event = ral_resource.event(
- :previous_value => audited_resource[name],
- :property => name,
- :status => "audit",
- :audited => true,
- :message => "inspected value is #{audited_resource[name].inspect}"
- )
+ :property => name,
+ :status => "failure",
+ :audited => true,
+ :message => "failed to inspect #{name}"
+ )
status.add_event(event)
end
+ else
+ audited_attributes.each do |name|
+ next if audited_resource[name].nil?
+ # Skip :absent properties of :absent resources. Really, it would be nicer if the RAL returned nil for those, but it doesn't. ~JW
+ if name == :ensure or audited_resource[:ensure] != :absent or audited_resource[name] != :absent
+ event = ral_resource.event(
+ :previous_value => audited_resource[name],
+ :property => name,
+ :status => "audit",
+ :audited => true,
+ :message => "inspected value is #{audited_resource[name].inspect}"
+ )
+ status.add_event(event)
+ end
+ end
end
- end
- if Puppet[:archive_files] and ral_resource.type == :file and audited_attributes.include?(:content)
- path = ral_resource[:path]
- if File.readable?(path)
- begin
- dipper.backup(path)
- rescue StandardError => detail
- Puppet.warning detail
+ if Puppet[:archive_files] and ral_resource.type == :file and audited_attributes.include?(:content)
+ path = ral_resource[:path]
+ if File.readable?(path)
+ begin
+ dipper.backup(path)
+ rescue StandardError => detail
+ Puppet.warning detail
+ end
end
end
+ @report.add_resource_status(status)
end
- @report.add_resource_status(status)
- end
- finishtime = Time.now
- @report.add_times("inspect", finishtime - inspect_starttime)
- @report.finalize_report
+ finishtime = Time.now
+ @report.add_times("inspect", finishtime - inspect_starttime)
+ @report.finalize_report
- begin
- Puppet::Transaction::Report.indirection.save(@report)
- rescue => detail
- puts detail.backtrace if Puppet[:trace]
- Puppet.err "Could not send report: #{detail}"
+ begin
+ Puppet::Transaction::Report.indirection.save(@report)
+ rescue => detail
+ puts detail.backtrace if Puppet[:trace]
+ Puppet.err "Could not send report: #{detail}"
+ end
end
end
end
diff --git a/lib/puppet/application/kick.rb b/lib/puppet/application/kick.rb
index 12dad653a..604132818 100644
--- a/lib/puppet/application/kick.rb
+++ b/lib/puppet/application/kick.rb
@@ -37,6 +37,147 @@ class Puppet::Application::Kick < Puppet::Application
end
end
+ def help
+ <<-HELP
+
+puppet-kick(8) -- Remotely control puppet agent
+========
+
+SYNOPSIS
+--------
+Trigger a puppet agent run on a set of hosts.
+
+
+USAGE
+-----
+puppet kick [-a|--all] [-c|--class <class>] [-d|--debug] [-f|--foreground]
+ [-h|--help] [--host <host>] [--no-fqdn] [--ignoreschedules]
+ [-t|--tag <tag>] [--test] [-p|--ping] <host> [<host> [...]]
+
+
+DESCRIPTION
+-----------
+This script can be used to connect to a set of machines running 'puppet
+agent' and trigger them to run their configurations. The most common
+usage would be to specify a class of hosts and a set of tags, and
+'puppet kick' would look up in LDAP all of the hosts matching that
+class, then connect to each host and trigger a run of all of the objects
+with the specified tags.
+
+If you are not storing your host configurations in LDAP, you can specify
+hosts manually.
+
+You will most likely have to run 'puppet kick' as root to get access to
+the SSL certificates.
+
+'puppet kick' reads 'puppet master''s configuration file, so that it can
+copy things like LDAP settings.
+
+
+USAGE NOTES
+-----------
+'puppet kick' is useless unless 'puppet agent' is listening. See its
+documentation for more information, but the gist is that you must enable
+'listen' on the 'puppet agent' daemon, either using '--listen' on the
+command line or adding 'listen = true' in its config file. In addition,
+you need to set the daemons up to specifically allow connections by
+creating the 'namespaceauth' file, normally at
+'/etc/puppet/namespaceauth.conf'. This file specifies who has access to
+each namespace; if you create the file you must add every namespace you
+want any Puppet daemon to allow -- it is currently global to all Puppet
+daemons.
+
+An example file looks like this:
+
+ [fileserver]
+ allow *.madstop.com
+
+ [puppetmaster]
+ allow *.madstop.com
+
+ [puppetrunner]
+ allow culain.madstop.com
+
+This is what you would install on your Puppet master; non-master hosts
+could leave off the 'fileserver' and 'puppetmaster' namespaces.
+
+
+OPTIONS
+-------
+Note that any configuration parameter that's valid in the configuration
+file is also a valid long argument. For example, 'ssldir' is a valid
+configuration parameter, so you can specify '--ssldir <directory>' as an
+argument.
+
+See the configuration file documentation at
+http://docs.puppetlabs.com/references/latest/configuration.html for
+the full list of acceptable parameters. A commented list of all
+configuration options can also be generated by running puppet master
+with '--genconfig'.
+
+* --all:
+ Connect to all available hosts. Requires LDAP support at this point.
+
+* --class:
+ Specify a class of machines to which to connect. This only works if
+ you have LDAP configured, at the moment.
+
+* --debug:
+ Enable full debugging.
+
+* --foreground:
+ Run each configuration in the foreground; that is, when connecting to
+ a host, do not return until the host has finished its run. The default
+ is false.
+
+* --help:
+ Print this help message
+
+* --host:
+ A specific host to which to connect. This flag can be specified more
+ than once.
+
+* --ignoreschedules:
+ Whether the client should ignore schedules when running its
+ configuration. This can be used to force the client to perform work it
+ would not normally perform so soon. The default is false.
+
+* --parallel:
+ How parallel to make the connections. Parallelization is provided by
+ forking for each client to which to connect. The default is 1, meaning
+ serial execution.
+
+* --tag:
+ Specify a tag for selecting the objects to apply. Does not work with
+ the --test option.
+
+* --test:
+ Print the hosts you would connect to but do not actually connect. This
+ option requires LDAP support at this point.
+
+* --ping:
+ Do a ICMP echo against the target host. Skip hosts that don't respond
+ to ping.
+
+
+EXAMPLE
+-------
+ $ sudo puppet kick -p 10 -t remotefile -t webserver host1 host2
+
+
+AUTHOR
+------
+Luke Kanies
+
+
+COPYRIGHT
+---------
+Copyright (c) 2005 Puppet Labs, LLC Licensed under the GNU Public
+License
+
+ HELP
+ end
+
def run_command
@hosts += command_line.args
options[:test] ? test : main
@@ -151,7 +292,7 @@ class Puppet::Application::Kick < Puppet::Application
def preinit
[:INT, :TERM].each do |signal|
- trap(signal) do
+ Signal.trap(signal) do
$stderr.puts "Cancelling"
exit(1)
end
@@ -195,7 +336,7 @@ class Puppet::Application::Kick < Puppet::Application
# If we get a signal, then kill all of our children and get out.
[:INT, :TERM].each do |signal|
- trap(signal) do
+ Signal.trap(signal) do
Puppet.notice "Caught #{signal}; shutting down"
@children.each do |pid, host|
Process.kill("INT", pid)
diff --git a/lib/puppet/application/master.rb b/lib/puppet/application/master.rb
index 879b66c67..3bfad89f4 100644
--- a/lib/puppet/application/master.rb
+++ b/lib/puppet/application/master.rb
@@ -25,8 +25,94 @@ class Puppet::Application::Master < Puppet::Application
end
end
+ def help
+ <<-HELP
+
+puppet-master(8) -- The puppet master daemon
+========
+
+SYNOPSIS
+--------
+The central puppet server. Functions as a certificate authority by
+default.
+
+
+USAGE
+-----
+puppet master [-D|--daemonize|--no-daemonize] [-d|--debug] [-h|--help]
+ [-l|--logdest <file>|console|syslog] [-v|--verbose] [-V|--version]
+ [--compile <node-name>]
+
+
+DESCRIPTION
+-----------
+This command starts an instance of puppet master, running as a daemon
+and using Ruby's built-in Webrick webserver. Puppet master can also be
+managed by other application servers; when this is the case, this
+executable is not used.
+
+
+OPTIONS
+-------
+Note that any configuration parameter that's valid in the configuration
+file is also a valid long argument. For example, 'ssldir' is a valid
+configuration parameter, so you can specify '--ssldir <directory>' as an
+argument.
+
+See the configuration file documentation at
+http://docs.puppetlabs.com/references/stable/configuration.html for the
+full list of acceptable parameters. A commented list of all
+configuration options can also be generated by running puppet master
+with '--genconfig'.
+
+* --daemonize:
+ Send the process into the background. This is the default.
+
+* --no-daemonize:
+ Do not send the process into the background.
+
+* --debug:
+ Enable full debugging.
+
+* --help:
+ Print this help message.
+
+* --logdest:
+ Where to send messages. Choose between syslog, the console, and a log
+ file. Defaults to sending messages to syslog, or the console if
+ debugging or verbosity is enabled.
+
+* --verbose:
+ Enable verbosity.
+
+* --version:
+ Print the puppet version number and exit.
+
+* --compile:
+ Compile a catalogue and output it in JSON from the puppet master. Uses
+ facts contained in the $vardir/yaml/ directory to compile the catalog.
+
+
+EXAMPLE
+-------
+ puppet master
+
+
+AUTHOR
+------
+Luke Kanies
+
+
+COPYRIGHT
+---------
+Copyright (c) 2005 Puppet Labs, LLC Licensed under the GNU Public
+License
+
+ HELP
+ end
+
def preinit
- trap(:INT) do
+ Signal.trap(:INT) do
$stderr.puts "Cancelling startup"
exit(0)
end
diff --git a/lib/puppet/application/queue.rb b/lib/puppet/application/queue.rb
index b9e8ca4ca..de8aea32a 100644
--- a/lib/puppet/application/queue.rb
+++ b/lib/puppet/application/queue.rb
@@ -15,13 +15,13 @@ class Puppet::Application::Queue < Puppet::Application
# Do an initial trap, so that cancels don't get a stack trace.
# This exits with exit code 1
- trap(:INT) do
+ Signal.trap(:INT) do
$stderr.puts "Caught SIGINT; shutting down"
exit(1)
end
# This is a normal shutdown, so code 0
- trap(:TERM) do
+ Signal.trap(:TERM) do
$stderr.puts "Caught SIGTERM; shutting down"
exit(0)
end
@@ -37,6 +37,79 @@ class Puppet::Application::Queue < Puppet::Application
option("--debug","-d")
option("--verbose","-v")
+ def help
+ <<-HELP
+
+puppet-queue(8) -- Queuing daemon for asynchronous storeconfigs
+========
+
+SYNOPSIS
+--------
+Retrieves serialized storeconfigs records from a queue and processes
+them in order.
+
+
+USAGE
+-----
+puppet queue [-d|--debug] [-v|--verbose]
+
+
+DESCRIPTION
+-----------
+This application runs as a daemon and processes storeconfigs data,
+retrieving the data from a stomp server message queue and writing it to
+a database.
+
+For more information, including instructions for properly setting up
+your puppet master and message queue, see the documentation on setting
+up asynchronous storeconfigs at:
+http://projects.puppetlabs.com/projects/1/wiki/Using_Stored_Configuration
+
+
+OPTIONS
+-------
+Note that any configuration parameter that's valid in the configuration
+file is also a valid long argument. For example, 'server' is a valid
+configuration parameter, so you can specify '--server <servername>' as
+an argument.
+
+See the configuration file documentation at
+http://docs.puppetlabs.com/references/stable/configuration.html for the
+full list of acceptable parameters. A commented list of all
+configuration options can also be generated by running puppet queue with
+'--genconfig'.
+
+* --debug:
+ Enable full debugging.
+
+* --help:
+ Print this help message
+
+* --verbose:
+ Turn on verbose reporting.
+
+* --version:
+ Print the puppet version number and exit.
+
+
+EXAMPLE
+-------
+ $ puppet queue
+
+
+AUTHOR
+------
+Luke Kanies
+
+
+COPYRIGHT
+---------
+Copyright (c) 2009 Puppet Labs, LLC Licensed under the GNU Public
+License
+
+ HELP
+ end
+
def main
require 'puppet/indirector/catalog/queue' # provides Puppet::Indirector::Queue.subscribe
Puppet.notice "Starting puppetqd #{Puppet.version}"
diff --git a/lib/puppet/application/resource.rb b/lib/puppet/application/resource.rb
index c7c1c28be..3995c285b 100644
--- a/lib/puppet/application/resource.rb
+++ b/lib/puppet/application/resource.rb
@@ -35,6 +35,109 @@ class Puppet::Application::Resource < Puppet::Application
@extra_params << arg.to_sym
end
+ def help
+ <<-HELP
+
+puppet-resource(8) -- The resource abstraction layer shell
+========
+
+SYNOPSIS
+--------
+Uses the Puppet RAL to directly interact with the system.
+
+
+USAGE
+-----
+puppet resource [-h|--help] [-d|--debug] [-v|--verbose] [-e|--edit]
+ [-H|--host <host>] [-p|--param <parameter>] [-t|--types] <type>
+ [<name>] [<attribute>=<value> ...]
+
+
+DESCRIPTION
+-----------
+This command provides simple facilities for converting current system
+state into Puppet code, along with some ability to modify the current
+state using Puppet's RAL.
+
+By default, you must at least provide a type to list, in which case
+puppet resource will tell you everything it knows about all resources of
+that type. You can optionally specify an instance name, and puppet
+resource will only describe that single instance.
+
+If given a type, a name, and a series of <attribute>=<value> pairs,
+puppet resource will modify the state of the specified resource.
+Alternately, if given a type, a name, and the '--edit' flag, puppet
+resource will write its output to a file, open that file in an editor,
+and then apply the saved file as a Puppet transaction.
+
+
+OPTIONS
+-------
+Note that any configuration parameter that's valid in the configuration
+file is also a valid long argument. For example, 'ssldir' is a valid
+configuration parameter, so you can specify '--ssldir <directory>' as an
+argument.
+
+See the configuration file documentation at
+http://docs.puppetlabs.com/references/stable/configuration.html for the
+full list of acceptable parameters. A commented list of all
+configuration options can also be generated by running puppet with
+'--genconfig'.
+
+* --debug:
+ Enable full debugging.
+
+* --edit:
+ Write the results of the query to a file, open the file in an editor,
+ and read the file back in as an executable Puppet manifest.
+
+* --host:
+ When specified, connect to the resource server on the named host
+ and retrieve the list of resouces of the type specified.
+
+* --help:
+ Print this help message.
+
+* --param:
+ Add more parameters to be outputted from queries.
+
+* --types:
+ List all available types.
+
+* --verbose:
+ Print extra information.
+
+
+EXAMPLE
+-------
+This example uses `puppet resource` to return a Puppet configuration for
+the user `luke`:
+
+ $ puppet resource user luke
+ user { 'luke':
+ home => '/home/luke',
+ uid => '100',
+ ensure => 'present',
+ comment => 'Luke Kanies,,,',
+ gid => '1000',
+ shell => '/bin/bash',
+ groups => ['sysadmin','audio','video','puppet']
+ }
+
+
+AUTHOR
+------
+Luke Kanies
+
+
+COPYRIGHT
+---------
+Copyright (c) 2005-2007 Puppet Labs, LLC Licensed under the GNU Public
+License
+
+ HELP
+ end
+
def main
args = command_line.args
type = args.shift or raise "You must specify the type to display"
diff --git a/lib/puppet/configurer/downloader.rb b/lib/puppet/configurer/downloader.rb
index 1b587ed4b..b3696201a 100644
--- a/lib/puppet/configurer/downloader.rb
+++ b/lib/puppet/configurer/downloader.rb
@@ -50,6 +50,7 @@ class Puppet::Configurer::Downloader
def catalog
catalog = Puppet::Resource::Catalog.new
+ catalog.host_config = false
catalog.add_resource(file)
catalog
end
diff --git a/lib/puppet/configurer/plugin_handler.rb b/lib/puppet/configurer/plugin_handler.rb
index cfc6b5a0b..ae088f26f 100644
--- a/lib/puppet/configurer/plugin_handler.rb
+++ b/lib/puppet/configurer/plugin_handler.rb
@@ -9,7 +9,14 @@ module Puppet::Configurer::PluginHandler
# Retrieve facts from the central server.
def download_plugins
return nil unless download_plugins?
- Puppet::Configurer::Downloader.new("plugin", Puppet[:plugindest], Puppet[:pluginsource], Puppet[:pluginsignore]).evaluate.each { |file| load_plugin(file) }
+ plugin_downloader = Puppet::Configurer::Downloader.new(
+ "plugin",
+ Puppet[:plugindest],
+ Puppet[:pluginsource],
+ Puppet[:pluginsignore]
+ )
+
+ plugin_downloader.evaluate.each { |file| load_plugin(file) }
end
def load_plugin(file)
diff --git a/lib/puppet/daemon.rb b/lib/puppet/daemon.rb
index c76d63a54..22630ffb8 100755
--- a/lib/puppet/daemon.rb
+++ b/lib/puppet/daemon.rb
@@ -95,7 +95,7 @@ class Puppet::Daemon
# extended signals not supported under windows
signals.update({:HUP => :restart, :USR1 => :reload, :USR2 => :reopen_logs }) unless Puppet.features.microsoft_windows?
signals.each do |signal, method|
- trap(signal) do
+ Signal.trap(signal) do
Puppet.notice "Caught #{signal}; calling #{method}"
send(method)
end
diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb
index e3b86bca4..f308d4476 100644
--- a/lib/puppet/defaults.rb
+++ b/lib/puppet/defaults.rb
@@ -14,7 +14,11 @@ module Puppet
setdefaults(:main,
:trace => [false, "Whether to print stack traces on some errors"],
- :autoflush => [false, "Whether log files should always flush to disk."],
+ :autoflush => {
+ :default => false,
+ :desc => "Whether log files should always flush to disk.",
+ :hook => proc { |value| Log.autoflush = value }
+ },
:syslogfacility => ["daemon", "What syslog facility to use when logging to
syslog. Syslog has a fixed list of valid facilities, and you must
choose one of those; you cannot just make one up."],
@@ -818,4 +822,8 @@ module Puppet
directories."
]
)
+ setdefaults(
+ :puppetdoc,
+ :document_all => [false, "Document all resources"]
+ )
end
diff --git a/lib/puppet/external/nagios.rb b/lib/puppet/external/nagios.rb
index 6b8852ee5..2ed829198 100755
--- a/lib/puppet/external/nagios.rb
+++ b/lib/puppet/external/nagios.rb
@@ -3,8 +3,6 @@
#--------------------
# A script to retrieve hosts from ldap and create an importable
# cfservd file from them
-#
-# $Id: nagios.rb,v 1.3 2004/06/09 20:32:46 luke Exp $
require 'digest/md5'
#require 'ldap'
diff --git a/lib/puppet/external/nagios/base.rb b/lib/puppet/external/nagios/base.rb
index ac1d25e2e..e98760e01 100755
--- a/lib/puppet/external/nagios/base.rb
+++ b/lib/puppet/external/nagios/base.rb
@@ -470,5 +470,3 @@ class Nagios::Base
end
end
-
-# $Id$
diff --git a/lib/puppet/file_bucket/dipper.rb b/lib/puppet/file_bucket/dipper.rb
index be487d83f..d6f6a3747 100644
--- a/lib/puppet/file_bucket/dipper.rb
+++ b/lib/puppet/file_bucket/dipper.rb
@@ -34,11 +34,12 @@ class Puppet::FileBucket::Dipper
contents = ::File.read(file)
begin
file_bucket_file = Puppet::FileBucket::File.new(contents, :bucket_path => @local_path)
- dest_path = "#{@rest_path}#{file_bucket_file.name}"
+ files_original_path = absolutize_path(file)
+ dest_path = "#{@rest_path}#{file_bucket_file.name}#{files_original_path}"
# Make a HEAD request for the file so that we don't waste time
# uploading it if it already exists in the bucket.
- unless Puppet::FileBucket::File.indirection.head("#{@rest_path}#{file_bucket_file.checksum_type}/#{file_bucket_file.checksum_data}")
+ unless Puppet::FileBucket::File.indirection.head("#{@rest_path}#{file_bucket_file.checksum_type}/#{file_bucket_file.checksum_data}#{files_original_path}")
Puppet::FileBucket::File.indirection.save(file_bucket_file, dest_path)
end
diff --git a/lib/puppet/indirector/facts/inventory_active_record.rb b/lib/puppet/indirector/facts/inventory_active_record.rb
new file mode 100644
index 000000000..db4c63f00
--- /dev/null
+++ b/lib/puppet/indirector/facts/inventory_active_record.rb
@@ -0,0 +1,97 @@
+require 'puppet/rails'
+require 'puppet/rails/inventory_node'
+require 'puppet/rails/inventory_fact'
+require 'puppet/indirector/active_record'
+
+class Puppet::Node::Facts::InventoryActiveRecord < Puppet::Indirector::ActiveRecord
+ def find(request)
+ node = Puppet::Rails::InventoryNode.find_by_name(request.key)
+ return nil unless node
+ facts = Puppet::Node::Facts.new(node.name, node.facts_to_hash)
+ facts.timestamp = node.timestamp
+ facts
+ end
+
+ def save(request)
+ facts = request.instance
+ node = Puppet::Rails::InventoryNode.find_by_name(request.key) || Puppet::Rails::InventoryNode.create(:name => request.key, :timestamp => facts.timestamp)
+ node.timestamp = facts.timestamp
+
+ ActiveRecord::Base.transaction do
+ Puppet::Rails::InventoryFact.delete_all(:node_id => node.id)
+ # We don't want to save internal values as facts, because those are
+ # metadata that belong on the node
+ facts.values.each do |name,value|
+ next if name.to_s =~ /^_/
+ node.facts.build(:name => name, :value => value)
+ end
+ node.save
+ end
+ end
+
+ def search(request)
+ return [] unless request.options
+ matching_nodes = []
+ fact_names = []
+ fact_filters = Hash.new {|h,k| h[k] = []}
+ meta_filters = Hash.new {|h,k| h[k] = []}
+ request.options.each do |key,value|
+ type, name, operator = key.to_s.split(".")
+ operator ||= "eq"
+ if type == "facts"
+ fact_filters[operator] << [name,value]
+ elsif type == "meta" and name == "timestamp"
+ meta_filters[operator] << [name,value]
+ end
+ end
+
+ matching_nodes = nodes_matching_fact_filters(fact_filters) + nodes_matching_meta_filters(meta_filters)
+
+ # to_a because [].inject == nil
+ matching_nodes.inject {|nodes,this_set| nodes & this_set}.to_a.sort
+ end
+
+ private
+
+ def nodes_matching_fact_filters(fact_filters)
+ node_sets = []
+ fact_filters['eq'].each do |name,value|
+ node_sets << Puppet::Rails::InventoryNode.has_fact_with_value(name,value).map {|node| node.name}
+ end
+ fact_filters['ne'].each do |name,value|
+ node_sets << Puppet::Rails::InventoryNode.has_fact_without_value(name,value).map {|node| node.name}
+ end
+ {
+ 'gt' => '>',
+ 'lt' => '<',
+ 'ge' => '>=',
+ 'le' => '<='
+ }.each do |operator_name,operator|
+ fact_filters[operator_name].each do |name,value|
+ facts = Puppet::Rails::InventoryFact.find_by_sql(["SELECT inventory_facts.value, inventory_nodes.name AS node_name
+ FROM inventory_facts INNER JOIN inventory_nodes
+ ON inventory_facts.node_id = inventory_nodes.id
+ WHERE inventory_facts.name = ?", name])
+ node_sets << facts.select {|fact| fact.value.to_f.send(operator, value.to_f)}.map {|fact| fact.node_name}
+ end
+ end
+ node_sets
+ end
+
+ def nodes_matching_meta_filters(meta_filters)
+ node_sets = []
+ {
+ 'eq' => '=',
+ 'ne' => '!=',
+ 'gt' => '>',
+ 'lt' => '<',
+ 'ge' => '>=',
+ 'le' => '<='
+ }.each do |operator_name,operator|
+ meta_filters[operator_name].each do |name,value|
+ node_sets << Puppet::Rails::InventoryNode.find(:all, :select => "name", :conditions => ["timestamp #{operator} ?", value]).map {|node| node.name}
+ end
+ end
+ node_sets
+ end
+end
diff --git a/lib/puppet/indirector/facts/yaml.rb b/lib/puppet/indirector/facts/yaml.rb
index 89feaf2ab..65bd78354 100644
--- a/lib/puppet/indirector/facts/yaml.rb
+++ b/lib/puppet/indirector/facts/yaml.rb
@@ -4,4 +4,79 @@ require 'puppet/indirector/yaml'
class Puppet::Node::Facts::Yaml < Puppet::Indirector::Yaml
desc "Store client facts as flat files, serialized using YAML, or
return deserialized facts from disk."
+
+ def search(request)
+ node_names = []
+ Dir.glob(yaml_dir_path).each do |file|
+ facts = YAML.load_file(file)
+ node_names << facts.name if node_matches?(facts, request.options)
+ end
+ node_names
+ end
+
+ private
+
+ # Return the path to a given node's file.
+ def yaml_dir_path
+ base = Puppet.run_mode.master? ? Puppet[:yamldir] : Puppet[:clientyamldir]
+ File.join(base, 'facts', '*.yaml')
+ end
+
+ def node_matches?(facts, options)
+ options.each do |key, value|
+ type, name, operator = key.to_s.split(".")
+ operator ||= 'eq'
+
+ return false unless node_matches_option?(type, name, operator, value, facts)
+ end
+ return true
+ end
+
+ def node_matches_option?(type, name, operator, value, facts)
+ case type
+ when "meta"
+ case name
+ when "timestamp"
+ compare_timestamp(operator, facts.timestamp, Time.parse(value))
+ end
+ when "facts"
+ compare_facts(operator, facts.values[name], value)
+ end
+ end
+
+ def compare_facts(operator, value1, value2)
+ return false unless value1
+
+ case operator
+ when "eq"
+ value1.to_s == value2.to_s
+ when "le"
+ value1.to_f <= value2.to_f
+ when "ge"
+ value1.to_f >= value2.to_f
+ when "lt"
+ value1.to_f < value2.to_f
+ when "gt"
+ value1.to_f > value2.to_f
+ when "ne"
+ value1.to_s != value2.to_s
+ end
+ end
+
+ def compare_timestamp(operator, value1, value2)
+ case operator
+ when "eq"
+ value1 == value2
+ when "le"
+ value1 <= value2
+ when "ge"
+ value1 >= value2
+ when "lt"
+ value1 < value2
+ when "gt"
+ value1 > value2
+ when "ne"
+ value1 != value2
+ end
+ end
end
diff --git a/lib/puppet/indirector/file_bucket_file/file.rb b/lib/puppet/indirector/file_bucket_file/file.rb
index 8bea2d767..0fd8a914f 100644
--- a/lib/puppet/indirector/file_bucket_file/file.rb
+++ b/lib/puppet/indirector/file_bucket_file/file.rb
@@ -14,10 +14,12 @@ module Puppet::FileBucketFile
end
def find( request )
- checksum = request_to_checksum( request )
- file_path = path_for(request.options[:bucket_path], checksum, 'contents')
+ checksum, files_original_path = request_to_checksum_and_path( request )
+ dir_path = path_for(request.options[:bucket_path], checksum)
+ file_path = ::File.join(dir_path, 'contents')
return nil unless ::File.exists?(file_path)
+ return nil unless path_match(dir_path, files_original_path)
if request.options[:diff_with]
hash_protocol = sumtype(checksum)
@@ -32,32 +34,47 @@ module Puppet::FileBucketFile
end
def head(request)
- checksum = request_to_checksum(request)
- file_path = path_for(request.options[:bucket_path], checksum, 'contents')
- ::File.exists?(file_path)
+ checksum, files_original_path = request_to_checksum_and_path(request)
+ dir_path = path_for(request.options[:bucket_path], checksum)
+
+ ::File.exists?(::File.join(dir_path, 'contents')) and path_match(dir_path, files_original_path)
end
def save( request )
instance = request.instance
+ checksum, files_original_path = request_to_checksum_and_path(request)
- save_to_disk(instance)
+ save_to_disk(instance, files_original_path)
instance.to_s
end
private
- def save_to_disk( bucket_file )
+ def path_match(dir_path, files_original_path)
+ return true unless files_original_path # if no path was provided, it's a match
+ paths_path = ::File.join(dir_path, 'paths')
+ return false unless ::File.exists?(paths_path)
+ ::File.open(paths_path) do |f|
+ f.each do |line|
+ return true if line.chomp == files_original_path
+ end
+ end
+ return false
+ end
+
+ def save_to_disk( bucket_file, files_original_path )
filename = path_for(bucket_file.bucket_path, bucket_file.checksum_data, 'contents')
- dirname = path_for(bucket_file.bucket_path, bucket_file.checksum_data)
+ dir_path = path_for(bucket_file.bucket_path, bucket_file.checksum_data)
+ paths_path = ::File.join(dir_path, 'paths')
# If the file already exists, do nothing.
if ::File.exist?(filename)
verify_identical_file!(bucket_file)
else
# Make the directories if necessary.
- unless ::File.directory?(dirname)
+ unless ::File.directory?(dir_path)
Puppet::Util.withumask(0007) do
- ::FileUtils.mkdir_p(dirname)
+ ::FileUtils.mkdir_p(dir_path)
end
end
@@ -68,15 +85,27 @@ module Puppet::FileBucketFile
::File.open(filename, ::File::WRONLY|::File::CREAT, 0440) do |of|
of.print bucket_file.contents
end
+ ::File.open(paths_path, ::File::WRONLY|::File::CREAT, 0640) do |of|
+ # path will be written below
+ end
+ end
+ end
+
+ unless path_match(dir_path, files_original_path)
+ ::File.open(paths_path, 'a') do |f|
+ f.puts(files_original_path)
end
end
end
- def request_to_checksum( request )
- checksum_type, checksum, path = request.key.split(/\//, 3) # Note: we ignore path if present.
+ def request_to_checksum_and_path( request )
+ checksum_type, checksum, path = request.key.split(/\//, 3)
+ if path == '' # Treat "md5/<checksum>/" like "md5/<checksum>"
+ path = nil
+ end
raise "Unsupported checksum type #{checksum_type.inspect}" if checksum_type != 'md5'
raise "Invalid checksum #{checksum.inspect}" if checksum !~ /^[0-9a-f]{32}$/
- checksum
+ [checksum, path]
end
def path_for(bucket_path, digest, subfile = nil)
diff --git a/lib/puppet/module.rb b/lib/puppet/module.rb
index 8da19c2ce..43266b2b5 100644
--- a/lib/puppet/module.rb
+++ b/lib/puppet/module.rb
@@ -191,7 +191,7 @@ class Puppet::Module
def backward_compatible_plugins_dir
if dir = File.join(path, "plugins") and FileTest.exist?(dir)
- warning "using the deprecated 'plugins' directory for ruby extensions; please move to 'lib'"
+ Puppet.warning "using the deprecated 'plugins' directory for ruby extensions; please move to 'lib'"
return dir
else
return File.join(path, "lib")
diff --git a/lib/puppet/network/http/api/v1.rb b/lib/puppet/network/http/api/v1.rb
index 4b7c15a36..dcb0e0a22 100644
--- a/lib/puppet/network/http/api/v1.rb
+++ b/lib/puppet/network/http/api/v1.rb
@@ -63,9 +63,9 @@ module Puppet::Network::HTTP::API::V1
return :singular if indirection == "status"
return :plural if indirection == "inventory"
- result = (indirection =~ /s$/) ? :plural : :singular
+ result = (indirection =~ /s$|_search$/) ? :plural : :singular
- indirection.sub!(/s$/, '') if result
+ indirection.sub!(/s$|_search$|es$/, '')
result
end
diff --git a/lib/puppet/network/http/compression.rb b/lib/puppet/network/http/compression.rb
index d9b56f184..c8d001169 100644
--- a/lib/puppet/network/http/compression.rb
+++ b/lib/puppet/network/http/compression.rb
@@ -75,7 +75,10 @@ module Puppet::Network::HTTP::Compression
# in this case, we try with a verbatim (no header)
# deflater.
@uncompressor = Zlib::Inflate.new
- retry if @first
+ if @first then
+ @first = false
+ retry
+ end
raise
end
diff --git a/lib/puppet/network/http/rack/rest.rb b/lib/puppet/network/http/rack/rest.rb
index b7e1d9709..602927a78 100644
--- a/lib/puppet/network/http/rack/rest.rb
+++ b/lib/puppet/network/http/rack/rest.rb
@@ -76,9 +76,7 @@ class Puppet::Network::HTTP::RackREST < Puppet::Network::HTTP::RackHttpHandler
# request.body has some limitiations, so we need to concat it back
# into a regular string, which is something puppet can use.
def body(request)
- body = ''
- request.body.each { |part| body += part }
- body
+ request.body.read
end
def extract_client_info(request)
diff --git a/lib/puppet/network/rest_authconfig.rb b/lib/puppet/network/rest_authconfig.rb
index 9e3632499..cf76978fe 100644
--- a/lib/puppet/network/rest_authconfig.rb
+++ b/lib/puppet/network/rest_authconfig.rb
@@ -61,7 +61,7 @@ module Puppet
def insert_default_acl
DEFAULT_ACL.each do |acl|
unless rights[acl[:acl]]
- Puppet.info "Inserting default '#{acl[:acl]}'(#{acl[:authenticated] ? "auth" : "non-auth"}) acl because #{( !exists? ? "#{Puppet[:rest_authconfig]} doesn't exist" : "none where found in '#{@file}'")}"
+ Puppet.info "Inserting default '#{acl[:acl]}'(#{acl[:authenticated] ? "auth" : "non-auth"}) ACL because #{( !exists? ? "#{Puppet[:rest_authconfig]} doesn't exist" : "none were found in '#{@file}'")}"
mk_acl(acl)
end
end
diff --git a/lib/puppet/network/rights.rb b/lib/puppet/network/rights.rb
index 56af53983..6fde181c9 100755
--- a/lib/puppet/network/rights.rb
+++ b/lib/puppet/network/rights.rb
@@ -83,7 +83,7 @@ class Rights
else
# there were no rights allowing/denying name
# if name is not a path, let's throw
- raise ArgumentError.new "Unknown namespace right '#{name}'"
+ raise ArgumentError, "Unknown namespace right '#{name}'"
end
error
end
diff --git a/lib/puppet/node/facts.rb b/lib/puppet/node/facts.rb
index 451813f7d..577b62b62 100755
--- a/lib/puppet/node/facts.rb
+++ b/lib/puppet/node/facts.rb
@@ -61,7 +61,7 @@ class Puppet::Node::Facts
def self.from_pson(data)
result = new(data['name'], data['values'])
- result.values[:_timestamp] = Time.parse(data['timestamp'])
+ result.timestamp = Time.parse(data['timestamp'])
result.expiration = Time.parse(data['expiration'])
result
end
@@ -70,8 +70,8 @@ class Puppet::Node::Facts
{
'expiration' => expiration,
'name' => name,
- 'timestamp' => values[:_timestamp],
- 'values' => values.reject {|k,v| k == :_timestamp},
+ 'timestamp' => timestamp,
+ 'values' => strip_internal,
}.to_pson(*args)
end
diff --git a/lib/puppet/parser/ast/collection.rb b/lib/puppet/parser/ast/collection.rb
index ef36b7143..565b83195 100644
--- a/lib/puppet/parser/ast/collection.rb
+++ b/lib/puppet/parser/ast/collection.rb
@@ -16,6 +16,7 @@ class Puppet::Parser::AST
str, code = query && query.safeevaluate(scope)
resource_type = scope.find_resource_type(@type)
+ fail "Resource type #{@type} doesn't exist" unless resource_type
newcoll = Puppet::Parser::Collector.new(scope, resource_type.name, str, code, self.form)
scope.compiler.add_collection(newcoll)
@@ -26,10 +27,10 @@ class Puppet::Parser::AST
params = @override.collect { |param| param.safeevaluate(scope) }
newcoll.add_override(
:parameters => params,
- :file => @file,
- :line => @line,
- :source => scope.source,
- :scope => scope
+ :file => @file,
+ :line => @line,
+ :source => scope.source,
+ :scope => scope
)
end
diff --git a/lib/puppet/parser/ast/leaf.rb b/lib/puppet/parser/ast/leaf.rb
index fcdd219d7..77617e992 100644
--- a/lib/puppet/parser/ast/leaf.rb
+++ b/lib/puppet/parser/ast/leaf.rb
@@ -67,7 +67,7 @@ class Puppet::Parser::AST
end
def to_s
- "concat(#{@value.join(',')})"
+ "#{@value.map { |s| s.to_s.gsub(/^"(.*)"$/, '\1') }.join}"
end
end
diff --git a/lib/puppet/parser/functions/regsubst.rb b/lib/puppet/parser/functions/regsubst.rb
index f655db7b3..b6bb5afcf 100644
--- a/lib/puppet/parser/functions/regsubst.rb
+++ b/lib/puppet/parser/functions/regsubst.rb
@@ -4,25 +4,18 @@ module Puppet::Parser::Functions
:regsubst, :type => :rvalue,
:doc => "
- Perform regexp replacement on a string or array of strings.
+Perform regexp replacement on a string or array of strings.
* *Parameters* (in order):
-
- _target_ The string or array of strings to operate on. If an array, the replacement will be performed on each of the elements in the array, and the return value will be an array.
-
- _regexp_ The regular expression matching the target string. If you want it anchored at the start and or end of the string, you must do that with ^ and $ yourself.
-
- _replacement_ Replacement string. Can contain back references to what was matched using \\0, \\1, and so on.
-
- _flags_ Optional. String of single letter flags for how the regexp is interpreted:
-
+ * _target_ The string or array of strings to operate on. If an array, the replacement will be performed on each of the elements in the array, and the return value will be an array.
+ * _regexp_ The regular expression matching the target string. If you want it anchored at the start and or end of the string, you must do that with ^ and $ yourself.
+ * _replacement_ Replacement string. Can contain backreferences to what was matched using \\0 (whole match), \\1 (first set of parentheses), and so on.
+ * _flags_ Optional. String of single letter flags for how the regexp is interpreted:
- *E* Extended regexps
- *I* Ignore case in regexps
- *M* Multiline regexps
- *G* Global replacement; all occurrences of the regexp in each target 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:
-
+ * _encoding_ Optional. How to handle multibyte characters. A single-character string with the following values:
- *N* None
- *E* EUC
- *S* SJIS
@@ -32,7 +25,7 @@ module Puppet::Parser::Functions
Get the third octet from the node's IP address:
- $i3 = regsubst($ipaddress,'^([0-9]+)[.]([0-9]+)[.]([0-9]+)[.]([0-9]+)$','\\3')
+ $i3 = regsubst($ipaddress,'^(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)$','\\3')
Put angle brackets around each octet in the node's IP address:
diff --git a/lib/puppet/parser/functions/split.rb b/lib/puppet/parser/functions/split.rb
index 52394095a..ad027865b 100644
--- a/lib/puppet/parser/functions/split.rb
+++ b/lib/puppet/parser/functions/split.rb
@@ -6,21 +6,21 @@ module Puppet::Parser::Functions
:doc => "\
Split a string variable into an array using the specified split regexp.
- Usage:
+*Example:*
$string = 'v1.v2:v3.v4'
$array_var1 = split($string, ':')
$array_var2 = split($string, '[.]')
$array_var3 = split($string, '[.:]')
-$array_var1 now holds the result ['v1.v2', 'v3.v4'],
-while $array_var2 holds ['v1', 'v2:v3', 'v4'], and
-$array_var3 holds ['v1', 'v2', 'v3', 'v4'].
+`$array_var1` now holds the result `['v1.v2', 'v3.v4']`,
+while `$array_var2` holds `['v1', 'v2:v3', 'v4']`, and
+`$array_var3` holds `['v1', 'v2', 'v3', 'v4']`.
-Note that in the second example, we split on a string that contains
-a regexp meta-character (.), and that needs protection. A simple
+Note that in the second example, we split on a literal string that contains
+a regexp meta-character (.), which must be escaped. A simple
way to do that for a single character is to enclose it in square
-brackets.") do |args|
+brackets; a backslash will also escape a single character.") do |args|
raise Puppet::ParseError, ("split(): wrong number of arguments (#{args.length}; must be 2)") if args.length != 2
diff --git a/lib/puppet/parser/grammar.ra b/lib/puppet/parser/grammar.ra
index ecb27f363..8339c51b7 100644
--- a/lib/puppet/parser/grammar.ra
+++ b/lib/puppet/parser/grammar.ra
@@ -574,6 +574,7 @@ selectlhand: name
| funcrvalue
| boolean
| undef
+ | hasharrayaccess
| DEFAULT {
result = ast AST::Default, :value => val[0][:value], :line => val[0][:line]
}
@@ -767,7 +768,7 @@ hasharrayaccess: VARIABLE LBRACK rvalue RBRACK {
}
hasharrayaccesses: hasharrayaccess
- | hasharrayaccess LBRACK rvalue RBRACK {
+ | hasharrayaccesses LBRACK rvalue RBRACK {
result = ast AST::HashOrArrayAccess, :variable => val[0], :key => val[2]
}
@@ -793,6 +794,3 @@ require 'puppet/parser/parser_support'
# Local Variables:
# mode: ruby
# End:
-
-# $Id$
-
diff --git a/lib/puppet/parser/lexer.rb b/lib/puppet/parser/lexer.rb
index 31d39ae2f..9a25263f6 100644
--- a/lib/puppet/parser/lexer.rb
+++ b/lib/puppet/parser/lexer.rb
@@ -476,9 +476,12 @@ class Puppet::Parser::Lexer
@expected.pop
end
- if final_token.name == :LBRACE
+ if final_token.name == :LBRACE or final_token.name == :LPAREN
commentpush
end
+ if final_token.name == :RPAREN
+ commentpop
+ end
yield [final_token.name, token_value]
diff --git a/lib/puppet/parser/parser.rb b/lib/puppet/parser/parser.rb
index 60b272e76..300ddddd6 100644
--- a/lib/puppet/parser/parser.rb
+++ b/lib/puppet/parser/parser.rb
@@ -1,11 +1,10 @@
#
# DO NOT MODIFY!!!!
-# This file is automatically generated by racc 1.4.5
-# from racc grammer file "grammar.ra".
+# This file is automatically generated by Racc 1.4.6
+# from Racc grammer file "".
#
-require 'racc/parser'
-
+require 'racc/parser.rb'
require 'puppet'
require 'puppet/util/loadedfile'
@@ -18,14 +17,11 @@ module Puppet
class AlreadyImportedError < ImportError; end
end
-
module Puppet
-
module Parser
-
class Parser < Racc::Parser
-module_eval <<'..end grammar.ra modeval..id6362f948d9', 'grammar.ra', 788
+module_eval(<<'...end grammar.ra/module_eval...', 'grammar.ra', 789)
# It got too annoying having code in a file that needs to be compiled.
require 'puppet/parser/parser_support'
@@ -34,1328 +30,1341 @@ require 'puppet/parser/parser_support'
# Local Variables:
# mode: ruby
# End:
-
-# $Id$
-
-..end grammar.ra modeval..id6362f948d9
-
-##### racc 1.4.5 generates ###
-
-racc_reduce_table = [
- 0, 0, :racc_error,
- 1, 70, :_reduce_none,
- 1, 70, :_reduce_none,
- 1, 71, :_reduce_3,
- 2, 71, :_reduce_4,
- 1, 74, :_reduce_5,
- 1, 73, :_reduce_none,
- 1, 73, :_reduce_none,
- 1, 73, :_reduce_none,
- 1, 73, :_reduce_none,
- 1, 73, :_reduce_none,
- 1, 73, :_reduce_none,
- 1, 73, :_reduce_none,
- 1, 73, :_reduce_none,
- 1, 73, :_reduce_none,
- 1, 73, :_reduce_none,
- 1, 73, :_reduce_none,
- 1, 73, :_reduce_none,
- 1, 73, :_reduce_none,
- 1, 73, :_reduce_none,
- 3, 88, :_reduce_20,
- 3, 88, :_reduce_21,
- 1, 89, :_reduce_none,
- 1, 89, :_reduce_none,
- 1, 89, :_reduce_none,
- 1, 90, :_reduce_none,
- 1, 90, :_reduce_none,
- 1, 90, :_reduce_none,
- 1, 90, :_reduce_none,
- 4, 82, :_reduce_29,
- 5, 82, :_reduce_30,
- 3, 82, :_reduce_31,
- 2, 82, :_reduce_32,
- 1, 92, :_reduce_33,
- 1, 92, :_reduce_34,
- 3, 92, :_reduce_35,
- 3, 92, :_reduce_36,
- 1, 93, :_reduce_none,
- 1, 93, :_reduce_none,
- 1, 93, :_reduce_none,
- 1, 93, :_reduce_none,
- 1, 93, :_reduce_none,
- 1, 93, :_reduce_none,
- 1, 93, :_reduce_none,
- 1, 93, :_reduce_none,
- 1, 93, :_reduce_45,
- 5, 75, :_reduce_46,
- 5, 75, :_reduce_47,
- 5, 75, :_reduce_48,
- 5, 86, :_reduce_49,
- 2, 76, :_reduce_50,
- 1, 109, :_reduce_51,
- 2, 109, :_reduce_52,
- 6, 77, :_reduce_53,
- 2, 77, :_reduce_54,
- 3, 110, :_reduce_55,
- 3, 110, :_reduce_56,
- 1, 111, :_reduce_none,
- 1, 111, :_reduce_none,
- 3, 111, :_reduce_59,
- 1, 112, :_reduce_none,
- 3, 112, :_reduce_61,
- 1, 113, :_reduce_62,
- 1, 113, :_reduce_63,
- 3, 114, :_reduce_64,
- 3, 114, :_reduce_65,
- 1, 115, :_reduce_none,
- 1, 115, :_reduce_none,
- 4, 117, :_reduce_68,
- 1, 103, :_reduce_69,
- 3, 103, :_reduce_70,
- 0, 104, :_reduce_none,
- 1, 104, :_reduce_none,
- 1, 119, :_reduce_73,
- 1, 94, :_reduce_74,
- 1, 96, :_reduce_75,
- 1, 118, :_reduce_none,
- 1, 118, :_reduce_none,
- 1, 118, :_reduce_none,
- 1, 118, :_reduce_none,
- 1, 118, :_reduce_none,
- 1, 118, :_reduce_none,
- 1, 118, :_reduce_none,
- 3, 78, :_reduce_83,
- 3, 78, :_reduce_84,
- 3, 87, :_reduce_85,
- 0, 105, :_reduce_86,
- 1, 105, :_reduce_87,
- 3, 105, :_reduce_88,
- 3, 123, :_reduce_89,
- 3, 125, :_reduce_90,
- 1, 126, :_reduce_none,
- 1, 126, :_reduce_none,
- 0, 108, :_reduce_93,
- 1, 108, :_reduce_94,
- 3, 108, :_reduce_95,
- 1, 127, :_reduce_96,
- 3, 127, :_reduce_97,
- 1, 116, :_reduce_none,
- 1, 116, :_reduce_none,
- 1, 116, :_reduce_none,
- 1, 116, :_reduce_none,
- 1, 116, :_reduce_none,
- 1, 116, :_reduce_none,
- 1, 124, :_reduce_none,
- 1, 124, :_reduce_none,
- 1, 124, :_reduce_none,
- 1, 124, :_reduce_none,
- 1, 124, :_reduce_none,
- 1, 124, :_reduce_none,
- 1, 124, :_reduce_none,
- 1, 124, :_reduce_none,
- 1, 124, :_reduce_none,
- 1, 124, :_reduce_none,
- 1, 124, :_reduce_none,
- 1, 124, :_reduce_none,
- 4, 98, :_reduce_116,
- 3, 98, :_reduce_117,
- 1, 100, :_reduce_118,
- 2, 100, :_reduce_119,
- 2, 130, :_reduce_120,
- 1, 131, :_reduce_121,
- 2, 131, :_reduce_122,
- 1, 97, :_reduce_123,
- 4, 91, :_reduce_124,
- 4, 91, :_reduce_125,
- 2, 80, :_reduce_126,
- 5, 132, :_reduce_127,
- 4, 132, :_reduce_128,
- 0, 133, :_reduce_none,
- 2, 133, :_reduce_130,
- 4, 133, :_reduce_131,
- 3, 133, :_reduce_132,
- 1, 121, :_reduce_none,
- 3, 121, :_reduce_134,
- 3, 121, :_reduce_135,
- 3, 121, :_reduce_136,
- 3, 121, :_reduce_137,
- 3, 121, :_reduce_138,
- 3, 121, :_reduce_139,
- 3, 121, :_reduce_140,
- 3, 121, :_reduce_141,
- 3, 121, :_reduce_142,
- 2, 121, :_reduce_143,
- 3, 121, :_reduce_144,
- 3, 121, :_reduce_145,
- 3, 121, :_reduce_146,
- 3, 121, :_reduce_147,
- 3, 121, :_reduce_148,
- 3, 121, :_reduce_149,
- 2, 121, :_reduce_150,
- 3, 121, :_reduce_151,
- 3, 121, :_reduce_152,
- 3, 121, :_reduce_153,
- 5, 79, :_reduce_154,
- 1, 135, :_reduce_155,
- 2, 135, :_reduce_156,
- 5, 136, :_reduce_157,
- 4, 136, :_reduce_158,
- 1, 137, :_reduce_159,
- 3, 137, :_reduce_160,
- 3, 99, :_reduce_161,
- 1, 139, :_reduce_none,
- 4, 139, :_reduce_163,
- 1, 141, :_reduce_none,
- 3, 141, :_reduce_165,
- 3, 140, :_reduce_166,
- 1, 138, :_reduce_none,
- 1, 138, :_reduce_none,
- 1, 138, :_reduce_none,
- 1, 138, :_reduce_none,
- 1, 138, :_reduce_none,
- 1, 138, :_reduce_none,
- 1, 138, :_reduce_none,
- 1, 138, :_reduce_174,
- 1, 138, :_reduce_none,
- 1, 142, :_reduce_176,
- 1, 143, :_reduce_none,
- 3, 143, :_reduce_178,
- 2, 81, :_reduce_179,
- 6, 83, :_reduce_180,
- 5, 83, :_reduce_181,
- 7, 84, :_reduce_182,
- 6, 84, :_reduce_183,
- 6, 85, :_reduce_184,
- 5, 85, :_reduce_185,
- 1, 107, :_reduce_186,
- 1, 102, :_reduce_187,
- 1, 102, :_reduce_188,
- 1, 102, :_reduce_189,
- 1, 146, :_reduce_190,
- 3, 146, :_reduce_191,
- 1, 148, :_reduce_192,
- 1, 149, :_reduce_193,
- 1, 149, :_reduce_194,
- 1, 149, :_reduce_195,
- 1, 149, :_reduce_none,
- 0, 72, :_reduce_197,
- 0, 150, :_reduce_198,
- 1, 144, :_reduce_none,
- 3, 144, :_reduce_200,
- 3, 144, :_reduce_201,
- 1, 151, :_reduce_none,
- 3, 151, :_reduce_203,
- 3, 152, :_reduce_204,
- 1, 152, :_reduce_205,
- 3, 152, :_reduce_206,
- 1, 152, :_reduce_207,
- 1, 147, :_reduce_none,
- 2, 147, :_reduce_209,
- 1, 145, :_reduce_none,
- 2, 145, :_reduce_211,
- 1, 153, :_reduce_none,
- 1, 153, :_reduce_none,
- 1, 95, :_reduce_214,
- 3, 120, :_reduce_215,
- 4, 120, :_reduce_216,
- 2, 120, :_reduce_217,
- 1, 128, :_reduce_none,
- 1, 128, :_reduce_none,
- 0, 106, :_reduce_none,
- 1, 106, :_reduce_221,
- 1, 134, :_reduce_222,
- 3, 129, :_reduce_223,
- 4, 129, :_reduce_224,
- 2, 129, :_reduce_225,
- 1, 154, :_reduce_none,
- 3, 154, :_reduce_227,
- 3, 155, :_reduce_228,
- 1, 156, :_reduce_229,
- 1, 156, :_reduce_230,
- 4, 122, :_reduce_231,
- 1, 101, :_reduce_none,
- 4, 101, :_reduce_233 ]
-
-racc_reduce_n = 234
-
-racc_shift_n = 385
+...end grammar.ra/module_eval...
+##### State transition tables begin ###
racc_action_table = [
- 242, 243, 55, 231, 356, 112, 157, 113, 78, 298,
- 68, 71, 357, 181, 186, 326, 344, 340, 55, 295,
- 114, 231, 177, 179, 182, 185, 170, 294, 68, 71,
- 286, 158, 100, 285, 103, 68, 71, 291, 292, 55,
- 59, 291, 292, 61, 111, 233, 180, 184, 198, 231,
- 189, 172, 173, 174, 176, 178, 59, 183, 187, 61,
- -168, 66, 170, 60, 175, 79, 81, 186, 202, 88,
- 112, 166, 79, 252, 74, 177, 88, 59, 84, 60,
- 61, 139, 68, 71, 333, 84, 100, 117, 103, 60,
- 36, -170, 68, 71, 38, 306, 60, 307, 203, 240,
- 60, 10, 203, 189, 172, 173, 174, 176, 178, 202,
- 183, 187, 241, 202, 209, 66, 218, 175, 209, 79,
- 81, 219, 284, 88, 309, 202, 256, 283, 74, 79,
- 252, 308, 84, 88, 203, 68, 71, 310, 139, 100,
- 203, 103, 84, 60, 218, 202, 256, 367, 36, 219,
- 209, 202, 38, 60, 68, 71, 209, 95, 100, 10,
- 103, 68, 71, 68, 71, 100, 337, 103, 66, 335,
- 199, 154, 79, 81, 173, 174, 88, 183, 187, 183,
- 187, 74, 99, 95, 175, 84, 175, 66, 90, 311,
- 337, 79, 81, 335, 66, 88, 60, 287, 79, 81,
- 74, 198, 88, 315, 84, 68, 71, 74, 99, -172,
- 213, 84, 68, 71, 90, 60, 100, 36, 103, 68,
- 71, 38, 60, 100, 318, 103, 68, 71, 10, 15,
- 36, -167, 213, 355, 38, 167, 36, 313, 202, 154,
- 127, 10, 79, 252, 323, 66, 88, 10, 15, 79,
- 81, 139, 66, 88, 166, 84, 79, 81, 74, 202,
- 88, 229, 84, 79, 252, 74, 60, 88, 49, 84,
- 68, 71, 139, 60, 78, -186, 84, 47, 48, 49,
- 60, 329, 36, 170, 183, 187, 127, 60, -169, 68,
- 71, 175, 70, 10, 15, 68, 71, 161, -171, 100,
- 289, 103, -169, 66, 291, 292, 60, 79, 81, 258,
- -167, 88, -170, 256, 257, 72, 74, 95, -168, 60,
- 84, 156, 66, 154, 68, 71, 79, 81, 66, 122,
- 88, 60, 79, 81, 72, 74, 88, -170, -173, 84,
- -172, 74, 99, 68, 71, 84, -171, 100, 90, 103,
- 60, 200, 334, 68, 71, 213, 60, 202, 215, 254,
- 338, 79, 252, 173, 174, 88, 122, 296, 183, 187,
- 139, 256, 257, 216, 84, 175, 66, 234, 68, 71,
- 79, 81, 113, 117, 88, 60, 202, 217, 78, 74,
- 79, 252, 353, 84, 88, 53, 68, 71, 223, 139,
- 100, 260, 103, 84, 60, 43, 44, 40, 41, 358,
- 52, 66, 51, 225, 60, 79, 81, -169, 229, 88,
- 365, 68, 71, 72, 74, 100, 238, 103, 84, 66,
- 228, -167, 234, 79, 81, 372, 373, 88, -169, 60,
- -167, -170, 74, 95, -168, -172, 84, 68, 71, 45,
- 375, 100, 229, 103, 66, -221, 232, 60, 79, 81,
- 378, 39, 88, -24, -24, -24, -24, 74, 99, 95,
- -168, 84, 383, 384, 90, nil, nil, 68, 71, nil,
- 66, 100, 60, 103, 79, 81, nil, nil, 88, -22,
- -22, -22, -22, 74, 99, nil, nil, 84, nil, 95,
- 90, nil, nil, 68, 71, nil, nil, 100, 60, 103,
- 66, nil, nil, nil, 79, 81, nil, nil, 88, 43,
- 44, 40, 41, 74, 99, 95, nil, 84, nil, nil,
- 90, nil, nil, 68, 71, nil, 66, 100, 60, 103,
- 79, 81, nil, nil, 88, nil, nil, nil, nil, 74,
- 99, nil, nil, 84, nil, 95, 90, nil, nil, 68,
- 71, nil, nil, 100, 60, 103, 66, nil, nil, nil,
- 79, 81, nil, nil, 88, nil, nil, 68, 71, 74,
- 99, 100, nil, 84, 68, 71, 90, nil, 100, nil,
- 103, nil, 66, nil, 60, nil, 79, 81, nil, nil,
- 88, nil, nil, nil, nil, 74, 95, nil, nil, 84,
- 66, nil, nil, nil, 79, 144, nil, 66, 88, nil,
- 60, 79, 81, 139, nil, 88, nil, 84, nil, nil,
- 74, 99, nil, nil, 84, 68, 71, 90, 60, 100,
- nil, 103, nil, nil, nil, 60, nil, nil, nil, nil,
- nil, nil, nil, nil, 68, 71, nil, 95, 100, nil,
- 103, 68, 71, nil, nil, 100, nil, 103, 66, nil,
- nil, nil, 79, 81, nil, nil, 88, nil, nil, 68,
- 71, 74, 99, nil, nil, 84, nil, 66, 90, nil,
- nil, 79, 81, nil, 66, 88, 60, nil, 79, 81,
- 74, nil, 88, nil, 84, 68, 71, 74, nil, nil,
- nil, 84, 202, nil, nil, 60, 79, 252, nil, nil,
- 88, nil, 60, nil, nil, 139, 68, 71, 162, 84,
- 100, nil, 103, nil, nil, nil, nil, nil, 66, nil,
- 60, nil, 79, 81, nil, nil, 88, nil, 95, nil,
- 72, 74, 68, 71, nil, 84, 100, nil, 103, 66,
- nil, nil, nil, 79, 81, nil, 60, 88, nil, nil,
- nil, nil, 74, 99, 95, nil, 84, 68, 71, 90,
- nil, nil, nil, nil, nil, 66, nil, 60, nil, 79,
+ 242, 243, 55, 68, 71, 299, 157, 55, 78, 117,
+ 199, 68, 71, 181, 186, -169, 36, 112, 341, 113,
+ 38, 55, 177, 179, 182, 185, 170, 10, 68, 71,
+ 231, 158, 114, 292, 293, 356, 257, 368, 68, 71,
+ 59, 198, 100, 61, 103, 59, 180, 184, 61, 198,
+ 189, 172, 173, 174, 176, 178, 111, 183, 187, 59,
+ 95, 66, 61, 60, 175, 79, 253, 154, 60, 88,
+ 345, 66, 233, 229, 139, 79, 81, 231, 84, 88,
+ 68, 71, 60, 225, 74, 99, 68, 71, 84, 60,
+ 100, 90, 103, 203, 203, 292, 293, 223, 296, 60,
+ 203, 117, 231, 78, 202, 202, 295, 240, 95, 209,
+ 209, 202, 166, 66, 186, 170, 209, 79, 253, 66,
+ 241, 88, 177, 79, 81, 334, 139, 88, 68, 71,
+ 84, 310, 74, 99, 68, 71, 84, 357, 100, 90,
+ 103, 60, 183, 187, 311, 358, 307, 60, 308, 175,
+ 189, 172, 173, 174, 176, 178, 95, 183, 187, 36,
+ 309, 66, 288, 38, 175, 79, 253, 66, 218, 88,
+ 10, 79, 81, 219, 139, 88, 338, 312, 84, 336,
+ 74, 99, 68, 71, 84, 218, 100, 90, 103, 60,
+ 219, 173, 174, 217, 285, 60, 183, 187, 257, 284,
+ 203, 68, 71, 175, 95, 100, 36, 103, 68, 71,
+ 127, 202, 100, 316, 103, 66, 209, 10, 15, 79,
+ 81, 173, 174, 88, 183, 187, 183, 187, 74, 99,
+ 95, 175, 84, 175, 66, 90, 113, 338, 79, 81,
+ 336, 66, 88, 60, 213, 79, 81, 74, 319, 88,
+ 216, 84, 68, 71, 74, 99, 213, 49, 84, 68,
+ 71, 90, 60, 100, 215, 103, 47, 48, 287, 60,
+ 154, 286, 189, 172, 173, 174, 324, 68, 71, 183,
+ 187, 100, 213, 103, 36, 66, 175, 327, 38, 79,
+ 253, 314, 66, 88, 200, 10, 79, 81, 139, 95,
+ 88, -171, 84, 68, 71, 74, 330, 78, 170, 84,
+ 66, -172, 259, 60, 79, 81, 257, 258, 88, -173,
+ 60, -168, -170, 74, 99, 70, 228, 84, 68, 71,
+ 90, 36, 100, -167, 103, 127, 66, -167, 60, 161,
+ 79, 81, 10, 15, 88, -169, -171, 297, 72, 74,
+ 95, 257, 258, 84, 68, 71, 36, -172, 100, -168,
+ 38, 66, 112, -170, 60, 79, 81, 10, 15, 88,
+ -22, -22, -22, -22, 74, 99, 68, 71, 84, 290,
+ 100, 90, 103, 292, 293, -167, 167, 66, 166, 60,
+ 335, 79, 253, 229, -187, 88, 339, 68, 71, 161,
+ 139, 100, 49, 103, 84, 43, 44, 40, 41, 66,
+ 234, -169, -174, 79, 81, 60, 156, 88, 154, 68,
+ 71, 354, 74, 100, 122, 103, 84, 122, 359, 161,
+ 66, 60, -170, 53, 79, 81, 229, 60, 88, 366,
+ 68, 71, 52, 74, 100, -168, 103, 84, 43, 44,
+ 40, 41, 66, 232, 51, 373, 79, 81, 60, 374,
+ 88, -169, 95, -167, -170, 74, 68, 71, -168, 84,
+ 100, -172, 103, 66, 60, 376, 45, 79, 81, -222,
+ 60, 88, -24, -24, -24, -24, 74, 99, 95, 234,
+ 84, 379, 238, 90, 39, 384, 68, 71, 385, 66,
+ 100, 60, 103, 79, 81, nil, nil, 88, nil, nil,
+ nil, nil, 74, 99, nil, nil, 84, nil, 95, 90,
+ nil, nil, 68, 71, nil, nil, 100, 60, 103, 66,
+ nil, nil, nil, 79, 81, nil, nil, 88, nil, nil,
+ nil, nil, 74, 99, 95, nil, 84, nil, nil, 90,
+ nil, nil, 68, 71, nil, 66, 100, 60, 103, 79,
+ 81, nil, nil, 88, nil, nil, nil, nil, 74, 99,
+ nil, nil, 84, nil, 95, 90, nil, nil, 68, 71,
+ nil, nil, 100, 60, 103, 66, nil, nil, nil, 79,
81, nil, nil, 88, nil, nil, nil, nil, 74, 99,
- 327, nil, 84, 68, 71, 90, nil, 100, nil, 103,
- 66, nil, nil, 60, 79, 81, nil, nil, 88, nil,
- nil, nil, 72, 74, nil, 95, nil, 84, 68, 71,
- nil, nil, 100, nil, 103, nil, 66, nil, 60, nil,
- 79, 81, 68, 71, 88, nil, 100, nil, 103, 74,
- 99, nil, nil, 84, nil, nil, 90, nil, nil, nil,
- nil, 66, nil, nil, 60, 79, 81, 68, 71, 88,
- nil, 100, nil, 103, 74, 66, nil, nil, 84, 79,
- 81, 68, 71, 88, nil, 100, nil, nil, 74, 60,
- nil, nil, 84, nil, nil, nil, nil, nil, nil, nil,
- 66, nil, nil, 60, 79, 81, nil, nil, 88, nil,
- nil, 68, 71, 74, 66, nil, nil, 84, 79, 252,
- nil, nil, 88, nil, nil, nil, nil, 139, 60, 68,
- 71, 84, nil, 100, nil, 103, nil, nil, nil, nil,
- nil, nil, 60, nil, 202, nil, nil, nil, 79, 252,
- nil, 95, 88, nil, nil, nil, nil, 139, nil, 68,
- 71, 84, 66, 100, nil, 103, 79, 81, nil, nil,
- 88, nil, 60, nil, nil, 74, 99, nil, nil, 84,
- nil, 95, 90, nil, nil, 68, 71, nil, nil, 100,
- 60, 103, 66, nil, nil, nil, 79, 81, nil, nil,
+ 95, nil, 84, nil, nil, 90, nil, nil, 68, 71,
+ nil, 66, 100, 60, 103, 79, 81, nil, nil, 88,
+ nil, nil, nil, nil, 74, 99, nil, nil, 84, nil,
+ 95, 90, nil, nil, 68, 71, nil, nil, 100, 60,
+ 103, 66, nil, nil, nil, 79, 81, nil, nil, 88,
+ 68, 71, nil, nil, 74, 99, 68, 71, 84, nil,
+ 100, 90, 103, nil, nil, nil, nil, 66, nil, 60,
+ nil, 79, 81, nil, nil, 88, nil, nil, 95, nil,
+ 74, 68, 71, 66, 84, 100, nil, 79, 253, 66,
+ nil, 88, nil, 79, 81, 60, 139, 88, nil, nil,
+ 84, nil, 74, 99, nil, nil, 84, 68, 71, 90,
+ nil, 60, nil, nil, 66, nil, nil, 60, 79, 144,
+ nil, nil, 88, nil, nil, nil, nil, 139, 68, 71,
+ nil, 84, 100, nil, 103, nil, nil, nil, nil, nil,
+ 66, nil, 60, nil, 79, 253, 68, 71, 88, nil,
+ 100, nil, 103, 139, nil, nil, nil, 84, nil, nil,
+ nil, 66, nil, nil, nil, 79, 81, nil, 60, 88,
+ nil, 68, 71, nil, 74, nil, nil, nil, 84, 66,
+ nil, nil, nil, 79, 81, nil, nil, 88, nil, 60,
+ nil, nil, 74, nil, 261, nil, 84, 68, 71, nil,
+ nil, 100, nil, 103, 66, nil, nil, 60, 79, 81,
+ nil, nil, 88, nil, nil, nil, 72, 74, 68, 71,
+ nil, 84, 100, nil, 103, nil, nil, nil, nil, nil,
+ 66, nil, 60, nil, 79, 81, nil, nil, 88, nil,
+ 95, nil, nil, 74, 68, 71, nil, 84, nil, nil,
+ nil, 66, nil, nil, nil, 79, 81, nil, 60, 88,
+ nil, nil, nil, nil, 74, 99, nil, 162, 84, 68,
+ 71, 90, nil, 100, nil, 103, nil, 66, nil, 60,
+ nil, 79, 81, nil, nil, 88, nil, nil, nil, 72,
+ 74, 95, nil, nil, 84, 68, 71, nil, nil, 100,
+ nil, 103, 66, nil, nil, 60, 79, 81, nil, nil,
88, nil, nil, nil, nil, 74, 99, 95, nil, 84,
- nil, nil, 90, nil, nil, 68, 71, nil, 66, 100,
- 60, 103, 79, 81, nil, nil, 88, nil, nil, nil,
- nil, 74, 99, nil, nil, 84, nil, 95, 90, nil,
- nil, 68, 71, nil, nil, 100, 60, 103, 66, nil,
- nil, nil, 79, 81, nil, nil, 88, nil, nil, nil,
- nil, 74, 99, 95, nil, 84, nil, nil, 90, nil,
- nil, 68, 71, nil, 66, 100, 60, 103, 79, 81,
- nil, nil, 88, nil, nil, nil, nil, 74, 99, nil,
- nil, 84, nil, 95, 90, nil, nil, 68, 71, nil,
- nil, 100, 60, 103, 66, nil, nil, nil, 79, 81,
+ 68, 71, 90, nil, 100, nil, 103, nil, 66, nil,
+ 60, nil, 79, 81, 68, 71, 88, nil, nil, nil,
+ 255, 74, 99, nil, nil, 84, nil, nil, 90, nil,
+ nil, nil, nil, 66, nil, nil, 60, 79, 81, 68,
+ 71, 88, nil, 100, nil, 103, 74, 66, nil, nil,
+ 84, 79, 253, nil, nil, 88, nil, nil, 68, 71,
+ 139, 60, nil, nil, 84, nil, nil, nil, nil, nil,
+ nil, nil, 66, nil, nil, 60, 79, 81, nil, nil,
+ 88, 328, nil, 68, 71, 74, nil, nil, nil, 84,
+ nil, 66, nil, nil, nil, 79, 81, nil, nil, 88,
+ 60, 68, 71, 72, 74, 100, 193, 103, 84, nil,
+ nil, nil, nil, nil, nil, nil, 66, nil, nil, 60,
+ 79, 253, 68, 71, 88, nil, 100, nil, 103, 139,
+ nil, nil, nil, 84, 66, nil, nil, nil, 79, 81,
+ nil, nil, 88, nil, 60, nil, nil, 74, 68, 71,
+ nil, 84, 100, nil, 103, 66, nil, nil, nil, 79,
+ 81, nil, 60, 88, nil, nil, nil, nil, 74, nil,
+ 95, nil, 84, nil, 68, 71, nil, nil, 100, nil,
+ 103, 66, nil, 60, nil, 79, 81, nil, nil, 88,
+ nil, nil, nil, nil, 74, 99, 95, nil, 84, 68,
+ 71, 90, nil, 100, nil, 103, nil, 66, nil, 60,
+ nil, 79, 81, 68, 71, 88, nil, nil, nil, nil,
+ 74, 99, nil, nil, 84, nil, nil, 90, nil, nil,
+ nil, nil, 66, nil, nil, 60, 79, 81, nil, nil,
+ 88, nil, nil, nil, nil, 74, 66, nil, nil, 84,
+ 79, 81, nil, nil, 88, nil, nil, nil, 72, 74,
+ 60, 68, 71, 84, nil, 100, nil, 103, 189, 172,
+ 173, 174, 176, 178, 60, 183, 187, nil, 189, 172,
+ 173, 174, 175, 95, nil, 183, 187, 68, 71, nil,
+ nil, 100, 175, 103, 66, nil, nil, nil, 79, 81,
nil, nil, 88, nil, nil, nil, nil, 74, 99, 95,
nil, 84, nil, nil, 90, nil, nil, 68, 71, nil,
66, 100, 60, 103, 79, 81, nil, nil, 88, nil,
nil, nil, nil, 74, 99, nil, nil, 84, nil, 95,
90, nil, nil, 68, 71, nil, nil, 100, 60, 103,
66, nil, nil, nil, 79, 81, nil, nil, 88, nil,
- nil, nil, nil, 74, 99, 95, nil, 84, 68, 71,
- 90, nil, 100, 193, 103, nil, 66, nil, 60, nil,
- 79, 81, nil, nil, 88, nil, nil, nil, nil, 74,
- 99, nil, nil, 84, 68, 71, 90, nil, 100, nil,
- 103, 66, nil, nil, 60, 79, 81, nil, nil, 88,
- nil, nil, nil, nil, 74, nil, 95, nil, 84, nil,
- 68, 71, nil, nil, 100, nil, 103, 66, nil, 60,
- nil, 79, 81, nil, nil, 88, nil, nil, nil, nil,
- 74, 99, 95, nil, 84, nil, nil, 90, nil, nil,
- nil, nil, nil, 66, nil, 60, nil, 79, 81, 188,
- nil, 88, nil, nil, nil, nil, 74, 99, 181, 186,
- 84, nil, nil, 90, nil, nil, nil, 177, 179, 182,
- 185, 60, nil, 181, 186, nil, nil, nil, nil, nil,
- nil, 282, 177, 179, 182, 185, nil, nil, nil, nil,
- nil, 180, 184, nil, nil, 189, 172, 173, 174, 176,
- 178, nil, 183, 187, nil, nil, 180, 184, nil, 175,
- 189, 172, 173, 174, 176, 178, nil, 183, 187, 181,
- 186, nil, nil, nil, 175, nil, nil, nil, 177, 179,
- 182, 185, nil, nil, 181, 186, nil, nil, nil, nil,
- nil, nil, nil, 177, 179, 182, 185, nil, nil, nil,
- nil, nil, nil, nil, nil, nil, 189, 172, 173, 174,
- 176, 178, nil, 183, 187, nil, nil, 180, 184, nil,
- 175, 189, 172, 173, 174, 176, 178, nil, 183, 187,
- 181, 186, nil, nil, nil, 175, nil, nil, nil, 177,
- 179, 182, 185, nil, nil, 181, 186, nil, nil, nil,
- nil, nil, nil, nil, 177, 179, 182, 185, nil, nil,
- nil, nil, nil, 180, 184, nil, nil, 189, 172, 173,
- 174, 176, 178, nil, 183, 187, nil, nil, nil, 184,
- nil, 175, 189, 172, 173, 174, 176, 178, nil, 183,
- 187, 181, 186, nil, nil, nil, 175, nil, nil, nil,
- 177, 179, 182, 185, nil, nil, nil, 186, nil, 189,
- 172, 173, 174, 176, 178, 177, 183, 187, nil, nil,
- nil, nil, nil, 175, 180, 184, 186, nil, 189, 172,
- 173, 174, 176, 178, 177, 183, 187, nil, nil, nil,
- nil, 186, 175, 189, 172, 173, 174, 176, 178, 177,
- 183, 187, nil, nil, nil, nil, nil, 175, nil, nil,
- nil, nil, 189, 172, 173, 174, 176, 178, nil, 183,
- 187, 280, nil, nil, nil, nil, 175, 189, 172, 173,
- 174, 176, 178, nil, 183, 187, nil, nil, nil, nil,
- 325, 175, 26, nil, 32, 1, nil, 8, 11, nil,
- 18, nil, 23, nil, 29, nil, 2, nil, nil, 10,
- 15, 26, 363, 32, 1, nil, 8, 11, nil, 18,
- nil, 23, nil, 29, nil, 2, nil, nil, 10, 15,
- nil, 382, nil, 26, nil, 32, 1, nil, 8, 11,
- nil, 18, nil, 23, nil, 29, nil, 2, nil, nil,
- 10, 15, 26, 380, 32, 1, nil, 8, 11, nil,
- 18, nil, 23, nil, 29, nil, 2, nil, nil, 10,
- 15, nil, 376, nil, 26, nil, 32, 1, nil, 8,
- 11, nil, 18, nil, 23, nil, 29, nil, 2, nil,
- nil, 10, 15, 26, 305, 32, 1, nil, 8, 11,
- nil, 18, nil, 23, nil, 29, nil, 2, nil, nil,
- 10, 15, nil, nil, nil, 26, nil, 32, 1, nil,
+ nil, nil, nil, 74, 99, 95, nil, 84, nil, nil,
+ 90, nil, nil, nil, nil, nil, 66, nil, 60, nil,
+ 79, 81, 188, nil, 88, nil, nil, nil, nil, 74,
+ 99, 181, 186, 84, nil, nil, 90, nil, nil, nil,
+ 177, 179, 182, 185, 60, nil, 181, 186, nil, nil,
+ nil, nil, nil, nil, nil, 177, 179, 182, 185, nil,
+ nil, nil, nil, nil, 180, 184, nil, nil, 189, 172,
+ 173, 174, 176, 178, nil, 183, 187, nil, nil, 180,
+ 184, nil, 175, 189, 172, 173, 174, 176, 178, nil,
+ 183, 187, 181, 186, nil, nil, nil, 175, nil, nil,
+ 283, 177, 179, 182, 185, nil, nil, 181, 186, nil,
+ nil, nil, nil, nil, nil, nil, 177, 179, 182, 185,
+ nil, nil, nil, nil, nil, 180, 184, nil, nil, 189,
+ 172, 173, 174, 176, 178, nil, 183, 187, nil, nil,
+ nil, 184, nil, 175, 189, 172, 173, 174, 176, 178,
+ nil, 183, 187, 181, 186, nil, nil, nil, 175, nil,
+ nil, nil, 177, 179, 182, 185, nil, nil, 181, 186,
+ nil, nil, nil, nil, nil, nil, nil, 177, 179, 182,
+ 185, nil, nil, nil, nil, nil, 180, 184, nil, nil,
+ 189, 172, 173, 174, 176, 178, nil, 183, 187, nil,
+ nil, 180, 184, nil, 175, 189, 172, 173, 174, 176,
+ 178, nil, 183, 187, 181, 186, nil, nil, nil, 175,
+ nil, nil, nil, 177, 179, 182, 185, nil, nil, 26,
+ 186, 32, 1, nil, 8, 11, nil, 18, 177, 23,
+ nil, 29, nil, 2, nil, nil, 10, 15, nil, 186,
+ nil, 189, 172, 173, 174, 176, 178, 177, 183, 187,
+ nil, nil, nil, nil, 186, 175, 189, 172, 173, 174,
+ 176, 178, 177, 183, 187, nil, nil, nil, nil, nil,
+ 175, nil, nil, nil, nil, 189, 172, 173, 174, 176,
+ 178, nil, 183, 187, 281, nil, nil, nil, nil, 175,
+ 189, 172, 173, 174, 176, 178, nil, 183, 187, nil,
+ nil, nil, nil, 377, 175, 26, nil, 32, 1, nil,
8, 11, nil, 18, nil, 23, nil, 29, nil, 2,
- nil, nil, 10, 15, 26, nil, 32, 1, nil, 8,
+ nil, nil, 10, 15, 26, 364, 32, 1, nil, 8,
11, nil, 18, nil, 23, nil, 29, nil, 2, nil,
- nil, 10, 15, 26, nil, 32, 1, nil, 8, 11,
- nil, 18, nil, 23, nil, 29, nil, 2, nil, nil,
- 10, 15, 26, nil, 32, 1, nil, 8, 11, nil,
- 18, nil, 23, nil, 29, nil, 2, nil, nil, 10,
- 15, 189, 172, 173, 174, 176, 178, nil, 183, 187,
- 189, 172, 173, 174, nil, 175, nil, 183, 187, 189,
- 172, 173, 174, nil, 175, nil, 183, 187, nil, nil,
- nil, nil, nil, 175 ]
+ nil, 10, 15, nil, 383, nil, 26, nil, 32, 1,
+ nil, 8, 11, nil, 18, nil, 23, nil, 29, nil,
+ 2, nil, nil, 10, 15, 26, 306, 32, 1, nil,
+ 8, 11, nil, 18, nil, 23, nil, 29, nil, 2,
+ nil, nil, 10, 15, nil, 381, nil, 26, nil, 32,
+ 1, nil, 8, 11, nil, 18, nil, 23, nil, 29,
+ nil, 2, nil, nil, 10, 15, 26, 326, 32, 1,
+ nil, 8, 11, nil, 18, nil, 23, nil, 29, nil,
+ 2, nil, nil, 10, 15, nil, nil, nil, 26, nil,
+ 32, 1, nil, 8, 11, nil, 18, nil, 23, nil,
+ 29, nil, 2, nil, nil, 10, 15, 26, nil, 32,
+ 1, nil, 8, 11, nil, 18, nil, 23, nil, 29,
+ nil, 2, nil, nil, 10, 15, 26, nil, 32, 1,
+ nil, 8, 11, nil, 18, nil, 23, nil, 29, nil,
+ 2, nil, nil, 10, 15, 189, 172, 173, 174, 176,
+ 178, nil, 183, 187, nil, nil, nil, nil, nil, 175 ]
racc_action_check = [
- 164, 164, 158, 154, 301, 27, 56, 27, 81, 214,
- 285, 285, 301, 164, 164, 239, 293, 285, 18, 206,
- 27, 213, 164, 164, 164, 164, 81, 206, 175, 175,
- 194, 56, 175, 194, 175, 368, 368, 214, 214, 157,
- 158, 293, 293, 158, 27, 154, 164, 164, 285, 144,
- 164, 164, 164, 164, 164, 164, 18, 164, 164, 18,
- 85, 175, 144, 158, 164, 175, 175, 272, 368, 175,
- 83, 261, 368, 368, 175, 272, 368, 157, 175, 18,
- 157, 368, 161, 161, 261, 368, 161, 216, 161, 175,
- 1, 82, 356, 356, 1, 218, 368, 219, 203, 163,
- 157, 1, 114, 272, 272, 272, 272, 272, 272, 203,
- 272, 272, 163, 114, 203, 161, 122, 272, 114, 161,
- 161, 122, 192, 161, 221, 356, 192, 192, 161, 356,
- 356, 220, 161, 356, 290, 335, 335, 221, 356, 335,
- 111, 335, 356, 161, 309, 290, 331, 331, 11, 309,
- 290, 111, 11, 356, 329, 329, 111, 335, 329, 11,
- 329, 48, 48, 103, 103, 48, 334, 48, 335, 334,
- 103, 200, 335, 335, 262, 262, 335, 263, 263, 262,
- 262, 335, 335, 48, 263, 335, 262, 329, 335, 224,
- 280, 329, 329, 280, 48, 329, 335, 197, 48, 48,
- 329, 103, 48, 227, 329, 295, 295, 48, 48, 87,
- 229, 48, 307, 307, 48, 329, 307, 33, 307, 306,
- 306, 33, 48, 306, 230, 306, 299, 299, 33, 33,
- 225, 80, 232, 299, 225, 77, 46, 225, 295, 234,
- 46, 225, 295, 295, 235, 307, 295, 46, 46, 307,
- 307, 295, 306, 307, 75, 295, 306, 306, 307, 299,
- 306, 212, 307, 299, 299, 306, 295, 299, 8, 306,
- 23, 23, 299, 307, 23, 74, 299, 8, 8, 66,
- 306, 249, 42, 252, 264, 264, 42, 299, 65, 166,
- 166, 264, 23, 42, 42, 26, 26, 64, 89, 26,
- 201, 26, 94, 23, 201, 201, 187, 23, 23, 169,
- 101, 23, 102, 169, 169, 23, 23, 26, 105, 183,
- 23, 53, 166, 52, 294, 294, 166, 166, 26, 50,
- 166, 23, 26, 26, 166, 166, 26, 143, 106, 166,
- 107, 26, 26, 29, 29, 26, 108, 29, 26, 29,
- 166, 110, 279, 167, 167, 113, 26, 294, 115, 167,
- 283, 294, 294, 281, 281, 294, 37, 211, 281, 281,
- 294, 211, 211, 116, 294, 281, 29, 288, 170, 170,
- 29, 29, 119, 32, 29, 294, 167, 121, 127, 29,
- 167, 167, 297, 29, 167, 17, 287, 287, 133, 167,
- 287, 170, 287, 167, 29, 3, 3, 3, 3, 304,
- 13, 170, 12, 134, 167, 170, 170, 136, 320, 170,
- 324, 172, 172, 170, 170, 172, 159, 172, 170, 287,
- 140, 141, 155, 287, 287, 337, 342, 287, 346, 170,
- 347, 349, 287, 172, 350, 351, 287, 45, 45, 5,
- 357, 45, 142, 45, 172, 367, 147, 287, 172, 172,
- 369, 2, 172, 4, 4, 4, 4, 172, 172, 45,
- 146, 172, 379, 381, 172, nil, nil, 173, 173, nil,
- 45, 173, 172, 173, 45, 45, nil, nil, 45, 31,
- 31, 31, 31, 45, 45, nil, nil, 45, nil, 173,
- 45, nil, nil, 47, 47, nil, nil, 47, 45, 47,
- 173, nil, nil, nil, 173, 173, nil, nil, 173, 6,
- 6, 6, 6, 173, 173, 47, nil, 173, nil, nil,
- 173, nil, nil, 174, 174, nil, 47, 174, 173, 174,
- 47, 47, nil, nil, 47, nil, nil, nil, nil, 47,
- 47, nil, nil, 47, nil, 174, 47, nil, nil, 49,
- 49, nil, nil, 49, 47, 49, 174, nil, nil, nil,
- 174, 174, nil, nil, 174, nil, nil, 51, 51, 174,
- 174, 51, nil, 174, 176, 176, 174, nil, 176, nil,
- 176, nil, 49, nil, 174, nil, 49, 49, nil, nil,
- 49, nil, nil, nil, nil, 49, 176, nil, nil, 49,
- 51, nil, nil, nil, 51, 51, nil, 176, 51, nil,
- 49, 176, 176, 51, nil, 176, nil, 51, nil, nil,
- 176, 176, nil, nil, 176, 177, 177, 176, 51, 177,
- nil, 177, nil, nil, nil, 176, nil, nil, nil, nil,
- nil, nil, nil, nil, 112, 112, nil, 177, 112, nil,
- 112, 259, 259, nil, nil, 259, nil, 259, 177, nil,
- nil, nil, 177, 177, nil, nil, 177, nil, nil, 254,
- 254, 177, 177, nil, nil, 177, nil, 112, 177, nil,
- nil, 112, 112, nil, 259, 112, 177, nil, 259, 259,
- 112, nil, 259, nil, 112, 70, 70, 259, nil, nil,
- nil, 259, 254, nil, nil, 112, 254, 254, nil, nil,
- 254, nil, 259, nil, nil, 254, 242, 242, 70, 254,
- 242, nil, 242, nil, nil, nil, nil, nil, 70, nil,
- 254, nil, 70, 70, nil, nil, 70, nil, 242, nil,
- 70, 70, 71, 71, nil, 70, 71, nil, 71, 242,
- nil, nil, nil, 242, 242, nil, 70, 242, nil, nil,
- nil, nil, 242, 242, 71, nil, 242, 240, 240, 242,
- nil, nil, nil, nil, nil, 71, nil, 242, nil, 71,
- 71, nil, nil, 71, nil, nil, nil, nil, 71, 71,
- 240, nil, 71, 178, 178, 71, nil, 178, nil, 178,
- 240, nil, nil, 71, 240, 240, nil, nil, 240, nil,
- nil, nil, 240, 240, nil, 178, nil, 240, 233, 233,
- nil, nil, 233, nil, 233, nil, 178, nil, 240, nil,
- 178, 178, 78, 78, 178, nil, 78, nil, 78, 178,
- 178, nil, nil, 178, nil, nil, 178, nil, nil, nil,
- nil, 233, nil, nil, 178, 233, 233, 231, 231, 233,
- nil, 231, nil, 231, 233, 78, nil, nil, 233, 78,
- 78, 228, 228, 78, nil, 228, nil, nil, 78, 233,
- nil, nil, 78, nil, nil, nil, nil, nil, nil, nil,
- 231, nil, nil, 78, 231, 231, nil, nil, 231, nil,
- nil, 215, 215, 231, 228, nil, nil, 231, 228, 228,
- nil, nil, 228, nil, nil, nil, nil, 228, 231, 179,
- 179, 228, nil, 179, nil, 179, nil, nil, nil, nil,
- nil, nil, 228, nil, 215, nil, nil, nil, 215, 215,
- nil, 179, 215, nil, nil, nil, nil, 215, nil, 185,
- 185, 215, 179, 185, nil, 185, 179, 179, nil, nil,
- 179, nil, 215, nil, nil, 179, 179, nil, nil, 179,
- nil, 185, 179, nil, nil, 181, 181, nil, nil, 181,
- 179, 181, 185, nil, nil, nil, 185, 185, nil, nil,
- 185, nil, nil, nil, nil, 185, 185, 181, nil, 185,
- nil, nil, 185, nil, nil, 189, 189, nil, 181, 189,
- 185, 189, 181, 181, nil, nil, 181, nil, nil, nil,
- nil, 181, 181, nil, nil, 181, nil, 189, 181, nil,
- nil, 90, 90, nil, nil, 90, 181, 90, 189, nil,
- nil, nil, 189, 189, nil, nil, 189, nil, nil, nil,
- nil, 189, 189, 90, nil, 189, nil, nil, 189, nil,
- nil, 182, 182, nil, 90, 182, 189, 182, 90, 90,
- nil, nil, 90, nil, nil, nil, nil, 90, 90, nil,
- nil, 90, nil, 182, 90, nil, nil, 184, 184, nil,
- nil, 184, 90, 184, 182, nil, nil, nil, 182, 182,
- nil, nil, 182, nil, nil, nil, nil, 182, 182, 184,
- nil, 182, nil, nil, 182, nil, nil, 95, 95, nil,
- 184, 95, 182, 95, 184, 184, nil, nil, 184, nil,
- nil, nil, nil, 184, 184, nil, nil, 184, nil, 95,
- 184, nil, nil, 99, 99, nil, nil, 99, 184, 99,
- 95, nil, nil, nil, 95, 95, nil, nil, 95, nil,
- nil, nil, nil, 95, 95, 99, nil, 95, 100, 100,
- 95, nil, 100, 100, 100, nil, 99, nil, 95, nil,
- 99, 99, nil, nil, 99, nil, nil, nil, nil, 99,
- 99, nil, nil, 99, 186, 186, 99, nil, 186, nil,
- 186, 100, nil, nil, 99, 100, 100, nil, nil, 100,
- nil, nil, nil, nil, 100, nil, 186, nil, 100, nil,
- 180, 180, nil, nil, 180, nil, 180, 186, nil, 100,
- nil, 186, 186, nil, nil, 186, nil, nil, nil, nil,
- 186, 186, 180, nil, 186, nil, nil, 186, nil, nil,
- nil, nil, nil, 180, nil, 186, nil, 180, 180, 91,
- nil, 180, nil, nil, nil, nil, 180, 180, 91, 91,
- 180, nil, nil, 180, nil, nil, nil, 91, 91, 91,
- 91, 180, nil, 190, 190, nil, nil, nil, nil, nil,
- nil, 190, 190, 190, 190, 190, nil, nil, nil, nil,
- nil, 91, 91, nil, nil, 91, 91, 91, 91, 91,
- 91, nil, 91, 91, nil, nil, 190, 190, nil, 91,
- 190, 190, 190, 190, 190, 190, nil, 190, 190, 274,
- 274, nil, nil, nil, 190, nil, nil, nil, 274, 274,
- 274, 274, nil, nil, 132, 132, nil, nil, nil, nil,
- nil, nil, nil, 132, 132, 132, 132, nil, nil, nil,
- nil, nil, nil, nil, nil, nil, 274, 274, 274, 274,
- 274, 274, nil, 274, 274, nil, nil, 132, 132, nil,
- 274, 132, 132, 132, 132, 132, 132, nil, 132, 132,
- 131, 131, nil, nil, nil, 132, nil, nil, nil, 131,
- 131, 131, 131, nil, nil, 270, 270, nil, nil, nil,
- nil, nil, nil, nil, 270, 270, 270, 270, nil, nil,
- nil, nil, nil, 131, 131, nil, nil, 131, 131, 131,
- 131, 131, 131, nil, 131, 131, nil, nil, nil, 270,
- nil, 131, 270, 270, 270, 270, 270, 270, nil, 270,
- 270, 129, 129, nil, nil, nil, 270, nil, nil, nil,
- 129, 129, 129, 129, nil, nil, nil, 269, nil, 276,
- 276, 276, 276, 276, 276, 269, 276, 276, nil, nil,
- nil, nil, nil, 276, 129, 129, 275, nil, 129, 129,
- 129, 129, 129, 129, 275, 129, 129, nil, nil, nil,
- nil, 271, 129, 269, 269, 269, 269, 269, 269, 271,
- 269, 269, nil, nil, nil, nil, nil, 269, nil, nil,
- nil, nil, 275, 275, 275, 275, 275, 275, nil, 275,
- 275, 188, nil, nil, nil, nil, 275, 271, 271, 271,
- 271, 271, 271, nil, 271, 271, nil, nil, nil, nil,
- 238, 271, 188, nil, 188, 188, nil, 188, 188, nil,
- 188, nil, 188, nil, 188, nil, 188, nil, nil, 188,
- 188, 238, 311, 238, 238, nil, 238, 238, nil, 238,
- nil, 238, nil, 238, nil, 238, nil, nil, 238, 238,
- nil, 375, nil, 311, nil, 311, 311, nil, 311, 311,
- nil, 311, nil, 311, nil, 311, nil, 311, nil, nil,
- 311, 311, 375, 372, 375, 375, nil, 375, 375, nil,
- 375, nil, 375, nil, 375, nil, 375, nil, nil, 375,
- 375, nil, 362, nil, 372, nil, 372, 372, nil, 372,
- 372, nil, 372, nil, 372, nil, 372, nil, 372, nil,
- nil, 372, 372, 362, 217, 362, 362, nil, 362, 362,
- nil, 362, nil, 362, nil, 362, nil, 362, nil, nil,
- 362, 362, nil, nil, nil, 217, nil, 217, 217, nil,
- 217, 217, nil, 217, nil, 217, nil, 217, nil, 217,
- nil, nil, 217, 217, 0, nil, 0, 0, nil, 0,
- 0, nil, 0, nil, 0, nil, 0, nil, 0, nil,
- nil, 0, 0, 20, nil, 20, 20, nil, 20, 20,
- nil, 20, nil, 20, nil, 20, nil, 20, nil, nil,
- 20, 20, 278, nil, 278, 278, nil, 278, 278, nil,
- 278, nil, 278, nil, 278, nil, 278, nil, nil, 278,
- 278, 267, 267, 267, 267, 267, 267, nil, 267, 267,
- 266, 266, 266, 266, nil, 267, nil, 266, 266, 268,
- 268, 268, 268, nil, 266, nil, 268, 268, nil, nil,
- nil, nil, nil, 268 ]
+ 164, 164, 18, 103, 103, 214, 56, 157, 81, 32,
+ 103, 286, 286, 164, 164, 136, 11, 27, 286, 27,
+ 11, 158, 164, 164, 164, 164, 81, 11, 300, 300,
+ 154, 56, 27, 214, 214, 300, 332, 332, 189, 189,
+ 18, 103, 189, 18, 189, 157, 164, 164, 157, 286,
+ 164, 164, 164, 164, 164, 164, 27, 164, 164, 158,
+ 189, 300, 158, 18, 164, 300, 300, 200, 157, 300,
+ 294, 189, 154, 212, 300, 189, 189, 213, 300, 189,
+ 369, 369, 158, 134, 189, 189, 186, 186, 189, 300,
+ 186, 189, 186, 203, 291, 294, 294, 133, 206, 189,
+ 111, 216, 144, 127, 203, 291, 206, 163, 186, 203,
+ 291, 111, 262, 369, 273, 144, 111, 369, 369, 186,
+ 163, 369, 273, 186, 186, 262, 369, 186, 357, 357,
+ 369, 221, 186, 186, 185, 185, 186, 302, 185, 186,
+ 185, 369, 264, 264, 221, 302, 218, 186, 219, 264,
+ 273, 273, 273, 273, 273, 273, 185, 273, 273, 1,
+ 220, 357, 197, 1, 273, 357, 357, 185, 122, 357,
+ 1, 185, 185, 122, 357, 185, 281, 224, 357, 281,
+ 185, 185, 176, 176, 185, 310, 176, 185, 176, 357,
+ 310, 282, 282, 121, 192, 185, 282, 282, 192, 192,
+ 114, 175, 175, 282, 176, 175, 46, 175, 336, 336,
+ 46, 114, 336, 227, 336, 176, 114, 46, 46, 176,
+ 176, 263, 263, 176, 265, 265, 263, 263, 176, 176,
+ 336, 265, 176, 263, 175, 176, 119, 335, 175, 175,
+ 335, 336, 175, 176, 229, 336, 336, 175, 230, 336,
+ 116, 175, 215, 215, 336, 336, 232, 8, 336, 330,
+ 330, 336, 175, 330, 115, 330, 8, 8, 194, 336,
+ 234, 194, 267, 267, 267, 267, 235, 184, 184, 267,
+ 267, 184, 113, 184, 225, 215, 267, 239, 225, 215,
+ 215, 225, 330, 215, 110, 225, 330, 330, 215, 184,
+ 330, 108, 215, 23, 23, 330, 250, 23, 253, 330,
+ 184, 107, 169, 215, 184, 184, 169, 169, 184, 106,
+ 330, 105, 102, 184, 184, 23, 140, 184, 26, 26,
+ 184, 42, 26, 141, 26, 42, 23, 101, 184, 96,
+ 23, 23, 42, 42, 23, 94, 89, 211, 23, 23,
+ 26, 211, 211, 23, 228, 228, 33, 87, 228, 85,
+ 33, 26, 83, 82, 23, 26, 26, 33, 33, 26,
+ 31, 31, 31, 31, 26, 26, 29, 29, 26, 201,
+ 29, 26, 29, 201, 201, 80, 77, 228, 75, 26,
+ 280, 228, 228, 142, 74, 228, 284, 308, 308, 69,
+ 228, 308, 66, 308, 228, 6, 6, 6, 6, 29,
+ 289, 65, 64, 29, 29, 228, 53, 29, 52, 307,
+ 307, 298, 29, 307, 50, 307, 29, 37, 305, 138,
+ 308, 187, 143, 17, 308, 308, 321, 29, 308, 325,
+ 174, 174, 13, 308, 174, 146, 174, 308, 3, 3,
+ 3, 3, 307, 147, 12, 338, 307, 307, 308, 343,
+ 307, 347, 174, 348, 350, 307, 179, 179, 351, 307,
+ 179, 352, 179, 174, 183, 358, 5, 174, 174, 368,
+ 307, 174, 4, 4, 4, 4, 174, 174, 179, 155,
+ 174, 370, 159, 174, 2, 380, 173, 173, 382, 179,
+ 173, 174, 173, 179, 179, nil, nil, 179, nil, nil,
+ nil, nil, 179, 179, nil, nil, 179, nil, 173, 179,
+ nil, nil, 45, 45, nil, nil, 45, 179, 45, 173,
+ nil, nil, nil, 173, 173, nil, nil, 173, nil, nil,
+ nil, nil, 173, 173, 45, nil, 173, nil, nil, 173,
+ nil, nil, 172, 172, nil, 45, 172, 173, 172, 45,
+ 45, nil, nil, 45, nil, nil, nil, nil, 45, 45,
+ nil, nil, 45, nil, 172, 45, nil, nil, 47, 47,
+ nil, nil, 47, 45, 47, 172, nil, nil, nil, 172,
+ 172, nil, nil, 172, nil, nil, nil, nil, 172, 172,
+ 47, nil, 172, nil, nil, 172, nil, nil, 48, 48,
+ nil, 47, 48, 172, 48, 47, 47, nil, nil, 47,
+ nil, nil, nil, nil, 47, 47, nil, nil, 47, nil,
+ 48, 47, nil, nil, 49, 49, nil, nil, 49, 47,
+ 49, 48, nil, nil, nil, 48, 48, nil, nil, 48,
+ 296, 296, nil, nil, 48, 48, 177, 177, 48, nil,
+ 177, 48, 177, nil, nil, nil, nil, 49, nil, 48,
+ nil, 49, 49, nil, nil, 49, nil, nil, 177, nil,
+ 49, 51, 51, 296, 49, 51, nil, 296, 296, 177,
+ nil, 296, nil, 177, 177, 49, 296, 177, nil, nil,
+ 296, nil, 177, 177, nil, nil, 177, 295, 295, 177,
+ nil, 296, nil, nil, 51, nil, nil, 177, 51, 51,
+ nil, nil, 51, nil, nil, nil, nil, 51, 231, 231,
+ nil, 51, 231, nil, 231, nil, nil, nil, nil, nil,
+ 295, nil, 51, nil, 295, 295, 233, 233, 295, nil,
+ 233, nil, 233, 295, nil, nil, nil, 295, nil, nil,
+ nil, 231, nil, nil, nil, 231, 231, nil, 295, 231,
+ nil, 170, 170, nil, 231, nil, nil, nil, 231, 233,
+ nil, nil, nil, 233, 233, nil, nil, 233, nil, 231,
+ nil, nil, 233, nil, 170, nil, 233, 288, 288, nil,
+ nil, 288, nil, 288, 170, nil, nil, 233, 170, 170,
+ nil, nil, 170, nil, nil, nil, 170, 170, 182, 182,
+ nil, 170, 182, nil, 182, nil, nil, nil, nil, nil,
+ 288, nil, 170, nil, 288, 288, nil, nil, 288, nil,
+ 182, nil, nil, 288, 70, 70, nil, 288, nil, nil,
+ nil, 182, nil, nil, nil, 182, 182, nil, 288, 182,
+ nil, nil, nil, nil, 182, 182, nil, 70, 182, 71,
+ 71, 182, nil, 71, nil, 71, nil, 70, nil, 182,
+ nil, 70, 70, nil, nil, 70, nil, nil, nil, 70,
+ 70, 71, nil, nil, 70, 180, 180, nil, nil, 180,
+ nil, 180, 71, nil, nil, 70, 71, 71, nil, nil,
+ 71, nil, nil, nil, nil, 71, 71, 180, nil, 71,
+ 112, 112, 71, nil, 112, nil, 112, nil, 180, nil,
+ 71, nil, 180, 180, 167, 167, 180, nil, nil, nil,
+ 167, 180, 180, nil, nil, 180, nil, nil, 180, nil,
+ nil, nil, nil, 112, nil, nil, 180, 112, 112, 78,
+ 78, 112, nil, 78, nil, 78, 112, 167, nil, nil,
+ 112, 167, 167, nil, nil, 167, nil, nil, 240, 240,
+ 167, 112, nil, nil, 167, nil, nil, nil, nil, nil,
+ nil, nil, 78, nil, nil, 167, 78, 78, nil, nil,
+ 78, 240, nil, 255, 255, 78, nil, nil, nil, 78,
+ nil, 240, nil, nil, nil, 240, 240, nil, nil, 240,
+ 78, 100, 100, 240, 240, 100, 100, 100, 240, nil,
+ nil, nil, nil, nil, nil, nil, 255, nil, nil, 240,
+ 255, 255, 260, 260, 255, nil, 260, nil, 260, 255,
+ nil, nil, nil, 255, 100, nil, nil, nil, 100, 100,
+ nil, nil, 100, nil, 255, nil, nil, 100, 181, 181,
+ nil, 100, 181, nil, 181, 260, nil, nil, nil, 260,
+ 260, nil, 100, 260, nil, nil, nil, nil, 260, nil,
+ 181, nil, 260, nil, 90, 90, nil, nil, 90, nil,
+ 90, 181, nil, 260, nil, 181, 181, nil, nil, 181,
+ nil, nil, nil, nil, 181, 181, 90, nil, 181, 161,
+ 161, 181, nil, 161, nil, 161, nil, 90, nil, 181,
+ nil, 90, 90, 166, 166, 90, nil, nil, nil, nil,
+ 90, 90, nil, nil, 90, nil, nil, 90, nil, nil,
+ nil, nil, 161, nil, nil, 90, 161, 161, nil, nil,
+ 161, nil, nil, nil, nil, 161, 166, nil, nil, 161,
+ 166, 166, nil, nil, 166, nil, nil, nil, 166, 166,
+ 161, 95, 95, 166, nil, 95, nil, 95, 277, 277,
+ 277, 277, 277, 277, 166, 277, 277, nil, 269, 269,
+ 269, 269, 277, 95, nil, 269, 269, 178, 178, nil,
+ nil, 178, 269, 178, 95, nil, nil, nil, 95, 95,
+ nil, nil, 95, nil, nil, nil, nil, 95, 95, 178,
+ nil, 95, nil, nil, 95, nil, nil, 99, 99, nil,
+ 178, 99, 95, 99, 178, 178, nil, nil, 178, nil,
+ nil, nil, nil, 178, 178, nil, nil, 178, nil, 99,
+ 178, nil, nil, 242, 242, nil, nil, 242, 178, 242,
+ 99, nil, nil, nil, 99, 99, nil, nil, 99, nil,
+ nil, nil, nil, 99, 99, 242, nil, 99, nil, nil,
+ 99, nil, nil, nil, nil, nil, 242, nil, 99, nil,
+ 242, 242, 91, nil, 242, nil, nil, nil, nil, 242,
+ 242, 91, 91, 242, nil, nil, 242, nil, nil, nil,
+ 91, 91, 91, 91, 242, nil, 129, 129, nil, nil,
+ nil, nil, nil, nil, nil, 129, 129, 129, 129, nil,
+ nil, nil, nil, nil, 91, 91, nil, nil, 91, 91,
+ 91, 91, 91, 91, nil, 91, 91, nil, nil, 129,
+ 129, nil, 91, 129, 129, 129, 129, 129, 129, nil,
+ 129, 129, 190, 190, nil, nil, nil, 129, nil, nil,
+ 190, 190, 190, 190, 190, nil, nil, 271, 271, nil,
+ nil, nil, nil, nil, nil, nil, 271, 271, 271, 271,
+ nil, nil, nil, nil, nil, 190, 190, nil, nil, 190,
+ 190, 190, 190, 190, 190, nil, 190, 190, nil, nil,
+ nil, 271, nil, 190, 271, 271, 271, 271, 271, 271,
+ nil, 271, 271, 131, 131, nil, nil, nil, 271, nil,
+ nil, nil, 131, 131, 131, 131, nil, nil, 132, 132,
+ nil, nil, nil, nil, nil, nil, nil, 132, 132, 132,
+ 132, nil, nil, nil, nil, nil, 131, 131, nil, nil,
+ 131, 131, 131, 131, 131, 131, nil, 131, 131, nil,
+ nil, 132, 132, nil, 131, 132, 132, 132, 132, 132,
+ 132, nil, 132, 132, 275, 275, nil, nil, nil, 132,
+ nil, nil, nil, 275, 275, 275, 275, nil, nil, 279,
+ 276, 279, 279, nil, 279, 279, nil, 279, 276, 279,
+ nil, 279, nil, 279, nil, nil, 279, 279, nil, 270,
+ nil, 275, 275, 275, 275, 275, 275, 270, 275, 275,
+ nil, nil, nil, nil, 272, 275, 276, 276, 276, 276,
+ 276, 276, 272, 276, 276, nil, nil, nil, nil, nil,
+ 276, nil, nil, nil, nil, 270, 270, 270, 270, 270,
+ 270, nil, 270, 270, 188, nil, nil, nil, nil, 270,
+ 272, 272, 272, 272, 272, 272, nil, 272, 272, nil,
+ nil, nil, nil, 363, 272, 188, nil, 188, 188, nil,
+ 188, 188, nil, 188, nil, 188, nil, 188, nil, 188,
+ nil, nil, 188, 188, 363, 312, 363, 363, nil, 363,
+ 363, nil, 363, nil, 363, nil, 363, nil, 363, nil,
+ nil, 363, 363, nil, 376, nil, 312, nil, 312, 312,
+ nil, 312, 312, nil, 312, nil, 312, nil, 312, nil,
+ 312, nil, nil, 312, 312, 376, 217, 376, 376, nil,
+ 376, 376, nil, 376, nil, 376, nil, 376, nil, 376,
+ nil, nil, 376, 376, nil, 373, nil, 217, nil, 217,
+ 217, nil, 217, 217, nil, 217, nil, 217, nil, 217,
+ nil, 217, nil, nil, 217, 217, 373, 238, 373, 373,
+ nil, 373, 373, nil, 373, nil, 373, nil, 373, nil,
+ 373, nil, nil, 373, 373, nil, nil, nil, 238, nil,
+ 238, 238, nil, 238, 238, nil, 238, nil, 238, nil,
+ 238, nil, 238, nil, nil, 238, 238, 20, nil, 20,
+ 20, nil, 20, 20, nil, 20, nil, 20, nil, 20,
+ nil, 20, nil, nil, 20, 20, 0, nil, 0, 0,
+ nil, 0, 0, nil, 0, nil, 0, nil, 0, nil,
+ 0, nil, nil, 0, 0, 268, 268, 268, 268, 268,
+ 268, nil, 268, 268, nil, nil, nil, nil, nil, 268 ]
racc_action_pointer = [
- 1674, 54, 417, 341, 399, 434, 455, nil, 262, nil,
- nil, 112, 404, 402, nil, nil, nil, 395, 16, nil,
- 1693, nil, nil, 268, nil, nil, 293, -1, nil, 341,
- nil, 425, 381, 181, nil, nil, nil, 342, nil, nil,
- nil, nil, 246, nil, nil, 445, 200, 501, 159, 557,
- 305, 575, 283, 321, nil, nil, -6, nil, nil, nil,
- nil, nil, nil, nil, 291, 265, 273, nil, nil, nil,
- 703, 750, nil, nil, 269, 242, nil, 212, 840, nil,
- 208, 2, 68, 64, nil, 37, nil, 186, nil, 275,
- 1039, 1261, nil, nil, 279, 1125, nil, nil, nil, 1151,
- 1176, 287, 289, 161, nil, 295, 315, 317, 323, nil,
- 343, 116, 652, 315, 78, 350, 361, nil, nil, 374,
- nil, 379, 81, nil, nil, nil, nil, 382, nil, 1444,
- nil, 1383, 1337, 391, 376, nil, 394, nil, nil, nil,
- 389, 408, 440, 314, 38, nil, 447, 436, nil, nil,
- nil, nil, nil, nil, -8, 420, nil, 37, 0, 418,
- nil, 80, nil, 87, -4, nil, 287, 351, nil, 302,
- 376, nil, 419, 475, 531, 26, 582, 633, 801, 927,
- 1228, 983, 1069, 256, 1095, 957, 1202, 243, 1532, 1013,
- 1276, nil, 115, nil, 21, nil, nil, 186, nil, nil,
- 131, 254, nil, 74, nil, nil, 1, nil, nil, nil,
- nil, 360, 249, 10, -13, 909, 85, 1655, 80, 82,
- 106, 112, nil, nil, 181, 194, nil, 194, 879, 170,
- 215, 865, 192, 826, 199, 235, nil, nil, 1551, 8,
- 775, nil, 724, nil, nil, nil, nil, nil, nil, 270,
- nil, nil, 259, nil, 677, nil, nil, nil, nil, 659,
- nil, 59, 118, 116, 223, nil, 1716, 1707, 1725, 1459,
- 1398, 1493, 49, nil, 1322, 1478, 1425, nil, 1712, 343,
- 159, 307, nil, 353, nil, 8, nil, 394, 365, nil,
- 110, nil, nil, -9, 322, 203, nil, 383, nil, 224,
- nil, -8, nil, nil, 400, nil, 217, 210, nil, 109,
- nil, 1573, nil, nil, nil, nil, nil, nil, nil, nil,
- 406, nil, nil, nil, 411, nil, nil, nil, nil, 152,
- nil, 135, nil, nil, 135, 133, nil, 427, nil, nil,
- nil, nil, 427, nil, nil, nil, 415, 417, nil, 418,
- 421, 422, nil, nil, nil, nil, 90, 442, nil, nil,
- nil, nil, 1633, nil, nil, nil, nil, 446, 33, 451,
- nil, nil, 1614, nil, nil, 1592, nil, nil, nil, 463,
- nil, 464, nil, nil, nil ]
+ 1726, 123, 450, 384, 418, 461, 341, nil, 251, nil,
+ nil, -20, 446, 434, nil, nil, nil, 433, 0, nil,
+ 1707, nil, nil, 301, nil, nil, 326, 11, nil, 374,
+ nil, 306, 7, 320, nil, nil, nil, 403, nil, nil,
+ nil, nil, 295, nil, nil, 520, 170, 576, 606, 632,
+ 400, 679, 378, 416, nil, nil, -6, nil, nil, nil,
+ nil, nil, nil, nil, 389, 388, 396, nil, nil, 393,
+ 842, 867, nil, nil, 388, 376, nil, 363, 957, nil,
+ 362, 2, 340, 356, nil, 336, nil, 334, nil, 323,
+ 1092, 1294, nil, nil, 322, 1179, 333, nil, nil, 1235,
+ 1019, 314, 299, 1, nil, 298, 296, 288, 278, nil,
+ 286, 76, 918, 242, 176, 256, 238, nil, nil, 228,
+ nil, 185, 133, nil, nil, nil, nil, 97, nil, 1309,
+ nil, 1416, 1431, 90, 46, nil, -8, nil, 423, nil,
+ 285, 310, 381, 409, 91, nil, 422, 433, nil, nil,
+ nil, nil, nil, nil, 19, 477, nil, 5, 19, 484,
+ nil, 1117, nil, 95, -4, nil, 1131, 932, nil, 305,
+ 769, nil, 550, 494, 438, 199, 180, 654, 1205, 464,
+ 893, 1066, 816, 411, 275, 132, 84, 368, 1565, 36,
+ 1355, nil, 187, nil, 259, nil, nil, 151, nil, nil,
+ 27, 333, nil, 69, nil, nil, 80, nil, nil, nil,
+ nil, 340, 61, 66, -17, 250, 99, 1647, 131, 133,
+ 135, 119, nil, nil, 169, 248, nil, 204, 352, 204,
+ 239, 726, 216, 744, 230, 267, nil, nil, 1688, 280,
+ 976, nil, 1261, nil, nil, nil, nil, nil, nil, nil,
+ 295, nil, nil, 284, nil, 1001, nil, nil, nil, nil,
+ 1040, nil, 100, 165, 81, 163, nil, 218, 1721, 1144,
+ 1511, 1370, 1526, 96, nil, 1477, 1492, 1134, nil, 1479,
+ 381, 145, 135, nil, 389, nil, 9, nil, 795, 398,
+ nil, 70, nil, nil, 45, 705, 648, nil, 412, nil,
+ 26, nil, 125, nil, nil, 419, nil, 417, 395, nil,
+ 150, nil, 1606, nil, nil, nil, nil, nil, nil, nil,
+ nil, 424, nil, nil, nil, 430, nil, nil, nil, nil,
+ 257, nil, 25, nil, nil, 206, 206, nil, 447, nil,
+ nil, nil, nil, 450, nil, nil, nil, 438, 440, nil,
+ 441, 445, 448, nil, nil, nil, nil, 126, 467, nil,
+ nil, nil, nil, 1584, nil, nil, nil, nil, 470, 78,
+ 482, nil, nil, 1666, nil, nil, 1625, nil, nil, nil,
+ 486, nil, 489, nil, nil, nil ]
racc_action_default = [
- -197, -234, -51, -19, -8, -234, -234, -9, -234, -10,
- -188, -189, -234, -23, -11, -186, -12, -234, -234, -13,
- -1, -14, -2, -187, -15, -3, -234, -234, -16, -234,
- -17, -6, -234, -234, -18, -7, -189, -197, -187, -52,
- -27, -28, -234, -25, -26, -234, -234, -234, -234, -234,
- -197, -86, -93, -234, -196, -194, -197, -190, -192, -193,
- -222, -195, -4, -42, -232, -43, -214, -175, -118, -44,
- -234, -234, -45, -34, -75, -32, -33, -234, -234, -123,
- -37, -74, -38, -234, -73, -39, -173, -40, -174, -41,
- -234, -234, -126, -108, -104, -234, -112, -133, -113, -234,
- -234, -105, -109, -234, -111, -106, -115, -107, -114, -110,
- -54, -197, -234, -86, -197, -234, -179, -176, -177, -234,
- -50, -234, -198, -199, -24, -21, -23, -187, -22, -84,
- -20, -83, -85, -234, -197, -79, -76, -87, -82, -75,
- -71, -77, -220, -80, -74, -69, -78, -234, -172, -171,
- -81, -91, -92, -94, -234, -220, 385, -234, -234, -234,
- -208, -234, -31, -234, -234, -119, -234, -234, -96, -234,
- -234, -143, -234, -234, -234, -234, -234, -234, -234, -234,
- -234, -234, -234, -234, -234, -234, -234, -234, -234, -234,
- -234, -150, -234, -217, -234, -230, -226, -234, -229, -225,
- -93, -234, -214, -197, -58, -60, -234, -67, -57, -74,
- -66, -234, -220, -234, -234, -234, -234, -234, -207, -205,
- -234, -234, -202, -231, -234, -234, -210, -234, -72, -221,
- -234, -234, -86, -234, -221, -234, -191, -209, -234, -234,
- -234, -29, -234, -121, -120, -36, -35, -169, -167, -234,
- -170, -161, -74, -168, -234, -162, -218, -219, -124, -234,
- -117, -234, -138, -140, -139, -134, -141, -145, -142, -147,
- -152, -149, -146, -135, -151, -148, -144, -136, -5, -234,
- -129, -137, -153, -219, -215, -234, -223, -234, -220, -55,
- -234, -63, -62, -234, -234, -234, -125, -234, -56, -234,
- -155, -234, -159, -178, -234, -181, -234, -234, -200, -234,
- -201, -234, -212, -213, -211, -46, -70, -88, -47, -89,
- -220, -90, -95, -49, -234, -185, -233, -30, -122, -234,
- -164, -220, -97, -116, -129, -234, -128, -234, -216, -227,
- -224, -228, -234, -59, -61, -102, -98, -99, -64, -103,
- -100, -101, -65, -48, -156, -154, -234, -234, -180, -206,
- -204, -203, -234, -183, -68, -184, -166, -219, -234, -234,
- -127, -130, -234, -53, -160, -234, -182, -165, -163, -234,
- -132, -234, -158, -131, -157 ]
+ -198, -235, -51, -19, -8, -235, -235, -9, -235, -10,
+ -189, -190, -235, -23, -11, -187, -12, -235, -235, -13,
+ -1, -14, -2, -188, -15, -3, -235, -235, -16, -235,
+ -17, -6, -235, -235, -18, -7, -190, -198, -188, -52,
+ -27, -28, -235, -25, -26, -235, -235, -235, -235, -235,
+ -198, -86, -93, -235, -197, -195, -198, -191, -193, -194,
+ -223, -196, -4, -42, -233, -43, -215, -176, -118, -44,
+ -235, -235, -45, -34, -75, -32, -33, -235, -235, -123,
+ -37, -74, -38, -235, -73, -39, -173, -40, -175, -41,
+ -235, -235, -126, -108, -104, -235, -112, -133, -113, -235,
+ -235, -105, -109, -235, -111, -106, -115, -107, -114, -110,
+ -54, -198, -235, -86, -198, -235, -180, -177, -178, -235,
+ -50, -235, -199, -200, -24, -21, -23, -188, -22, -84,
+ -20, -83, -85, -235, -198, -79, -76, -87, -82, -75,
+ -71, -77, -221, -80, -74, -69, -78, -235, -172, -171,
+ -81, -91, -92, -94, -235, -221, 386, -235, -235, -235,
+ -209, -235, -31, -235, -235, -119, -235, -235, -96, -235,
+ -235, -143, -235, -235, -235, -235, -235, -235, -235, -235,
+ -235, -235, -235, -235, -235, -235, -235, -235, -235, -235,
+ -235, -150, -235, -218, -235, -231, -227, -235, -230, -226,
+ -93, -235, -215, -198, -58, -60, -235, -67, -57, -74,
+ -66, -235, -221, -235, -235, -235, -235, -235, -208, -206,
+ -235, -235, -203, -232, -235, -235, -211, -235, -72, -222,
+ -235, -235, -86, -235, -222, -235, -192, -210, -235, -235,
+ -235, -29, -235, -121, -120, -36, -35, -174, -169, -167,
+ -235, -170, -161, -74, -168, -235, -162, -219, -220, -124,
+ -235, -117, -235, -138, -140, -139, -134, -141, -145, -142,
+ -147, -152, -149, -146, -135, -151, -148, -144, -136, -5,
+ -235, -129, -137, -153, -220, -216, -235, -224, -235, -221,
+ -55, -235, -63, -62, -235, -235, -235, -125, -235, -56,
+ -235, -155, -235, -159, -179, -235, -182, -235, -235, -201,
+ -235, -202, -235, -213, -214, -212, -46, -70, -88, -47,
+ -89, -221, -90, -95, -49, -235, -186, -234, -30, -122,
+ -235, -164, -221, -97, -116, -129, -235, -128, -235, -217,
+ -228, -225, -229, -235, -59, -61, -102, -98, -99, -64,
+ -103, -100, -101, -65, -48, -156, -154, -235, -235, -181,
+ -207, -205, -204, -235, -184, -68, -185, -166, -220, -235,
+ -235, -127, -130, -235, -53, -160, -235, -183, -165, -163,
+ -235, -132, -235, -158, -131, -157 ]
racc_goto_table = [
- 27, 13, 5, 37, 62, 255, 249, 20, 118, 196,
- 92, 89, 142, 50, 155, 300, 69, 63, 222, 336,
- 27, 13, 5, 165, 73, 75, 57, 279, 348, 352,
- 246, 151, 145, 119, 343, 150, 121, 230, 65, 149,
- 299, 22, 27, 126, 138, 135, 27, 126, 201, 134,
- 235, 214, 120, 87, 302, 86, 304, 244, 89, 42,
- 169, 128, 46, 69, 63, 128, 136, 251, 368, 331,
- 322, 73, 163, 370, 212, 125, 124, 324, 123, 130,
- 124, 148, 192, 86, 116, 65, 140, 224, 56, 159,
- 227, 123, 330, 249, 211, 237, 220, 160, 221, 354,
- 87, 110, 86, 115, 246, 314, 194, 297, 17, nil,
- nil, nil, nil, nil, nil, nil, nil, nil, 195, nil,
- nil, nil, nil, 133, nil, nil, nil, nil, nil, nil,
- nil, nil, nil, nil, 54, nil, nil, nil, 302, nil,
- 293, nil, nil, nil, nil, nil, nil, nil, nil, nil,
- nil, nil, 168, nil, 89, 149, nil, nil, 89, 69,
- 63, nil, 288, 69, 63, 236, nil, 245, nil, nil,
- nil, 73, 261, 82, 168, 226, nil, nil, nil, 151,
- nil, 65, 247, 342, nil, 65, 168, nil, 27, 13,
- 5, 339, 303, 320, 328, 374, 87, 148, 86, 86,
- 87, 143, 86, 149, 80, 361, 377, 249, 317, 316,
- nil, 379, 150, 151, 381, 364, 149, 27, 13, 5,
- 82, 138, 135, nil, nil, nil, 369, 312, 89, nil,
- 247, nil, 141, 69, 63, 239, nil, nil, 27, 13,
- 5, 245, 149, 136, nil, 148, nil, 86, nil, 265,
- nil, 80, nil, nil, nil, 65, nil, nil, 148, nil,
- 86, 210, 62, nil, 210, nil, nil, nil, 85, 247,
- 87, nil, 86, 54, 54, nil, nil, nil, 27, 13,
- 5, nil, 149, 149, 148, nil, 86, 149, 345, 345,
- nil, nil, 207, nil, nil, 207, 146, nil, nil, 273,
- 195, nil, nil, 277, nil, 319, nil, 321, nil, 346,
- 346, 27, 13, 5, 247, 85, 82, 250, 362, 371,
- 82, nil, nil, nil, 351, 351, 86, 86, nil, 148,
- nil, 86, nil, 332, nil, nil, nil, nil, nil, nil,
- nil, nil, nil, nil, 149, nil, 62, 80, 248, nil,
- nil, 80, nil, 210, nil, nil, 149, nil, nil, nil,
- nil, 341, 27, 13, 5, 250, nil, nil, nil, nil,
- nil, 247, 27, 13, 5, 27, 13, 5, 143, nil,
- 359, 360, nil, 247, 207, nil, 148, nil, 86, nil,
- 82, nil, 129, nil, 131, 132, 248, nil, 148, nil,
- 86, nil, nil, 366, 250, nil, nil, nil, nil, 141,
- nil, 85, 253, nil, nil, 85, nil, nil, 164, nil,
- nil, 80, nil, nil, nil, nil, nil, nil, nil, nil,
- nil, nil, nil, nil, nil, 248, nil, 171, nil, nil,
- 210, nil, 190, nil, 349, 349, 191, nil, nil, 250,
- nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
- 253, nil, nil, nil, nil, nil, nil, nil, nil, nil,
- nil, 207, nil, 146, nil, 347, 347, nil, nil, nil,
- 248, nil, nil, nil, nil, 85, nil, nil, nil, nil,
- nil, nil, nil, nil, nil, nil, nil, nil, nil, 253,
- nil, nil, nil, nil, nil, nil, 250, nil, nil, nil,
- nil, nil, nil, nil, nil, nil, nil, nil, 250, 262,
- 263, 264, nil, 266, 267, 268, 269, 270, 271, 272,
- nil, 274, 275, 276, nil, nil, 281, 248, nil, 350,
- 350, nil, nil, nil, 253, nil, nil, nil, nil, 248,
+ 27, 13, 20, 222, 89, 92, 115, 37, 62, 5,
+ 65, 196, 256, 145, 230, 150, 118, 50, 155, 301,
+ 27, 13, 246, 75, 73, 57, 133, 235, 201, 5,
+ 250, 214, 149, 119, 337, 165, 121, 344, 136, 69,
+ 169, 120, 27, 126, 142, 22, 27, 126, 300, 134,
+ 128, 89, 63, 151, 128, 168, 125, 65, 280, 124,
+ 130, 42, 192, 124, 46, 349, 353, 138, 244, 87,
+ 163, 73, 252, 369, 211, 332, 323, 168, 303, 116,
+ 135, 140, 123, 224, 298, 56, 69, 305, 371, 168,
+ 195, 159, 227, 237, 220, 123, 246, 148, 221, 63,
+ 331, 160, 110, 315, 355, 194, 212, 17, 325, nil,
+ nil, 86, nil, nil, nil, nil, 87, nil, 250, nil,
+ 294, nil, nil, nil, nil, nil, nil, nil, nil, nil,
+ nil, nil, nil, nil, nil, nil, nil, nil, 239, 86,
+ nil, nil, nil, nil, nil, nil, nil, 89, 149, nil,
+ nil, 89, 266, 65, 248, nil, nil, 65, 86, nil,
+ nil, 343, nil, 303, 236, nil, 289, 245, nil, nil,
+ 262, 73, nil, nil, nil, 82, 247, nil, nil, 226,
+ nil, nil, 69, nil, nil, nil, 69, nil, 27, 13,
+ 317, 362, 150, 365, 340, 63, 149, 5, nil, 63,
+ 304, 151, 248, 143, 370, 85, 329, nil, 320, 149,
+ 322, nil, 87, 148, 378, 136, 87, 27, 13, nil,
+ 375, 89, 82, nil, 247, 321, 5, 65, nil, 54,
+ 318, 313, 250, 146, nil, 151, 149, 333, 27, 13,
+ nil, 245, 248, 380, 138, nil, 382, 5, nil, nil,
+ nil, nil, 85, nil, 86, 86, 69, 135, 86, nil,
+ nil, 148, nil, 210, 247, 342, 210, 62, nil, 63,
+ 80, nil, nil, 195, 148, nil, 149, 149, nil, 27,
+ 13, 149, 347, 347, 360, 361, 87, 248, 5, nil,
+ nil, nil, nil, nil, nil, nil, nil, nil, 141, nil,
+ nil, 148, nil, 86, 247, 247, nil, 367, nil, 247,
+ nil, nil, 27, 13, 363, 372, 86, 80, 82, 251,
+ nil, 5, 82, nil, 346, 346, nil, nil, 86, nil,
+ nil, nil, nil, nil, nil, nil, nil, nil, 149, nil,
+ nil, 352, 352, 86, 248, nil, 148, nil, 85, 254,
+ 149, 62, 85, nil, nil, 210, 248, nil, 207, nil,
+ nil, 207, nil, 27, 13, nil, 247, 251, 54, 54,
+ nil, nil, 5, 27, 13, nil, 27, 13, 247, nil,
+ 143, nil, 5, 86, 86, 5, nil, nil, 86, nil,
+ nil, nil, 82, nil, 274, nil, nil, 254, 278, nil,
+ nil, nil, nil, 148, nil, nil, nil, 251, nil, nil,
+ 146, nil, nil, 80, 249, 148, nil, 80, nil, nil,
+ nil, nil, 85, nil, nil, nil, nil, nil, nil, 129,
+ nil, 131, 132, nil, nil, nil, nil, 254, nil, nil,
+ nil, nil, nil, 210, nil, 86, nil, 350, 350, nil,
+ 207, nil, 251, nil, nil, 164, nil, 86, nil, nil,
+ nil, nil, 249, nil, nil, nil, nil, nil, nil, nil,
+ nil, nil, nil, nil, 171, 141, nil, 351, 351, 190,
+ nil, nil, 254, 191, nil, nil, nil, 80, nil, nil,
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
+ nil, nil, 249, nil, nil, nil, nil, nil, nil, 251,
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
+ nil, 251, nil, nil, nil, nil, nil, nil, nil, nil,
+ nil, nil, nil, nil, nil, nil, nil, nil, 207, 254,
+ nil, nil, 348, 348, nil, nil, nil, 249, nil, nil,
+ nil, 254, nil, nil, nil, nil, 263, 264, 265, nil,
+ 267, 268, 269, 270, 271, 272, 273, nil, 275, 276,
+ 277, nil, nil, 282, nil, nil, nil, nil, nil, nil,
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
- nil, nil, nil, nil, nil, nil, nil, nil, nil, 164,
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
- nil, 253, nil, nil, nil, nil, nil, nil, nil, nil,
- nil, nil, nil, 253 ]
+ nil, nil, nil, nil, 249, nil, nil, nil, nil, nil,
+ nil, nil, nil, nil, nil, nil, 249, nil, nil, nil,
+ nil, nil, nil, nil, nil, nil, 164 ]
racc_goto_check = [
- 38, 22, 53, 33, 4, 71, 69, 2, 73, 86,
- 63, 29, 36, 33, 39, 67, 32, 30, 83, 64,
- 38, 22, 53, 61, 22, 23, 79, 5, 47, 47,
- 24, 54, 48, 38, 43, 51, 75, 37, 31, 29,
- 66, 3, 38, 22, 32, 30, 38, 22, 42, 75,
- 37, 42, 6, 28, 69, 50, 5, 62, 29, 21,
- 58, 6, 21, 32, 30, 6, 31, 70, 59, 72,
- 57, 22, 23, 64, 36, 20, 8, 5, 3, 20,
- 8, 28, 58, 50, 74, 31, 34, 76, 77, 78,
- 35, 3, 71, 69, 58, 80, 81, 3, 82, 67,
- 28, 41, 50, 55, 24, 84, 85, 37, 1, nil,
- nil, nil, nil, nil, nil, nil, nil, nil, 31, nil,
- nil, nil, nil, 55, nil, nil, nil, nil, nil, nil,
- nil, nil, nil, nil, 65, nil, nil, nil, 69, nil,
+ 38, 22, 2, 83, 29, 63, 55, 33, 4, 53,
+ 31, 86, 71, 48, 37, 51, 73, 33, 39, 67,
+ 38, 22, 24, 23, 22, 79, 55, 37, 42, 53,
+ 69, 42, 29, 38, 64, 61, 75, 43, 31, 32,
+ 58, 6, 38, 22, 36, 3, 38, 22, 66, 75,
+ 6, 29, 30, 54, 6, 55, 20, 31, 5, 8,
+ 20, 21, 58, 8, 21, 47, 47, 32, 62, 28,
+ 23, 22, 70, 59, 58, 72, 57, 55, 69, 74,
+ 30, 34, 3, 76, 37, 77, 32, 5, 64, 55,
+ 31, 78, 35, 80, 81, 3, 24, 28, 82, 30,
+ 71, 3, 41, 84, 67, 85, 36, 1, 5, nil,
+ nil, 50, nil, nil, nil, nil, 28, nil, 69, nil,
42, nil, nil, nil, nil, nil, nil, nil, nil, nil,
- nil, nil, 55, nil, 29, 29, nil, nil, 29, 32,
- 30, nil, 39, 32, 30, 79, nil, 22, nil, nil,
- nil, 22, 23, 26, 55, 3, nil, nil, nil, 54,
- nil, 31, 31, 37, nil, 31, 55, nil, 38, 22,
- 53, 86, 73, 36, 61, 69, 28, 28, 50, 50,
- 28, 26, 50, 29, 25, 83, 71, 69, 54, 48,
- nil, 5, 51, 54, 5, 37, 29, 38, 22, 53,
- 26, 32, 30, nil, nil, nil, 37, 33, 29, nil,
- 31, nil, 25, 32, 30, 55, nil, nil, 38, 22,
- 53, 22, 29, 31, nil, 28, nil, 50, nil, 55,
- nil, 25, nil, nil, nil, 31, nil, nil, 28, nil,
- 50, 26, 4, nil, 26, nil, nil, nil, 27, 31,
- 28, nil, 50, 65, 65, nil, nil, nil, 38, 22,
- 53, nil, 29, 29, 28, nil, 50, 29, 30, 30,
- nil, nil, 25, nil, nil, 25, 27, nil, nil, 65,
- 31, nil, nil, 65, nil, 55, nil, 55, nil, 31,
- 31, 38, 22, 53, 31, 27, 26, 26, 2, 63,
- 26, nil, nil, nil, 28, 28, 50, 50, nil, 28,
- nil, 50, nil, 55, nil, nil, nil, nil, nil, nil,
- nil, nil, nil, nil, 29, nil, 4, 25, 25, nil,
- nil, 25, nil, 26, nil, nil, 29, nil, nil, nil,
- nil, 55, 38, 22, 53, 26, nil, nil, nil, nil,
- nil, 31, 38, 22, 53, 38, 22, 53, 26, nil,
- 55, 55, nil, 31, 25, nil, 28, nil, 50, nil,
- 26, nil, 52, nil, 52, 52, 25, nil, 28, nil,
- 50, nil, nil, 55, 26, nil, nil, nil, nil, 25,
- nil, 27, 27, nil, nil, 27, nil, nil, 52, nil,
- nil, 25, nil, nil, nil, nil, nil, nil, nil, nil,
- nil, nil, nil, nil, nil, 25, nil, 52, nil, nil,
- 26, nil, 52, nil, 26, 26, 52, nil, nil, 26,
+ nil, nil, nil, nil, nil, nil, nil, nil, 55, 50,
+ nil, nil, nil, nil, nil, nil, nil, 29, 29, nil,
+ nil, 29, 55, 31, 31, nil, nil, 31, 50, nil,
+ nil, 37, nil, 69, 79, nil, 39, 22, nil, nil,
+ 23, 22, nil, nil, nil, 26, 53, nil, nil, 3,
+ nil, nil, 32, nil, nil, nil, 32, nil, 38, 22,
+ 48, 83, 51, 37, 86, 30, 29, 53, nil, 30,
+ 73, 54, 31, 26, 37, 27, 61, nil, 55, 29,
+ 55, nil, 28, 28, 71, 31, 28, 38, 22, nil,
+ 69, 29, 26, nil, 53, 36, 53, 31, nil, 65,
+ 54, 33, 69, 27, nil, 54, 29, 55, 38, 22,
+ nil, 22, 31, 5, 32, nil, 5, 53, nil, nil,
+ nil, nil, 27, nil, 50, 50, 32, 30, 50, nil,
+ nil, 28, nil, 26, 53, 55, 26, 4, nil, 30,
+ 25, nil, nil, 31, 28, nil, 29, 29, nil, 38,
+ 22, 29, 31, 31, 55, 55, 28, 31, 53, nil,
+ nil, nil, nil, nil, nil, nil, nil, nil, 25, nil,
+ nil, 28, nil, 50, 53, 53, nil, 55, nil, 53,
+ nil, nil, 38, 22, 2, 63, 50, 25, 26, 26,
+ nil, 53, 26, nil, 30, 30, nil, nil, 50, nil,
+ nil, nil, nil, nil, nil, nil, nil, nil, 29, nil,
+ nil, 28, 28, 50, 31, nil, 28, nil, 27, 27,
+ 29, 4, 27, nil, nil, 26, 31, nil, 25, nil,
+ nil, 25, nil, 38, 22, nil, 53, 26, 65, 65,
+ nil, nil, 53, 38, 22, nil, 38, 22, 53, nil,
+ 26, nil, 53, 50, 50, 53, nil, nil, 50, nil,
+ nil, nil, 26, nil, 65, nil, nil, 27, 65, nil,
+ nil, nil, nil, 28, nil, nil, nil, 26, nil, nil,
+ 27, nil, nil, 25, 25, 28, nil, 25, nil, nil,
+ nil, nil, 27, nil, nil, nil, nil, nil, nil, 52,
+ nil, 52, 52, nil, nil, nil, nil, 27, nil, nil,
+ nil, nil, nil, 26, nil, 50, nil, 26, 26, nil,
+ 25, nil, 26, nil, nil, 52, nil, 50, nil, nil,
+ nil, nil, 25, nil, nil, nil, nil, nil, nil, nil,
+ nil, nil, nil, nil, 52, 25, nil, 27, 27, 52,
+ nil, nil, 27, 52, nil, nil, nil, 25, nil, nil,
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
- 27, nil, nil, nil, nil, nil, nil, nil, nil, nil,
- nil, 25, nil, 27, nil, 25, 25, nil, nil, nil,
- 25, nil, nil, nil, nil, 27, nil, nil, nil, nil,
- nil, nil, nil, nil, nil, nil, nil, nil, nil, 27,
- nil, nil, nil, nil, nil, nil, 26, nil, nil, nil,
- nil, nil, nil, nil, nil, nil, nil, nil, 26, 52,
- 52, 52, nil, 52, 52, 52, 52, 52, 52, 52,
- nil, 52, 52, 52, nil, nil, 52, 25, nil, 27,
- 27, nil, nil, nil, 27, nil, nil, nil, nil, 25,
+ nil, nil, 25, nil, nil, nil, nil, nil, nil, 26,
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
+ nil, 26, nil, nil, nil, nil, nil, nil, nil, nil,
+ nil, nil, nil, nil, nil, nil, nil, nil, 25, 27,
+ nil, nil, 25, 25, nil, nil, nil, 25, nil, nil,
+ nil, 27, nil, nil, nil, nil, 52, 52, 52, nil,
+ 52, 52, 52, 52, 52, 52, 52, nil, 52, 52,
+ 52, nil, nil, 52, nil, nil, nil, nil, nil, nil,
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
- nil, nil, nil, nil, nil, nil, nil, nil, nil, 52,
- nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
- nil, 27, nil, nil, nil, nil, nil, nil, nil, nil,
- nil, nil, nil, 27 ]
+ nil, nil, nil, nil, 25, nil, nil, nil, nil, nil,
+ nil, nil, nil, nil, nil, nil, 25, nil, nil, nil,
+ nil, nil, nil, nil, nil, nil, 52 ]
racc_goto_pointer = [
- nil, 108, 7, 41, -16, -161, 19, nil, 34, nil,
+ nil, 107, 2, 45, -12, -130, 8, nil, 17, nil,
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
- 33, 56, 1, 2, -136, 181, 150, 245, 30, -12,
- -6, 15, -7, 2, 35, -50, -39, -105, 0, -38,
- nil, 74, -63, -256, nil, nil, nil, -266, -19, nil,
- 32, -16, 347, 2, -21, 74, nil, -164, -18, -263,
- nil, -48, -107, -16, -261, 116, -175, -200, nil, -161,
- -100, -162, -185, -24, 52, -1, -47, 70, 33, 8,
- -63, -26, -24, -104, -120, 3, -94, nil ]
+ 14, 58, 1, 0, -144, 247, 152, 182, 46, -19,
+ 29, -13, 16, 6, 30, -48, -7, -128, 0, -34,
+ nil, 75, -83, -254, nil, nil, nil, -230, -38, nil,
+ 88, -36, 384, 9, 1, -23, nil, -158, -38, -259,
+ nil, -36, -96, -21, -247, 211, -167, -196, nil, -137,
+ -95, -155, -180, -16, 47, -1, -51, 67, 35, 7,
+ -65, -28, -24, -119, -122, 2, -92, nil ]
racc_goto_default = [
- nil, nil, 278, 208, 25, nil, 31, 35, 4, 7,
+ nil, nil, 279, 208, 25, nil, 31, 35, 4, 7,
9, 14, 16, 19, 21, 24, 28, 30, 34, 3,
6, nil, 98, nil, 76, 101, 102, 105, 107, 108,
93, 94, 96, 12, nil, nil, nil, nil, 83, nil,
- 33, nil, nil, 204, 290, 205, 206, nil, nil, 147,
- 106, 109, 91, 64, 137, 97, 152, 153, nil, 259,
- 104, nil, nil, nil, nil, 67, nil, nil, 301, 77,
+ 33, nil, nil, 204, 291, 205, 206, nil, nil, 147,
+ 106, 109, 91, 64, 137, 97, 152, 153, nil, 260,
+ 104, nil, nil, nil, nil, 67, nil, nil, 302, 77,
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
58, nil, nil, nil, nil, nil, nil, 197 ]
-racc_token_table = {
- false => 0,
- Object.new => 1,
- :STRING => 2,
- :DQPRE => 3,
- :DQMID => 4,
- :DQPOST => 5,
- :LBRACK => 6,
- :RBRACK => 7,
- :LBRACE => 8,
- :RBRACE => 9,
- :SYMBOL => 10,
- :FARROW => 11,
- :COMMA => 12,
- :TRUE => 13,
- :FALSE => 14,
- :EQUALS => 15,
- :APPENDS => 16,
- :LESSEQUAL => 17,
- :NOTEQUAL => 18,
- :DOT => 19,
- :COLON => 20,
- :LLCOLLECT => 21,
- :RRCOLLECT => 22,
- :QMARK => 23,
- :LPAREN => 24,
- :RPAREN => 25,
- :ISEQUAL => 26,
- :GREATEREQUAL => 27,
- :GREATERTHAN => 28,
- :LESSTHAN => 29,
- :IF => 30,
- :ELSE => 31,
- :IMPORT => 32,
- :DEFINE => 33,
- :ELSIF => 34,
- :VARIABLE => 35,
- :CLASS => 36,
- :INHERITS => 37,
- :NODE => 38,
- :BOOLEAN => 39,
- :NAME => 40,
- :SEMIC => 41,
- :CASE => 42,
- :DEFAULT => 43,
- :AT => 44,
- :LCOLLECT => 45,
- :RCOLLECT => 46,
- :CLASSNAME => 47,
- :CLASSREF => 48,
- :NOT => 49,
- :OR => 50,
- :AND => 51,
- :UNDEF => 52,
- :PARROW => 53,
- :PLUS => 54,
- :MINUS => 55,
- :TIMES => 56,
- :DIV => 57,
- :LSHIFT => 58,
- :RSHIFT => 59,
- :UMINUS => 60,
- :MATCH => 61,
- :NOMATCH => 62,
- :REGEX => 63,
- :IN_EDGE => 64,
- :OUT_EDGE => 65,
- :IN_EDGE_SUB => 66,
- :OUT_EDGE_SUB => 67,
- :IN => 68 }
+racc_reduce_table = [
+ 0, 0, :racc_error,
+ 1, 70, :_reduce_none,
+ 1, 70, :_reduce_none,
+ 1, 71, :_reduce_3,
+ 2, 71, :_reduce_4,
+ 1, 74, :_reduce_5,
+ 1, 73, :_reduce_none,
+ 1, 73, :_reduce_none,
+ 1, 73, :_reduce_none,
+ 1, 73, :_reduce_none,
+ 1, 73, :_reduce_none,
+ 1, 73, :_reduce_none,
+ 1, 73, :_reduce_none,
+ 1, 73, :_reduce_none,
+ 1, 73, :_reduce_none,
+ 1, 73, :_reduce_none,
+ 1, 73, :_reduce_none,
+ 1, 73, :_reduce_none,
+ 1, 73, :_reduce_none,
+ 1, 73, :_reduce_none,
+ 3, 88, :_reduce_20,
+ 3, 88, :_reduce_21,
+ 1, 89, :_reduce_none,
+ 1, 89, :_reduce_none,
+ 1, 89, :_reduce_none,
+ 1, 90, :_reduce_none,
+ 1, 90, :_reduce_none,
+ 1, 90, :_reduce_none,
+ 1, 90, :_reduce_none,
+ 4, 82, :_reduce_29,
+ 5, 82, :_reduce_30,
+ 3, 82, :_reduce_31,
+ 2, 82, :_reduce_32,
+ 1, 92, :_reduce_33,
+ 1, 92, :_reduce_34,
+ 3, 92, :_reduce_35,
+ 3, 92, :_reduce_36,
+ 1, 93, :_reduce_none,
+ 1, 93, :_reduce_none,
+ 1, 93, :_reduce_none,
+ 1, 93, :_reduce_none,
+ 1, 93, :_reduce_none,
+ 1, 93, :_reduce_none,
+ 1, 93, :_reduce_none,
+ 1, 93, :_reduce_none,
+ 1, 93, :_reduce_45,
+ 5, 75, :_reduce_46,
+ 5, 75, :_reduce_47,
+ 5, 75, :_reduce_48,
+ 5, 86, :_reduce_49,
+ 2, 76, :_reduce_50,
+ 1, 109, :_reduce_51,
+ 2, 109, :_reduce_52,
+ 6, 77, :_reduce_53,
+ 2, 77, :_reduce_54,
+ 3, 110, :_reduce_55,
+ 3, 110, :_reduce_56,
+ 1, 111, :_reduce_none,
+ 1, 111, :_reduce_none,
+ 3, 111, :_reduce_59,
+ 1, 112, :_reduce_none,
+ 3, 112, :_reduce_61,
+ 1, 113, :_reduce_62,
+ 1, 113, :_reduce_63,
+ 3, 114, :_reduce_64,
+ 3, 114, :_reduce_65,
+ 1, 115, :_reduce_none,
+ 1, 115, :_reduce_none,
+ 4, 117, :_reduce_68,
+ 1, 103, :_reduce_69,
+ 3, 103, :_reduce_70,
+ 0, 104, :_reduce_none,
+ 1, 104, :_reduce_none,
+ 1, 119, :_reduce_73,
+ 1, 94, :_reduce_74,
+ 1, 96, :_reduce_75,
+ 1, 118, :_reduce_none,
+ 1, 118, :_reduce_none,
+ 1, 118, :_reduce_none,
+ 1, 118, :_reduce_none,
+ 1, 118, :_reduce_none,
+ 1, 118, :_reduce_none,
+ 1, 118, :_reduce_none,
+ 3, 78, :_reduce_83,
+ 3, 78, :_reduce_84,
+ 3, 87, :_reduce_85,
+ 0, 105, :_reduce_86,
+ 1, 105, :_reduce_87,
+ 3, 105, :_reduce_88,
+ 3, 123, :_reduce_89,
+ 3, 125, :_reduce_90,
+ 1, 126, :_reduce_none,
+ 1, 126, :_reduce_none,
+ 0, 108, :_reduce_93,
+ 1, 108, :_reduce_94,
+ 3, 108, :_reduce_95,
+ 1, 127, :_reduce_96,
+ 3, 127, :_reduce_97,
+ 1, 116, :_reduce_none,
+ 1, 116, :_reduce_none,
+ 1, 116, :_reduce_none,
+ 1, 116, :_reduce_none,
+ 1, 116, :_reduce_none,
+ 1, 116, :_reduce_none,
+ 1, 124, :_reduce_none,
+ 1, 124, :_reduce_none,
+ 1, 124, :_reduce_none,
+ 1, 124, :_reduce_none,
+ 1, 124, :_reduce_none,
+ 1, 124, :_reduce_none,
+ 1, 124, :_reduce_none,
+ 1, 124, :_reduce_none,
+ 1, 124, :_reduce_none,
+ 1, 124, :_reduce_none,
+ 1, 124, :_reduce_none,
+ 1, 124, :_reduce_none,
+ 4, 98, :_reduce_116,
+ 3, 98, :_reduce_117,
+ 1, 100, :_reduce_118,
+ 2, 100, :_reduce_119,
+ 2, 130, :_reduce_120,
+ 1, 131, :_reduce_121,
+ 2, 131, :_reduce_122,
+ 1, 97, :_reduce_123,
+ 4, 91, :_reduce_124,
+ 4, 91, :_reduce_125,
+ 2, 80, :_reduce_126,
+ 5, 132, :_reduce_127,
+ 4, 132, :_reduce_128,
+ 0, 133, :_reduce_none,
+ 2, 133, :_reduce_130,
+ 4, 133, :_reduce_131,
+ 3, 133, :_reduce_132,
+ 1, 121, :_reduce_none,
+ 3, 121, :_reduce_134,
+ 3, 121, :_reduce_135,
+ 3, 121, :_reduce_136,
+ 3, 121, :_reduce_137,
+ 3, 121, :_reduce_138,
+ 3, 121, :_reduce_139,
+ 3, 121, :_reduce_140,
+ 3, 121, :_reduce_141,
+ 3, 121, :_reduce_142,
+ 2, 121, :_reduce_143,
+ 3, 121, :_reduce_144,
+ 3, 121, :_reduce_145,
+ 3, 121, :_reduce_146,
+ 3, 121, :_reduce_147,
+ 3, 121, :_reduce_148,
+ 3, 121, :_reduce_149,
+ 2, 121, :_reduce_150,
+ 3, 121, :_reduce_151,
+ 3, 121, :_reduce_152,
+ 3, 121, :_reduce_153,
+ 5, 79, :_reduce_154,
+ 1, 135, :_reduce_155,
+ 2, 135, :_reduce_156,
+ 5, 136, :_reduce_157,
+ 4, 136, :_reduce_158,
+ 1, 137, :_reduce_159,
+ 3, 137, :_reduce_160,
+ 3, 99, :_reduce_161,
+ 1, 139, :_reduce_none,
+ 4, 139, :_reduce_163,
+ 1, 141, :_reduce_none,
+ 3, 141, :_reduce_165,
+ 3, 140, :_reduce_166,
+ 1, 138, :_reduce_none,
+ 1, 138, :_reduce_none,
+ 1, 138, :_reduce_none,
+ 1, 138, :_reduce_none,
+ 1, 138, :_reduce_none,
+ 1, 138, :_reduce_none,
+ 1, 138, :_reduce_none,
+ 1, 138, :_reduce_none,
+ 1, 138, :_reduce_175,
+ 1, 138, :_reduce_none,
+ 1, 142, :_reduce_177,
+ 1, 143, :_reduce_none,
+ 3, 143, :_reduce_179,
+ 2, 81, :_reduce_180,
+ 6, 83, :_reduce_181,
+ 5, 83, :_reduce_182,
+ 7, 84, :_reduce_183,
+ 6, 84, :_reduce_184,
+ 6, 85, :_reduce_185,
+ 5, 85, :_reduce_186,
+ 1, 107, :_reduce_187,
+ 1, 102, :_reduce_188,
+ 1, 102, :_reduce_189,
+ 1, 102, :_reduce_190,
+ 1, 146, :_reduce_191,
+ 3, 146, :_reduce_192,
+ 1, 148, :_reduce_193,
+ 1, 149, :_reduce_194,
+ 1, 149, :_reduce_195,
+ 1, 149, :_reduce_196,
+ 1, 149, :_reduce_none,
+ 0, 72, :_reduce_198,
+ 0, 150, :_reduce_199,
+ 1, 144, :_reduce_none,
+ 3, 144, :_reduce_201,
+ 3, 144, :_reduce_202,
+ 1, 151, :_reduce_none,
+ 3, 151, :_reduce_204,
+ 3, 152, :_reduce_205,
+ 1, 152, :_reduce_206,
+ 3, 152, :_reduce_207,
+ 1, 152, :_reduce_208,
+ 1, 147, :_reduce_none,
+ 2, 147, :_reduce_210,
+ 1, 145, :_reduce_none,
+ 2, 145, :_reduce_212,
+ 1, 153, :_reduce_none,
+ 1, 153, :_reduce_none,
+ 1, 95, :_reduce_215,
+ 3, 120, :_reduce_216,
+ 4, 120, :_reduce_217,
+ 2, 120, :_reduce_218,
+ 1, 128, :_reduce_none,
+ 1, 128, :_reduce_none,
+ 0, 106, :_reduce_none,
+ 1, 106, :_reduce_222,
+ 1, 134, :_reduce_223,
+ 3, 129, :_reduce_224,
+ 4, 129, :_reduce_225,
+ 2, 129, :_reduce_226,
+ 1, 154, :_reduce_none,
+ 3, 154, :_reduce_228,
+ 3, 155, :_reduce_229,
+ 1, 156, :_reduce_230,
+ 1, 156, :_reduce_231,
+ 4, 122, :_reduce_232,
+ 1, 101, :_reduce_none,
+ 4, 101, :_reduce_234 ]
+
+racc_reduce_n = 235
+
+racc_shift_n = 386
-racc_use_result_var = true
+racc_token_table = {
+ false => 0,
+ :error => 1,
+ :STRING => 2,
+ :DQPRE => 3,
+ :DQMID => 4,
+ :DQPOST => 5,
+ :LBRACK => 6,
+ :RBRACK => 7,
+ :LBRACE => 8,
+ :RBRACE => 9,
+ :SYMBOL => 10,
+ :FARROW => 11,
+ :COMMA => 12,
+ :TRUE => 13,
+ :FALSE => 14,
+ :EQUALS => 15,
+ :APPENDS => 16,
+ :LESSEQUAL => 17,
+ :NOTEQUAL => 18,
+ :DOT => 19,
+ :COLON => 20,
+ :LLCOLLECT => 21,
+ :RRCOLLECT => 22,
+ :QMARK => 23,
+ :LPAREN => 24,
+ :RPAREN => 25,
+ :ISEQUAL => 26,
+ :GREATEREQUAL => 27,
+ :GREATERTHAN => 28,
+ :LESSTHAN => 29,
+ :IF => 30,
+ :ELSE => 31,
+ :IMPORT => 32,
+ :DEFINE => 33,
+ :ELSIF => 34,
+ :VARIABLE => 35,
+ :CLASS => 36,
+ :INHERITS => 37,
+ :NODE => 38,
+ :BOOLEAN => 39,
+ :NAME => 40,
+ :SEMIC => 41,
+ :CASE => 42,
+ :DEFAULT => 43,
+ :AT => 44,
+ :LCOLLECT => 45,
+ :RCOLLECT => 46,
+ :CLASSNAME => 47,
+ :CLASSREF => 48,
+ :NOT => 49,
+ :OR => 50,
+ :AND => 51,
+ :UNDEF => 52,
+ :PARROW => 53,
+ :PLUS => 54,
+ :MINUS => 55,
+ :TIMES => 56,
+ :DIV => 57,
+ :LSHIFT => 58,
+ :RSHIFT => 59,
+ :UMINUS => 60,
+ :MATCH => 61,
+ :NOMATCH => 62,
+ :REGEX => 63,
+ :IN_EDGE => 64,
+ :OUT_EDGE => 65,
+ :IN_EDGE_SUB => 66,
+ :OUT_EDGE_SUB => 67,
+ :IN => 68 }
racc_nt_base = 69
+racc_use_result_var = true
+
Racc_arg = [
- racc_action_table,
- racc_action_check,
- racc_action_default,
- racc_action_pointer,
- racc_goto_table,
- racc_goto_check,
- racc_goto_default,
- racc_goto_pointer,
- racc_nt_base,
- racc_reduce_table,
- racc_token_table,
- racc_shift_n,
- racc_reduce_n,
- racc_use_result_var ]
+ racc_action_table,
+ racc_action_check,
+ racc_action_default,
+ racc_action_pointer,
+ racc_goto_table,
+ racc_goto_check,
+ racc_goto_default,
+ racc_goto_pointer,
+ racc_nt_base,
+ racc_reduce_table,
+ racc_token_table,
+ racc_shift_n,
+ racc_reduce_n,
+ racc_use_result_var ]
Racc_token_to_s_table = [
-'$end',
-'error',
-'STRING',
-'DQPRE',
-'DQMID',
-'DQPOST',
-'LBRACK',
-'RBRACK',
-'LBRACE',
-'RBRACE',
-'SYMBOL',
-'FARROW',
-'COMMA',
-'TRUE',
-'FALSE',
-'EQUALS',
-'APPENDS',
-'LESSEQUAL',
-'NOTEQUAL',
-'DOT',
-'COLON',
-'LLCOLLECT',
-'RRCOLLECT',
-'QMARK',
-'LPAREN',
-'RPAREN',
-'ISEQUAL',
-'GREATEREQUAL',
-'GREATERTHAN',
-'LESSTHAN',
-'IF',
-'ELSE',
-'IMPORT',
-'DEFINE',
-'ELSIF',
-'VARIABLE',
-'CLASS',
-'INHERITS',
-'NODE',
-'BOOLEAN',
-'NAME',
-'SEMIC',
-'CASE',
-'DEFAULT',
-'AT',
-'LCOLLECT',
-'RCOLLECT',
-'CLASSNAME',
-'CLASSREF',
-'NOT',
-'OR',
-'AND',
-'UNDEF',
-'PARROW',
-'PLUS',
-'MINUS',
-'TIMES',
-'DIV',
-'LSHIFT',
-'RSHIFT',
-'UMINUS',
-'MATCH',
-'NOMATCH',
-'REGEX',
-'IN_EDGE',
-'OUT_EDGE',
-'IN_EDGE_SUB',
-'OUT_EDGE_SUB',
-'IN',
-'$start',
-'program',
-'statements_and_declarations',
-'nil',
-'statement_or_declaration',
-'statements',
-'resource',
-'virtualresource',
-'collection',
-'assignment',
-'casestatement',
-'ifstatement_begin',
-'import',
-'fstatement',
-'definition',
-'hostclass',
-'nodedef',
-'resourceoverride',
-'append',
-'relationship',
-'relationship_side',
-'edge',
-'resourceref',
-'funcvalues',
-'namestring',
-'name',
-'variable',
-'type',
-'boolean',
-'funcrvalue',
-'selector',
-'quotedtext',
-'hasharrayaccesses',
-'classname',
-'resourceinstances',
-'endsemi',
-'params',
-'endcomma',
-'classref',
-'anyparams',
-'at',
-'collectrhand',
-'collstatements',
-'collstatement',
-'colljoin',
-'collexpr',
-'colllval',
-'simplervalue',
-'resourceinst',
-'resourcename',
-'undef',
-'array',
-'expression',
-'hasharrayaccess',
-'param',
-'rvalue',
-'addparam',
-'anyparam',
-'rvalues',
-'comma',
-'hash',
-'dqrval',
-'dqtail',
-'ifstatement',
-'else',
-'regex',
-'caseopts',
-'caseopt',
-'casevalues',
-'selectlhand',
-'svalues',
-'selectval',
-'sintvalues',
-'string',
-'strings',
-'argumentlist',
-'classparent',
-'hostnames',
-'nodeparent',
-'nodename',
-'hostname',
-'nothing',
-'arguments',
-'argument',
-'classnameordefault',
-'hashpairs',
-'hashpair',
-'key']
+ "$end",
+ "error",
+ "STRING",
+ "DQPRE",
+ "DQMID",
+ "DQPOST",
+ "LBRACK",
+ "RBRACK",
+ "LBRACE",
+ "RBRACE",
+ "SYMBOL",
+ "FARROW",
+ "COMMA",
+ "TRUE",
+ "FALSE",
+ "EQUALS",
+ "APPENDS",
+ "LESSEQUAL",
+ "NOTEQUAL",
+ "DOT",
+ "COLON",
+ "LLCOLLECT",
+ "RRCOLLECT",
+ "QMARK",
+ "LPAREN",
+ "RPAREN",
+ "ISEQUAL",
+ "GREATEREQUAL",
+ "GREATERTHAN",
+ "LESSTHAN",
+ "IF",
+ "ELSE",
+ "IMPORT",
+ "DEFINE",
+ "ELSIF",
+ "VARIABLE",
+ "CLASS",
+ "INHERITS",
+ "NODE",
+ "BOOLEAN",
+ "NAME",
+ "SEMIC",
+ "CASE",
+ "DEFAULT",
+ "AT",
+ "LCOLLECT",
+ "RCOLLECT",
+ "CLASSNAME",
+ "CLASSREF",
+ "NOT",
+ "OR",
+ "AND",
+ "UNDEF",
+ "PARROW",
+ "PLUS",
+ "MINUS",
+ "TIMES",
+ "DIV",
+ "LSHIFT",
+ "RSHIFT",
+ "UMINUS",
+ "MATCH",
+ "NOMATCH",
+ "REGEX",
+ "IN_EDGE",
+ "OUT_EDGE",
+ "IN_EDGE_SUB",
+ "OUT_EDGE_SUB",
+ "IN",
+ "$start",
+ "program",
+ "statements_and_declarations",
+ "nil",
+ "statement_or_declaration",
+ "statements",
+ "resource",
+ "virtualresource",
+ "collection",
+ "assignment",
+ "casestatement",
+ "ifstatement_begin",
+ "import",
+ "fstatement",
+ "definition",
+ "hostclass",
+ "nodedef",
+ "resourceoverride",
+ "append",
+ "relationship",
+ "relationship_side",
+ "edge",
+ "resourceref",
+ "funcvalues",
+ "namestring",
+ "name",
+ "variable",
+ "type",
+ "boolean",
+ "funcrvalue",
+ "selector",
+ "quotedtext",
+ "hasharrayaccesses",
+ "classname",
+ "resourceinstances",
+ "endsemi",
+ "params",
+ "endcomma",
+ "classref",
+ "anyparams",
+ "at",
+ "collectrhand",
+ "collstatements",
+ "collstatement",
+ "colljoin",
+ "collexpr",
+ "colllval",
+ "simplervalue",
+ "resourceinst",
+ "resourcename",
+ "undef",
+ "array",
+ "expression",
+ "hasharrayaccess",
+ "param",
+ "rvalue",
+ "addparam",
+ "anyparam",
+ "rvalues",
+ "comma",
+ "hash",
+ "dqrval",
+ "dqtail",
+ "ifstatement",
+ "else",
+ "regex",
+ "caseopts",
+ "caseopt",
+ "casevalues",
+ "selectlhand",
+ "svalues",
+ "selectval",
+ "sintvalues",
+ "string",
+ "strings",
+ "argumentlist",
+ "classparent",
+ "hostnames",
+ "nodeparent",
+ "nodename",
+ "hostname",
+ "nothing",
+ "arguments",
+ "argument",
+ "classnameordefault",
+ "hashpairs",
+ "hashpair",
+ "key" ]
Racc_debug_parser = false
-##### racc system variables end #####
+##### State transition tables end #####
- # reduce 0 omitted
+# reduce 0 omitted
- # reduce 1 omitted
+# reduce 1 omitted
- # reduce 2 omitted
+# reduce 2 omitted
-module_eval <<'.,.,', 'grammar.ra', 36
- def _reduce_3( val, _values, result )
- result = ast AST::ASTArray, :children => (val[0] ? [val[0]] : [])
- result
+module_eval(<<'.,.,', 'grammar.ra', 34)
+ def _reduce_3(val, _values, result)
+ result = ast AST::ASTArray, :children => (val[0] ? [val[0]] : [])
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 42
- def _reduce_4( val, _values, result )
- if val[1]
+module_eval(<<'.,.,', 'grammar.ra', 37)
+ def _reduce_4(val, _values, result)
+ if val[1]
val[0].push(val[1])
end
result = val[0]
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 54
- def _reduce_5( val, _values, result )
- val[0].each do |stmt|
+module_eval(<<'.,.,', 'grammar.ra', 46)
+ def _reduce_5(val, _values, result)
+ val[0].each do |stmt|
if stmt.is_a?(AST::TopLevelConstruct)
error "Classes, definitions, and nodes may only appear at toplevel or inside other classes", \
:line => stmt.context[:line], :file => stmt.context[:file]
end
end
result = val[0]
- result
+
+ result
end
.,.,
- # reduce 6 omitted
+# reduce 6 omitted
+
+# reduce 7 omitted
- # reduce 7 omitted
+# reduce 8 omitted
- # reduce 8 omitted
+# reduce 9 omitted
- # reduce 9 omitted
+# reduce 10 omitted
- # reduce 10 omitted
+# reduce 11 omitted
- # reduce 11 omitted
+# reduce 12 omitted
- # reduce 12 omitted
+# reduce 13 omitted
- # reduce 13 omitted
+# reduce 14 omitted
- # reduce 14 omitted
+# reduce 15 omitted
- # reduce 15 omitted
+# reduce 16 omitted
- # reduce 16 omitted
+# reduce 17 omitted
- # reduce 17 omitted
+# reduce 18 omitted
- # reduce 18 omitted
+# reduce 19 omitted
- # reduce 19 omitted
+module_eval(<<'.,.,', 'grammar.ra', 72)
+ def _reduce_20(val, _values, result)
+ result = AST::Relationship.new(val[0], val[2], val[1][:value], ast_context)
-module_eval <<'.,.,', 'grammar.ra', 74
- def _reduce_20( val, _values, result )
- result = AST::Relationship.new(val[0], val[2], val[1][:value], ast_context)
- result
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 77
- def _reduce_21( val, _values, result )
- result = AST::Relationship.new(val[0], val[2], val[1][:value], ast_context)
- result
+module_eval(<<'.,.,', 'grammar.ra', 75)
+ def _reduce_21(val, _values, result)
+ result = AST::Relationship.new(val[0], val[2], val[1][:value], ast_context)
+
+ result
end
.,.,
- # reduce 22 omitted
+# reduce 22 omitted
- # reduce 23 omitted
+# reduce 23 omitted
- # reduce 24 omitted
+# reduce 24 omitted
- # reduce 25 omitted
+# reduce 25 omitted
- # reduce 26 omitted
+# reduce 26 omitted
- # reduce 27 omitted
+# reduce 27 omitted
- # reduce 28 omitted
+# reduce 28 omitted
-module_eval <<'.,.,', 'grammar.ra', 89
- def _reduce_29( val, _values, result )
- result = ast AST::Function,
+module_eval(<<'.,.,', 'grammar.ra', 83)
+ def _reduce_29(val, _values, result)
+ result = ast AST::Function,
:name => val[0][:value],
:line => val[0][:line],
:arguments => val[2],
:ftype => :statement
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 96
- def _reduce_30( val, _values, result )
- result = ast AST::Function,
+module_eval(<<'.,.,', 'grammar.ra', 90)
+ def _reduce_30(val, _values, result)
+ result = ast AST::Function,
:name => val[0][:value],
:line => val[0][:line],
:arguments => val[2],
:ftype => :statement
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 102
- def _reduce_31( val, _values, result )
- result = ast AST::Function,
+module_eval(<<'.,.,', 'grammar.ra', 96)
+ def _reduce_31(val, _values, result)
+ result = ast AST::Function,
:name => val[0][:value],
:line => val[0][:line],
:arguments => AST::ASTArray.new({}),
:ftype => :statement
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 109
- def _reduce_32( val, _values, result )
- result = ast AST::Function,
+module_eval(<<'.,.,', 'grammar.ra', 103)
+ def _reduce_32(val, _values, result)
+ result = ast AST::Function,
:name => val[0][:value],
:line => val[0][:line],
:arguments => val[1],
:ftype => :statement
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 110
- def _reduce_33( val, _values, result )
- result = aryfy(val[0])
- result
+module_eval(<<'.,.,', 'grammar.ra', 110)
+ def _reduce_33(val, _values, result)
+ result = aryfy(val[0])
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 111
- def _reduce_34( val, _values, result )
- result = aryfy(val[0])
- result
+module_eval(<<'.,.,', 'grammar.ra', 111)
+ def _reduce_34(val, _values, result)
+ result = aryfy(val[0])
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 116
- def _reduce_35( val, _values, result )
- val[0].push(val[2])
+module_eval(<<'.,.,', 'grammar.ra', 113)
+ def _reduce_35(val, _values, result)
+ val[0].push(val[2])
result = val[0]
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 120
- def _reduce_36( val, _values, result )
- val[0].push(val[2])
+module_eval(<<'.,.,', 'grammar.ra', 117)
+ def _reduce_36(val, _values, result)
+ val[0].push(val[2])
result = val[0]
- result
+
+ result
end
.,.,
- # reduce 37 omitted
+# reduce 37 omitted
- # reduce 38 omitted
+# reduce 38 omitted
- # reduce 39 omitted
+# reduce 39 omitted
- # reduce 40 omitted
+# reduce 40 omitted
- # reduce 41 omitted
+# reduce 41 omitted
- # reduce 42 omitted
+# reduce 42 omitted
- # reduce 43 omitted
+# reduce 43 omitted
- # reduce 44 omitted
+# reduce 44 omitted
-module_eval <<'.,.,', 'grammar.ra', 134
- def _reduce_45( val, _values, result )
- result = ast AST::Name, :value => val[0][:value]
- result
+module_eval(<<'.,.,', 'grammar.ra', 132)
+ def _reduce_45(val, _values, result)
+ result = ast AST::Name, :value => val[0][:value]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 139
- def _reduce_46( val, _values, result )
- @lexer.commentpop
+module_eval(<<'.,.,', 'grammar.ra', 136)
+ def _reduce_46(val, _values, result)
+ @lexer.commentpop
result = ast(AST::Resource, :type => val[0], :instances => val[2])
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 142
- def _reduce_47( val, _values, result )
- # This is a deprecated syntax.
+module_eval(<<'.,.,', 'grammar.ra', 139)
+ def _reduce_47(val, _values, result)
+ # This is a deprecated syntax.
error "All resource specifications require names"
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 146
- def _reduce_48( val, _values, result )
- # a defaults setting for a type
+module_eval(<<'.,.,', 'grammar.ra', 142)
+ def _reduce_48(val, _values, result)
+ # a defaults setting for a type
@lexer.commentpop
result = ast(AST::ResourceDefaults, :type => val[0], :parameters => val[2])
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 152
- def _reduce_49( val, _values, result )
- @lexer.commentpop
+module_eval(<<'.,.,', 'grammar.ra', 149)
+ def _reduce_49(val, _values, result)
+ @lexer.commentpop
result = ast AST::ResourceOverride, :object => val[0], :parameters => val[2]
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 171
- def _reduce_50( val, _values, result )
- type = val[0]
+module_eval(<<'.,.,', 'grammar.ra', 156)
+ def _reduce_50(val, _values, result)
+ type = val[0]
if (type == :exported and ! Puppet[:storeconfigs]) and ! Puppet[:parseonly]
Puppet.warning addcontext("You cannot collect without storeconfigs being set")
@@ -1369,27 +1378,28 @@ module_eval <<'.,.,', 'grammar.ra', 171
val[1].send(method, true)
result = val[1]
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 172
- def _reduce_51( val, _values, result )
- result = :virtual
- result
+module_eval(<<'.,.,', 'grammar.ra', 172)
+ def _reduce_51(val, _values, result)
+ result = :virtual
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 173
- def _reduce_52( val, _values, result )
- result = :exported
- result
+module_eval(<<'.,.,', 'grammar.ra', 173)
+ def _reduce_52(val, _values, result)
+ result = :exported
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 196
- def _reduce_53( val, _values, result )
- @lexer.commentpop
+module_eval(<<'.,.,', 'grammar.ra', 178)
+ def _reduce_53(val, _values, result)
+ @lexer.commentpop
Puppet.warning addcontext("Collection names must now be capitalized") if val[0] =~ /^[a-z]/
type = val[0].downcase
args = {:type => type}
@@ -1406,13 +1416,14 @@ module_eval <<'.,.,', 'grammar.ra', 196
end
args[:override] = val[3]
result = ast AST::Collection, args
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 215
- def _reduce_54( val, _values, result )
- if val[0] =~ /^[a-z]/
+module_eval(<<'.,.,', 'grammar.ra', 197)
+ def _reduce_54(val, _values, result)
+ if val[0] =~ /^[a-z]/
Puppet.warning addcontext("Collection names must now be capitalized")
end
type = val[0].downcase
@@ -1429,377 +1440,404 @@ module_eval <<'.,.,', 'grammar.ra', 215
Puppet.warning addcontext("You cannot collect exported resources without storeconfigs being set; the collection will be ignored")
end
result = ast AST::Collection, args
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 225
- def _reduce_55( val, _values, result )
- if val[1]
+module_eval(<<'.,.,', 'grammar.ra', 218)
+ def _reduce_55(val, _values, result)
+ if val[1]
result = val[1]
result.form = :virtual
else
result = :virtual
end
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 233
- def _reduce_56( val, _values, result )
- if val[1]
+module_eval(<<'.,.,', 'grammar.ra', 226)
+ def _reduce_56(val, _values, result)
+ if val[1]
result = val[1]
result.form = :exported
else
result = :exported
end
- result
+
+ result
end
.,.,
- # reduce 57 omitted
+# reduce 57 omitted
- # reduce 58 omitted
+# reduce 58 omitted
-module_eval <<'.,.,', 'grammar.ra', 241
- def _reduce_59( val, _values, result )
- result = ast AST::CollExpr, :test1 => val[0], :oper => val[1], :test2 => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 239)
+ def _reduce_59(val, _values, result)
+ result = ast AST::CollExpr, :test1 => val[0], :oper => val[1], :test2 => val[2]
+
+ result
end
.,.,
- # reduce 60 omitted
+# reduce 60 omitted
-module_eval <<'.,.,', 'grammar.ra', 247
- def _reduce_61( val, _values, result )
- result = val[1]
+module_eval(<<'.,.,', 'grammar.ra', 244)
+ def _reduce_61(val, _values, result)
+ result = val[1]
result.parens = true
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 248
- def _reduce_62( val, _values, result )
- result=val[0][:value]
- result
+module_eval(<<'.,.,', 'grammar.ra', 248)
+ def _reduce_62(val, _values, result)
+ result=val[0][:value]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 249
- def _reduce_63( val, _values, result )
- result=val[0][:value]
- result
+module_eval(<<'.,.,', 'grammar.ra', 249)
+ def _reduce_63(val, _values, result)
+ result=val[0][:value]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 256
- def _reduce_64( val, _values, result )
- result = ast AST::CollExpr, :test1 => val[0], :oper => val[1][:value], :test2 => val[2]
+module_eval(<<'.,.,', 'grammar.ra', 252)
+ def _reduce_64(val, _values, result)
+ result = ast AST::CollExpr, :test1 => val[0], :oper => val[1][:value], :test2 => val[2]
#result = ast AST::CollExpr
#result.push *val
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 261
- def _reduce_65( val, _values, result )
- result = ast AST::CollExpr, :test1 => val[0], :oper => val[1][:value], :test2 => val[2]
+module_eval(<<'.,.,', 'grammar.ra', 257)
+ def _reduce_65(val, _values, result)
+ result = ast AST::CollExpr, :test1 => val[0], :oper => val[1][:value], :test2 => val[2]
#result = ast AST::CollExpr
#result.push *val
- result
+
+ result
end
.,.,
- # reduce 66 omitted
+# reduce 66 omitted
- # reduce 67 omitted
+# reduce 67 omitted
-module_eval <<'.,.,', 'grammar.ra', 268
- def _reduce_68( val, _values, result )
- result = ast AST::ResourceInstance, :title => val[0], :parameters => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 266)
+ def _reduce_68(val, _values, result)
+ result = ast AST::ResourceInstance, :title => val[0], :parameters => val[2]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 269
- def _reduce_69( val, _values, result )
- result = aryfy(val[0])
- result
+module_eval(<<'.,.,', 'grammar.ra', 269)
+ def _reduce_69(val, _values, result)
+ result = aryfy(val[0])
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 274
- def _reduce_70( val, _values, result )
- val[0].push val[2]
+module_eval(<<'.,.,', 'grammar.ra', 271)
+ def _reduce_70(val, _values, result)
+ val[0].push val[2]
result = val[0]
- result
+
+ result
end
.,.,
- # reduce 71 omitted
+# reduce 71 omitted
- # reduce 72 omitted
+# reduce 72 omitted
-module_eval <<'.,.,', 'grammar.ra', 281
- def _reduce_73( val, _values, result )
- result = ast AST::Undef, :value => :undef
- result
+module_eval(<<'.,.,', 'grammar.ra', 279)
+ def _reduce_73(val, _values, result)
+ result = ast AST::Undef, :value => :undef
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 285
- def _reduce_74( val, _values, result )
- result = ast AST::Name, :value => val[0][:value], :line => val[0][:line]
- result
+module_eval(<<'.,.,', 'grammar.ra', 283)
+ def _reduce_74(val, _values, result)
+ result = ast AST::Name, :value => val[0][:value], :line => val[0][:line]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 289
- def _reduce_75( val, _values, result )
- result = ast AST::Type, :value => val[0][:value], :line => val[0][:line]
- result
+module_eval(<<'.,.,', 'grammar.ra', 287)
+ def _reduce_75(val, _values, result)
+ result = ast AST::Type, :value => val[0][:value], :line => val[0][:line]
+
+ result
end
.,.,
- # reduce 76 omitted
+# reduce 76 omitted
- # reduce 77 omitted
+# reduce 77 omitted
- # reduce 78 omitted
+# reduce 78 omitted
- # reduce 79 omitted
+# reduce 79 omitted
- # reduce 80 omitted
+# reduce 80 omitted
- # reduce 81 omitted
+# reduce 81 omitted
- # reduce 82 omitted
+# reduce 82 omitted
-module_eval <<'.,.,', 'grammar.ra', 304
- def _reduce_83( val, _values, result )
- raise Puppet::ParseError, "Cannot assign to variables in other namespaces" if val[0][:value] =~ /::/
+module_eval(<<'.,.,', 'grammar.ra', 299)
+ def _reduce_83(val, _values, result)
+ raise Puppet::ParseError, "Cannot assign to variables in other namespaces" if val[0][:value] =~ /::/
# this is distinct from referencing a variable
variable = ast AST::Name, :value => val[0][:value], :line => val[0][:line]
result = ast AST::VarDef, :name => variable, :value => val[2], :line => val[0][:line]
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 307
- def _reduce_84( val, _values, result )
- result = ast AST::VarDef, :name => val[0], :value => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 305)
+ def _reduce_84(val, _values, result)
+ result = ast AST::VarDef, :name => val[0], :value => val[2]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 312
- def _reduce_85( val, _values, result )
- variable = ast AST::Name, :value => val[0][:value], :line => val[0][:line]
+module_eval(<<'.,.,', 'grammar.ra', 309)
+ def _reduce_85(val, _values, result)
+ variable = ast AST::Name, :value => val[0][:value], :line => val[0][:line]
result = ast AST::VarDef, :name => variable, :value => val[2], :append => true, :line => val[0][:line]
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 317
- def _reduce_86( val, _values, result )
- result = ast AST::ASTArray
- result
+module_eval(<<'.,.,', 'grammar.ra', 315)
+ def _reduce_86(val, _values, result)
+ result = ast AST::ASTArray
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 317
- def _reduce_87( val, _values, result )
- result = aryfy(val[0])
- result
+module_eval(<<'.,.,', 'grammar.ra', 317)
+ def _reduce_87(val, _values, result)
+ result = aryfy(val[0])
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 322
- def _reduce_88( val, _values, result )
- val[0].push(val[2])
+module_eval(<<'.,.,', 'grammar.ra', 319)
+ def _reduce_88(val, _values, result)
+ val[0].push(val[2])
result = val[0]
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 326
- def _reduce_89( val, _values, result )
- result = ast AST::ResourceParam, :param => val[0][:value], :line => val[0][:line], :value => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 324)
+ def _reduce_89(val, _values, result)
+ result = ast AST::ResourceParam, :param => val[0][:value], :line => val[0][:line], :value => val[2]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 331
- def _reduce_90( val, _values, result )
- result = ast AST::ResourceParam, :param => val[0][:value], :line => val[0][:line], :value => val[2],
+module_eval(<<'.,.,', 'grammar.ra', 328)
+ def _reduce_90(val, _values, result)
+ result = ast AST::ResourceParam, :param => val[0][:value], :line => val[0][:line], :value => val[2],
:add => true
- result
+
+ result
end
.,.,
- # reduce 91 omitted
+# reduce 91 omitted
+
+# reduce 92 omitted
- # reduce 92 omitted
+module_eval(<<'.,.,', 'grammar.ra', 337)
+ def _reduce_93(val, _values, result)
+ result = ast AST::ASTArray
-module_eval <<'.,.,', 'grammar.ra', 339
- def _reduce_93( val, _values, result )
- result = ast AST::ASTArray
- result
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 339
- def _reduce_94( val, _values, result )
- result = aryfy(val[0])
- result
+module_eval(<<'.,.,', 'grammar.ra', 339)
+ def _reduce_94(val, _values, result)
+ result = aryfy(val[0])
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 344
- def _reduce_95( val, _values, result )
- val[0].push(val[2])
+module_eval(<<'.,.,', 'grammar.ra', 341)
+ def _reduce_95(val, _values, result)
+ val[0].push(val[2])
result = val[0]
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 345
- def _reduce_96( val, _values, result )
- result = aryfy(val[0])
- result
+module_eval(<<'.,.,', 'grammar.ra', 345)
+ def _reduce_96(val, _values, result)
+ result = aryfy(val[0])
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 346
- def _reduce_97( val, _values, result )
- result = val[0].push(val[2])
- result
+module_eval(<<'.,.,', 'grammar.ra', 346)
+ def _reduce_97(val, _values, result)
+ result = val[0].push(val[2])
+ result
end
.,.,
- # reduce 98 omitted
+# reduce 98 omitted
- # reduce 99 omitted
+# reduce 99 omitted
- # reduce 100 omitted
+# reduce 100 omitted
- # reduce 101 omitted
+# reduce 101 omitted
- # reduce 102 omitted
+# reduce 102 omitted
- # reduce 103 omitted
+# reduce 103 omitted
- # reduce 104 omitted
+# reduce 104 omitted
- # reduce 105 omitted
+# reduce 105 omitted
- # reduce 106 omitted
+# reduce 106 omitted
- # reduce 107 omitted
+# reduce 107 omitted
- # reduce 108 omitted
+# reduce 108 omitted
- # reduce 109 omitted
+# reduce 109 omitted
- # reduce 110 omitted
+# reduce 110 omitted
- # reduce 111 omitted
+# reduce 111 omitted
- # reduce 112 omitted
+# reduce 112 omitted
- # reduce 113 omitted
+# reduce 113 omitted
- # reduce 114 omitted
+# reduce 114 omitted
- # reduce 115 omitted
+# reduce 115 omitted
-module_eval <<'.,.,', 'grammar.ra', 375
- def _reduce_116( val, _values, result )
- result = ast AST::Function,
+module_eval(<<'.,.,', 'grammar.ra', 370)
+ def _reduce_116(val, _values, result)
+ result = ast AST::Function,
:name => val[0][:value], :line => val[0][:line],
:arguments => val[2],
:ftype => :rvalue
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 380
- def _reduce_117( val, _values, result )
- result = ast AST::Function,
+module_eval(<<'.,.,', 'grammar.ra', 375)
+ def _reduce_117(val, _values, result)
+ result = ast AST::Function,
:name => val[0][:value], :line => val[0][:line],
:arguments => AST::ASTArray.new({}),
:ftype => :rvalue
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 381
- def _reduce_118( val, _values, result )
- result = ast AST::String, :value => val[0][:value], :line => val[0][:line]
- result
+module_eval(<<'.,.,', 'grammar.ra', 381)
+ def _reduce_118(val, _values, result)
+ result = ast AST::String, :value => val[0][:value], :line => val[0][:line]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 382
- def _reduce_119( val, _values, result )
- result = ast AST::Concat, :value => [ast(AST::String,val[0])]+val[1], :line => val[0][:line]
- result
+module_eval(<<'.,.,', 'grammar.ra', 382)
+ def _reduce_119(val, _values, result)
+ result = ast AST::Concat, :value => [ast(AST::String,val[0])]+val[1], :line => val[0][:line]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 384
- def _reduce_120( val, _values, result )
- result = [val[0]] + val[1]
- result
+module_eval(<<'.,.,', 'grammar.ra', 384)
+ def _reduce_120(val, _values, result)
+ result = [val[0]] + val[1]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 386
- def _reduce_121( val, _values, result )
- result = [ast(AST::String,val[0])]
- result
+module_eval(<<'.,.,', 'grammar.ra', 386)
+ def _reduce_121(val, _values, result)
+ result = [ast(AST::String,val[0])]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 387
- def _reduce_122( val, _values, result )
- result = [ast(AST::String,val[0])] + val[1]
- result
+module_eval(<<'.,.,', 'grammar.ra', 387)
+ def _reduce_122(val, _values, result)
+ result = [ast(AST::String,val[0])] + val[1]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 392
- def _reduce_123( val, _values, result )
- result = ast AST::Boolean, :value => val[0][:value], :line => val[0][:line]
- result
+module_eval(<<'.,.,', 'grammar.ra', 390)
+ def _reduce_123(val, _values, result)
+ result = ast AST::Boolean, :value => val[0][:value], :line => val[0][:line]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 397
- def _reduce_124( val, _values, result )
- Puppet.warning addcontext("Deprecation notice: Resource references should now be capitalized")
+module_eval(<<'.,.,', 'grammar.ra', 394)
+ def _reduce_124(val, _values, result)
+ Puppet.warning addcontext("Deprecation notice: Resource references should now be capitalized")
result = ast AST::ResourceReference, :type => val[0][:value], :line => val[0][:line], :title => val[2]
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 399
- def _reduce_125( val, _values, result )
- result = ast AST::ResourceReference, :type => val[0], :title => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 397)
+ def _reduce_125(val, _values, result)
+ result = ast AST::ResourceReference, :type => val[0], :title => val[2]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 403
- def _reduce_126( val, _values, result )
- result = val[1]
- result
+module_eval(<<'.,.,', 'grammar.ra', 401)
+ def _reduce_126(val, _values, result)
+ result = val[1]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 415
- def _reduce_127( val, _values, result )
- @lexer.commentpop
+module_eval(<<'.,.,', 'grammar.ra', 405)
+ def _reduce_127(val, _values, result)
+ @lexer.commentpop
args = {
:test => val[0],
:statements => val[2]
@@ -1808,13 +1846,14 @@ module_eval <<'.,.,', 'grammar.ra', 415
args[:else] = val[4] if val[4]
result = ast AST::IfStatement, args
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 426
- def _reduce_128( val, _values, result )
- @lexer.commentpop
+module_eval(<<'.,.,', 'grammar.ra', 416)
+ def _reduce_128(val, _values, result)
+ @lexer.commentpop
args = {
:test => val[0],
:statements => ast(AST::Nop)
@@ -1823,211 +1862,238 @@ module_eval <<'.,.,', 'grammar.ra', 426
args[:else] = val[3] if val[3]
result = ast AST::IfStatement, args
- result
+
+ result
end
.,.,
- # reduce 129 omitted
+# reduce 129 omitted
-module_eval <<'.,.,', 'grammar.ra', 431
- def _reduce_130( val, _values, result )
- result = ast AST::Else, :statements => val[1]
- result
+module_eval(<<'.,.,', 'grammar.ra', 429)
+ def _reduce_130(val, _values, result)
+ result = ast AST::Else, :statements => val[1]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 435
- def _reduce_131( val, _values, result )
- @lexer.commentpop
+module_eval(<<'.,.,', 'grammar.ra', 432)
+ def _reduce_131(val, _values, result)
+ @lexer.commentpop
result = ast AST::Else, :statements => val[2]
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 439
- def _reduce_132( val, _values, result )
- @lexer.commentpop
+module_eval(<<'.,.,', 'grammar.ra', 436)
+ def _reduce_132(val, _values, result)
+ @lexer.commentpop
result = ast AST::Else, :statements => ast(AST::Nop)
- result
+
+ result
end
.,.,
- # reduce 133 omitted
+# reduce 133 omitted
-module_eval <<'.,.,', 'grammar.ra', 456
- def _reduce_134( val, _values, result )
- result = ast AST::InOperator, :lval => val[0], :rval => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 454)
+ def _reduce_134(val, _values, result)
+ result = ast AST::InOperator, :lval => val[0], :rval => val[2]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 459
- def _reduce_135( val, _values, result )
- result = ast AST::MatchOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 457)
+ def _reduce_135(val, _values, result)
+ result = ast AST::MatchOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 462
- def _reduce_136( val, _values, result )
- result = ast AST::MatchOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 460)
+ def _reduce_136(val, _values, result)
+ result = ast AST::MatchOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 465
- def _reduce_137( val, _values, result )
- result = ast AST::ArithmeticOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 463)
+ def _reduce_137(val, _values, result)
+ result = ast AST::ArithmeticOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 468
- def _reduce_138( val, _values, result )
- result = ast AST::ArithmeticOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 466)
+ def _reduce_138(val, _values, result)
+ result = ast AST::ArithmeticOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 471
- def _reduce_139( val, _values, result )
- result = ast AST::ArithmeticOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 469)
+ def _reduce_139(val, _values, result)
+ result = ast AST::ArithmeticOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 474
- def _reduce_140( val, _values, result )
- result = ast AST::ArithmeticOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 472)
+ def _reduce_140(val, _values, result)
+ result = ast AST::ArithmeticOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 477
- def _reduce_141( val, _values, result )
- result = ast AST::ArithmeticOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 475)
+ def _reduce_141(val, _values, result)
+ result = ast AST::ArithmeticOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 480
- def _reduce_142( val, _values, result )
- result = ast AST::ArithmeticOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 478)
+ def _reduce_142(val, _values, result)
+ result = ast AST::ArithmeticOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 483
- def _reduce_143( val, _values, result )
- result = ast AST::Minus, :value => val[1]
- result
+module_eval(<<'.,.,', 'grammar.ra', 481)
+ def _reduce_143(val, _values, result)
+ result = ast AST::Minus, :value => val[1]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 486
- def _reduce_144( val, _values, result )
- result = ast AST::ComparisonOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 484)
+ def _reduce_144(val, _values, result)
+ result = ast AST::ComparisonOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 489
- def _reduce_145( val, _values, result )
- result = ast AST::ComparisonOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 487)
+ def _reduce_145(val, _values, result)
+ result = ast AST::ComparisonOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 492
- def _reduce_146( val, _values, result )
- result = ast AST::ComparisonOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 490)
+ def _reduce_146(val, _values, result)
+ result = ast AST::ComparisonOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 495
- def _reduce_147( val, _values, result )
- result = ast AST::ComparisonOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 493)
+ def _reduce_147(val, _values, result)
+ result = ast AST::ComparisonOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 498
- def _reduce_148( val, _values, result )
- result = ast AST::ComparisonOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 496)
+ def _reduce_148(val, _values, result)
+ result = ast AST::ComparisonOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 501
- def _reduce_149( val, _values, result )
- result = ast AST::ComparisonOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 499)
+ def _reduce_149(val, _values, result)
+ result = ast AST::ComparisonOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 504
- def _reduce_150( val, _values, result )
- result = ast AST::Not, :value => val[1]
- result
+module_eval(<<'.,.,', 'grammar.ra', 502)
+ def _reduce_150(val, _values, result)
+ result = ast AST::Not, :value => val[1]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 507
- def _reduce_151( val, _values, result )
- result = ast AST::BooleanOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 505)
+ def _reduce_151(val, _values, result)
+ result = ast AST::BooleanOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 510
- def _reduce_152( val, _values, result )
- result = ast AST::BooleanOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 508)
+ def _reduce_152(val, _values, result)
+ result = ast AST::BooleanOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 513
- def _reduce_153( val, _values, result )
- result = val[1]
- result
+module_eval(<<'.,.,', 'grammar.ra', 511)
+ def _reduce_153(val, _values, result)
+ result = val[1]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 518
- def _reduce_154( val, _values, result )
- @lexer.commentpop
+module_eval(<<'.,.,', 'grammar.ra', 515)
+ def _reduce_154(val, _values, result)
+ @lexer.commentpop
result = ast AST::CaseStatement, :test => val[1], :options => val[3]
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 519
- def _reduce_155( val, _values, result )
- result = aryfy(val[0])
- result
+module_eval(<<'.,.,', 'grammar.ra', 519)
+ def _reduce_155(val, _values, result)
+ result = aryfy(val[0])
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 524
- def _reduce_156( val, _values, result )
- val[0].push val[1]
+module_eval(<<'.,.,', 'grammar.ra', 521)
+ def _reduce_156(val, _values, result)
+ val[0].push val[1]
result = val[0]
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 529
- def _reduce_157( val, _values, result )
- @lexer.commentpop
+module_eval(<<'.,.,', 'grammar.ra', 526)
+ def _reduce_157(val, _values, result)
+ @lexer.commentpop
result = ast AST::CaseOpt, :value => val[0], :statements => val[3]
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 538
- def _reduce_158( val, _values, result )
- @lexer.commentpop
+module_eval(<<'.,.,', 'grammar.ra', 529)
+ def _reduce_158(val, _values, result)
+ @lexer.commentpop
result = ast(
AST::CaseOpt,
@@ -2035,479 +2101,516 @@ module_eval <<'.,.,', 'grammar.ra', 538
:statements => ast(AST::ASTArray)
)
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 539
- def _reduce_159( val, _values, result )
- result = aryfy(val[0])
- result
+module_eval(<<'.,.,', 'grammar.ra', 539)
+ def _reduce_159(val, _values, result)
+ result = aryfy(val[0])
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 544
- def _reduce_160( val, _values, result )
- val[0].push(val[2])
+module_eval(<<'.,.,', 'grammar.ra', 541)
+ def _reduce_160(val, _values, result)
+ val[0].push(val[2])
result = val[0]
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 548
- def _reduce_161( val, _values, result )
- result = ast AST::Selector, :param => val[0], :values => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 546)
+ def _reduce_161(val, _values, result)
+ result = ast AST::Selector, :param => val[0], :values => val[2]
+
+ result
end
.,.,
- # reduce 162 omitted
+# reduce 162 omitted
-module_eval <<'.,.,', 'grammar.ra', 554
- def _reduce_163( val, _values, result )
- @lexer.commentpop
+module_eval(<<'.,.,', 'grammar.ra', 551)
+ def _reduce_163(val, _values, result)
+ @lexer.commentpop
result = val[1]
- result
+
+ result
end
.,.,
- # reduce 164 omitted
+# reduce 164 omitted
-module_eval <<'.,.,', 'grammar.ra', 564
- def _reduce_165( val, _values, result )
- if val[0].instance_of?(AST::ASTArray)
+module_eval(<<'.,.,', 'grammar.ra', 557)
+ def _reduce_165(val, _values, result)
+ if val[0].instance_of?(AST::ASTArray)
val[0].push(val[2])
result = val[0]
else
result = ast AST::ASTArray, :children => [val[0],val[2]]
end
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 568
- def _reduce_166( val, _values, result )
- result = ast AST::ResourceParam, :param => val[0], :value => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 566)
+ def _reduce_166(val, _values, result)
+ result = ast AST::ResourceParam, :param => val[0], :value => val[2]
+
+ result
end
.,.,
- # reduce 167 omitted
+# reduce 167 omitted
+
+# reduce 168 omitted
- # reduce 168 omitted
+# reduce 169 omitted
- # reduce 169 omitted
+# reduce 170 omitted
- # reduce 170 omitted
+# reduce 171 omitted
- # reduce 171 omitted
+# reduce 172 omitted
- # reduce 172 omitted
+# reduce 173 omitted
- # reduce 173 omitted
+# reduce 174 omitted
-module_eval <<'.,.,', 'grammar.ra', 579
- def _reduce_174( val, _values, result )
- result = ast AST::Default, :value => val[0][:value], :line => val[0][:line]
- result
+module_eval(<<'.,.,', 'grammar.ra', 578)
+ def _reduce_175(val, _values, result)
+ result = ast AST::Default, :value => val[0][:value], :line => val[0][:line]
+
+ result
end
.,.,
- # reduce 175 omitted
+# reduce 176 omitted
-module_eval <<'.,.,', 'grammar.ra', 582
- def _reduce_176( val, _values, result )
- result = [val[0][:value]]
- result
+module_eval(<<'.,.,', 'grammar.ra', 583)
+ def _reduce_177(val, _values, result)
+ result = [val[0][:value]]
+ result
end
.,.,
- # reduce 177 omitted
+# reduce 178 omitted
-module_eval <<'.,.,', 'grammar.ra', 584
- def _reduce_178( val, _values, result )
- result = val[0] += val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 585)
+ def _reduce_179(val, _values, result)
+ result = val[0] += val[2]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 593
- def _reduce_179( val, _values, result )
- val[1].each do |file|
+module_eval(<<'.,.,', 'grammar.ra', 588)
+ def _reduce_180(val, _values, result)
+ val[1].each do |file|
import(file)
end
result = nil
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 605
- def _reduce_180( val, _values, result )
- @lexer.commentpop
+module_eval(<<'.,.,', 'grammar.ra', 598)
+ def _reduce_181(val, _values, result)
+ @lexer.commentpop
result = Puppet::Parser::AST::Definition.new(classname(val[1]),
ast_context(true).merge(:arguments => val[2], :code => val[4],
:line => val[0][:line]))
@lexer.indefine = false
#} | DEFINE NAME argumentlist parent LBRACE RBRACE {
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 610
- def _reduce_181( val, _values, result )
- @lexer.commentpop
+module_eval(<<'.,.,', 'grammar.ra', 606)
+ def _reduce_182(val, _values, result)
+ @lexer.commentpop
result = Puppet::Parser::AST::Definition.new(classname(val[1]),
ast_context(true).merge(:arguments => val[2], :line => val[0][:line]))
@lexer.indefine = false
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 620
- def _reduce_182( val, _values, result )
- @lexer.commentpop
+module_eval(<<'.,.,', 'grammar.ra', 614)
+ def _reduce_183(val, _values, result)
+ @lexer.commentpop
# Our class gets defined in the parent namespace, not our own.
@lexer.namepop
result = Puppet::Parser::AST::Hostclass.new(classname(val[1]),
ast_context(true).merge(:arguments => val[2], :parent => val[3],
:code => val[5], :line => val[0][:line]))
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 627
- def _reduce_183( val, _values, result )
- @lexer.commentpop
+module_eval(<<'.,.,', 'grammar.ra', 621)
+ def _reduce_184(val, _values, result)
+ @lexer.commentpop
# Our class gets defined in the parent namespace, not our own.
@lexer.namepop
result = Puppet::Parser::AST::Hostclass.new(classname(val[1]),
ast_context(true).merge(:arguments => val[2], :parent => val[3],
:line => val[0][:line]))
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 634
- def _reduce_184( val, _values, result )
- @lexer.commentpop
+module_eval(<<'.,.,', 'grammar.ra', 630)
+ def _reduce_185(val, _values, result)
+ @lexer.commentpop
result = Puppet::Parser::AST::Node.new(val[1],
ast_context(true).merge(:parent => val[2], :code => val[4],
:line => val[0][:line]))
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 637
- def _reduce_185( val, _values, result )
- @lexer.commentpop
+module_eval(<<'.,.,', 'grammar.ra', 635)
+ def _reduce_186(val, _values, result)
+ @lexer.commentpop
result = Puppet::Parser::AST::Node.new(val[1], ast_context(true).merge(:parent => val[2], :line => val[0][:line]))
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 638
- def _reduce_186( val, _values, result )
- result = val[0][:value]
- result
+module_eval(<<'.,.,', 'grammar.ra', 639)
+ def _reduce_187(val, _values, result)
+ result = val[0][:value]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 640
- def _reduce_187( val, _values, result )
- result = val[0][:value]
- result
+module_eval(<<'.,.,', 'grammar.ra', 641)
+ def _reduce_188(val, _values, result)
+ result = val[0][:value]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 641
- def _reduce_188( val, _values, result )
- result = val[0][:value]
- result
+module_eval(<<'.,.,', 'grammar.ra', 642)
+ def _reduce_189(val, _values, result)
+ result = val[0][:value]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 642
- def _reduce_189( val, _values, result )
- result = "class"
- result
+module_eval(<<'.,.,', 'grammar.ra', 643)
+ def _reduce_190(val, _values, result)
+ result = "class"
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 649
- def _reduce_190( val, _values, result )
- result = [result]
- result
+module_eval(<<'.,.,', 'grammar.ra', 648)
+ def _reduce_191(val, _values, result)
+ result = [result]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 653
- def _reduce_191( val, _values, result )
- result = val[0]
+module_eval(<<'.,.,', 'grammar.ra', 651)
+ def _reduce_192(val, _values, result)
+ result = val[0]
result << val[2]
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 657
- def _reduce_192( val, _values, result )
- result = ast AST::HostName, :value => val[0]
- result
+module_eval(<<'.,.,', 'grammar.ra', 656)
+ def _reduce_193(val, _values, result)
+ result = ast AST::HostName, :value => val[0]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 658
- def _reduce_193( val, _values, result )
- result = val[0][:value]
- result
+module_eval(<<'.,.,', 'grammar.ra', 659)
+ def _reduce_194(val, _values, result)
+ result = val[0][:value]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 659
- def _reduce_194( val, _values, result )
- result = val[0][:value]
- result
+module_eval(<<'.,.,', 'grammar.ra', 660)
+ def _reduce_195(val, _values, result)
+ result = val[0][:value]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 660
- def _reduce_195( val, _values, result )
- result = val[0][:value]
- result
+module_eval(<<'.,.,', 'grammar.ra', 661)
+ def _reduce_196(val, _values, result)
+ result = val[0][:value]
+ result
end
.,.,
- # reduce 196 omitted
+# reduce 197 omitted
-module_eval <<'.,.,', 'grammar.ra', 666
- def _reduce_197( val, _values, result )
- result = nil
- result
+module_eval(<<'.,.,', 'grammar.ra', 665)
+ def _reduce_198(val, _values, result)
+ result = nil
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 670
- def _reduce_198( val, _values, result )
- result = ast AST::ASTArray, :children => []
- result
+module_eval(<<'.,.,', 'grammar.ra', 669)
+ def _reduce_199(val, _values, result)
+ result = ast AST::ASTArray, :children => []
+
+ result
end
.,.,
- # reduce 199 omitted
+# reduce 200 omitted
+
+module_eval(<<'.,.,', 'grammar.ra', 674)
+ def _reduce_201(val, _values, result)
+ result = nil
-module_eval <<'.,.,', 'grammar.ra', 675
- def _reduce_200( val, _values, result )
- result = nil
- result
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 679
- def _reduce_201( val, _values, result )
- result = val[1]
+module_eval(<<'.,.,', 'grammar.ra', 677)
+ def _reduce_202(val, _values, result)
+ result = val[1]
result = [result] unless result[0].is_a?(Array)
- result
+
+ result
end
.,.,
- # reduce 202 omitted
+# reduce 203 omitted
-module_eval <<'.,.,', 'grammar.ra', 686
- def _reduce_203( val, _values, result )
- result = val[0]
+module_eval(<<'.,.,', 'grammar.ra', 683)
+ def _reduce_204(val, _values, result)
+ result = val[0]
result = [result] unless result[0].is_a?(Array)
result << val[2]
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 691
- def _reduce_204( val, _values, result )
- Puppet.warning addcontext("Deprecation notice: must now include '$' in prototype")
+module_eval(<<'.,.,', 'grammar.ra', 689)
+ def _reduce_205(val, _values, result)
+ Puppet.warning addcontext("Deprecation notice: must now include '$' in prototype")
result = [val[0][:value], val[2]]
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 695
- def _reduce_205( val, _values, result )
- Puppet.warning addcontext("Deprecation notice: must now include '$' in prototype")
+module_eval(<<'.,.,', 'grammar.ra', 693)
+ def _reduce_206(val, _values, result)
+ Puppet.warning addcontext("Deprecation notice: must now include '$' in prototype")
result = [val[0][:value]]
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 697
- def _reduce_206( val, _values, result )
- result = [val[0][:value], val[2]]
- result
+module_eval(<<'.,.,', 'grammar.ra', 696)
+ def _reduce_207(val, _values, result)
+ result = [val[0][:value], val[2]]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 699
- def _reduce_207( val, _values, result )
- result = [val[0][:value]]
- result
+module_eval(<<'.,.,', 'grammar.ra', 698)
+ def _reduce_208(val, _values, result)
+ result = [val[0][:value]]
+
+ result
end
.,.,
- # reduce 208 omitted
+# reduce 209 omitted
-module_eval <<'.,.,', 'grammar.ra', 704
- def _reduce_209( val, _values, result )
- result = val[1]
- result
+module_eval(<<'.,.,', 'grammar.ra', 703)
+ def _reduce_210(val, _values, result)
+ result = val[1]
+
+ result
end
.,.,
- # reduce 210 omitted
+# reduce 211 omitted
-module_eval <<'.,.,', 'grammar.ra', 709
- def _reduce_211( val, _values, result )
- result = val[1]
- result
+module_eval(<<'.,.,', 'grammar.ra', 708)
+ def _reduce_212(val, _values, result)
+ result = val[1]
+
+ result
end
.,.,
- # reduce 212 omitted
+# reduce 213 omitted
- # reduce 213 omitted
+# reduce 214 omitted
-module_eval <<'.,.,', 'grammar.ra', 715
- def _reduce_214( val, _values, result )
- result = ast AST::Variable, :value => val[0][:value], :line => val[0][:line]
- result
+module_eval(<<'.,.,', 'grammar.ra', 714)
+ def _reduce_215(val, _values, result)
+ result = ast AST::Variable, :value => val[0][:value], :line => val[0][:line]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 716
- def _reduce_215( val, _values, result )
- result = val[1]
- result
+module_eval(<<'.,.,', 'grammar.ra', 717)
+ def _reduce_216(val, _values, result)
+ result = val[1]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 717
- def _reduce_216( val, _values, result )
- result = val[1]
- result
+module_eval(<<'.,.,', 'grammar.ra', 718)
+ def _reduce_217(val, _values, result)
+ result = val[1]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 718
- def _reduce_217( val, _values, result )
- result = ast AST::ASTArray
- result
+module_eval(<<'.,.,', 'grammar.ra', 719)
+ def _reduce_218(val, _values, result)
+ result = ast AST::ASTArray
+ result
end
.,.,
- # reduce 218 omitted
+# reduce 219 omitted
- # reduce 219 omitted
+# reduce 220 omitted
- # reduce 220 omitted
+# reduce 221 omitted
-module_eval <<'.,.,', 'grammar.ra', 724
- def _reduce_221( val, _values, result )
- result = nil
- result
+module_eval(<<'.,.,', 'grammar.ra', 725)
+ def _reduce_222(val, _values, result)
+ result = nil
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 729
- def _reduce_222( val, _values, result )
- result = ast AST::Regex, :value => val[0][:value]
- result
+module_eval(<<'.,.,', 'grammar.ra', 728)
+ def _reduce_223(val, _values, result)
+ result = ast AST::Regex, :value => val[0][:value]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 737
- def _reduce_223( val, _values, result )
- if val[1].instance_of?(AST::ASTHash)
+module_eval(<<'.,.,', 'grammar.ra', 732)
+ def _reduce_224(val, _values, result)
+ if val[1].instance_of?(AST::ASTHash)
result = val[1]
else
result = ast AST::ASTHash, { :value => val[1] }
end
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 744
- def _reduce_224( val, _values, result )
- if val[1].instance_of?(AST::ASTHash)
+module_eval(<<'.,.,', 'grammar.ra', 739)
+ def _reduce_225(val, _values, result)
+ if val[1].instance_of?(AST::ASTHash)
result = val[1]
else
result = ast AST::ASTHash, { :value => val[1] }
end
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 746
- def _reduce_225( val, _values, result )
- result = ast AST::ASTHash
- result
+module_eval(<<'.,.,', 'grammar.ra', 745)
+ def _reduce_226(val, _values, result)
+ result = ast AST::ASTHash
+
+ result
end
.,.,
- # reduce 226 omitted
+# reduce 227 omitted
-module_eval <<'.,.,', 'grammar.ra', 756
- def _reduce_227( val, _values, result )
- if val[0].instance_of?(AST::ASTHash)
+module_eval(<<'.,.,', 'grammar.ra', 750)
+ def _reduce_228(val, _values, result)
+ if val[0].instance_of?(AST::ASTHash)
result = val[0].merge(val[2])
else
result = ast AST::ASTHash, :value => val[0]
result.merge(val[2])
end
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 760
- def _reduce_228( val, _values, result )
- result = ast AST::ASTHash, { :value => { val[0] => val[2] } }
- result
+module_eval(<<'.,.,', 'grammar.ra', 759)
+ def _reduce_229(val, _values, result)
+ result = ast AST::ASTHash, { :value => { val[0] => val[2] } }
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 761
- def _reduce_229( val, _values, result )
- result = val[0][:value]
- result
+module_eval(<<'.,.,', 'grammar.ra', 762)
+ def _reduce_230(val, _values, result)
+ result = val[0][:value]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 762
- def _reduce_230( val, _values, result )
- result = val[0]
- result
+module_eval(<<'.,.,', 'grammar.ra', 763)
+ def _reduce_231(val, _values, result)
+ result = val[0]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 767
- def _reduce_231( val, _values, result )
- result = ast AST::HashOrArrayAccess, :variable => val[0][:value], :key => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 766)
+ def _reduce_232(val, _values, result)
+ result = ast AST::HashOrArrayAccess, :variable => val[0][:value], :key => val[2]
+
+ result
end
.,.,
- # reduce 232 omitted
+# reduce 233 omitted
+
+module_eval(<<'.,.,', 'grammar.ra', 771)
+ def _reduce_234(val, _values, result)
+ result = ast AST::HashOrArrayAccess, :variable => val[0], :key => val[2]
-module_eval <<'.,.,', 'grammar.ra', 772
- def _reduce_233( val, _values, result )
- result = ast AST::HashOrArrayAccess, :variable => val[0], :key => val[2]
- result
+ result
end
.,.,
- def _reduce_none( val, _values, result )
- result
- end
+def _reduce_none(val, _values, result)
+ val[0]
+end
end # class Parser
-
- end # module Parser
-
-end # module Puppet
+ end # module Parser
+ end # module Puppet
diff --git a/lib/puppet/provider/computer/computer.rb b/lib/puppet/provider/computer/computer.rb
index a6be6bdfe..dd055beb3 100644
--- a/lib/puppet/provider/computer/computer.rb
+++ b/lib/puppet/provider/computer/computer.rb
@@ -10,9 +10,7 @@ Puppet::Type.type(:computer).provide :directoryservice, :parent => Puppet::Provi
domain, not in remote directories.
If you wish to manage /etc/hosts on Mac OS X, then simply use the host
- type as per other platforms.
-
- "
+ type as per other platforms."
confine :operatingsystem => :darwin
defaultfor :operatingsystem => :darwin
diff --git a/lib/puppet/provider/mount.rb b/lib/puppet/provider/mount.rb
index c979f742f..65296eed2 100644
--- a/lib/puppet/provider/mount.rb
+++ b/lib/puppet/provider/mount.rb
@@ -14,8 +14,11 @@ module Puppet::Provider::Mount
args << "-o" << self.options if self.options and self.options != :absent
args << resource[:name]
- flush if respond_to?(:flush)
mountcmd(*args)
+ case get(:ensure)
+ when :absent; set(:ensure => :ghost)
+ when :unmounted; set(:ensure => :mounted)
+ end
end
def remount
@@ -30,24 +33,17 @@ module Puppet::Provider::Mount
# This only works when the mount point is synced to the fstab.
def unmount
- umount resource[:name]
+ umount(resource[:name])
+
+ # Update property hash for future queries (e.g. refresh is called)
+ case get(:ensure)
+ when :mounted; set(:ensure => :unmounted)
+ when :ghost; set(:ensure => :absent)
+ end
end
# Is the mount currently mounted?
def mounted?
- platform = Facter.value("operatingsystem")
- name = resource[:name]
- mounts = mountcmd.split("\n").find do |line|
- case platform
- when "Darwin"
- line =~ / on #{name} / or line =~ %r{ on /private/var/automount#{name}}
- when "Solaris", "HP-UX"
- line =~ /^#{name} on /
- when "AIX"
- line.split(/\s+/)[1] == name
- else
- line =~ / on #{name} /
- end
- end
+ [:mounted, :ghost].include?(get(:ensure))
end
end
diff --git a/lib/puppet/provider/mount/parsed.rb b/lib/puppet/provider/mount/parsed.rb
index 82d1628bd..11c5e21a9 100755
--- a/lib/puppet/provider/mount/parsed.rb
+++ b/lib/puppet/provider/mount/parsed.rb
@@ -8,21 +8,17 @@ else
fstab = "/etc/fstab"
end
-
- Puppet::Type.type(:mount).provide(
- :parsed,
+Puppet::Type.type(:mount).provide(
+ :parsed,
:parent => Puppet::Provider::ParsedFile,
:default_target => fstab,
-
:filetype => :flat
) do
include Puppet::Provider::Mount
- #confine :exists => fstab
commands :mountcmd => "mount", :umount => "umount"
- @platform = Facter["operatingsystem"].value
- case @platform
+ case Facter["operatingsystem"]
when "Solaris"
@fields = [:device, :blockdevice, :name, :fstype, :pass, :atboot, :options]
else
@@ -43,5 +39,68 @@ end
record_line self.name, :fields => @fields, :separator => /\s+/, :joiner => "\t", :optional => optional_fields
-end
+ # Every entry in fstab is :unmounted until we can prove different
+ def self.prefetch_hook(target_records)
+ target_records.collect do |record|
+ record[:ensure] = :unmounted if record[:record_type] == :parsed
+ record
+ end
+ end
+
+ def self.prefetch(resources = nil)
+ # Get providers for all resources the user defined and that match
+ # a record in /etc/fstab.
+ super
+ # We need to do two things now:
+ # - Update ensure from :unmounted to :mounted if the resource is mounted
+ # - Check for mounted devices that are not in fstab and
+ # set ensure to :ghost (if the user wants to add an entry
+ # to fstab we need to know if the device was mounted before)
+ mountinstances.each do |hash|
+ if mount = resources[hash[:name]]
+ case mount.provider.get(:ensure)
+ when :absent # Mount not in fstab
+ mount.provider.set(:ensure => :ghost)
+ when :unmounted # Mount in fstab
+ mount.provider.set(:ensure => :mounted)
+ end
+ end
+ end
+ end
+ def self.mountinstances
+ # XXX: Will not work for mount points that have spaces in path (does fstab support this anyways?)
+ regex = case Facter.value(:operatingsystem)
+ when "Darwin"
+ / on (?:\/private\/var\/automount)?(\S*)/
+ when "Solaris", "HP-UX"
+ /^(\S*) on /
+ when "AIX"
+ /^(?:\S*\s+\S+\s+)(\S+)/
+ else
+ / on (\S*)/
+ end
+ instances = []
+ mount_output = mountcmd.split("\n")
+ if mount_output.length >= 2 and mount_output[1] =~ /^[- \t]*$/
+ # On some OSes (e.g. AIX) mount output begins with a header line
+ # followed by a line consisting of dashes and whitespace.
+ # Discard these two lines.
+ mount_output[0..1] = []
+ end
+ mount_output.each do |line|
+ if match = regex.match(line) and name = match.captures.first
+ instances << {:name => name, :mounted => :yes} # Only :name is important here
+ else
+ raise Puppet::Error, "Could not understand line #{line} from mount output"
+ end
+ end
+ instances
+ end
+
+ def flush
+ needs_mount = @property_hash.delete(:needs_mount)
+ super
+ mount if needs_mount
+ end
+end
diff --git a/lib/puppet/provider/parsedfile.rb b/lib/puppet/provider/parsedfile.rb
index ffd36e59f..75a215f4b 100755
--- a/lib/puppet/provider/parsedfile.rb
+++ b/lib/puppet/provider/parsedfile.rb
@@ -334,7 +334,9 @@ class Puppet::Provider::ParsedFile < Puppet::Provider
@property_hash[:target] = @resource.should(:target) || self.class.default_target
self.class.modified(@property_hash[:target])
end
- @property_hash[:name] ||= @resource.name
+ @resource.class.key_attributes.each do |attr|
+ @property_hash[attr] ||= @resource[attr]
+ end
self.class.flush(@property_hash)
diff --git a/lib/puppet/provider/service/daemontools.rb b/lib/puppet/provider/service/daemontools.rb
index 65abf7728..bbb962a71 100644
--- a/lib/puppet/provider/service/daemontools.rb
+++ b/lib/puppet/provider/service/daemontools.rb
@@ -19,10 +19,10 @@ Puppet::Type.type(:service).provide :daemontools, :parent => :base do
or this can be overriden in the service resource parameters::
- service {
- \"myservice\":
- provider => \"daemontools\", path => \"/path/to/daemons\";
- }
+ service { \"myservice\":
+ provider => \"daemontools\",
+ path => \"/path/to/daemons\",
+ }
This provider supports out of the box:
@@ -31,10 +31,10 @@ Puppet::Type.type(:service).provide :daemontools, :parent => :base do
* restart
* status
- If a service has ensure => \"running\", it will link /path/to/daemon to
+ If a service has `ensure => \"running\"`, it will link /path/to/daemon to
/path/to/service, which will automatically enable the service.
- If a service has ensure => \"stopped\", it will only down the service, not
+ If a service has `ensure => \"stopped\"`, it will only down the service, not
remove the /path/to/service link.
"
diff --git a/lib/puppet/provider/service/gentoo.rb b/lib/puppet/provider/service/gentoo.rb
index 382c74267..20f5d77e6 100644
--- a/lib/puppet/provider/service/gentoo.rb
+++ b/lib/puppet/provider/service/gentoo.rb
@@ -48,5 +48,3 @@ Puppet::Type.type(:service).provide :gentoo, :parent => :init do
raise Puppet::Error, "Could not enable #{self.name}: #{output}"
end
end
-
-# $Id $
diff --git a/lib/puppet/provider/service/launchd.rb b/lib/puppet/provider/service/launchd.rb
index 1632edabf..07c549a8b 100644
--- a/lib/puppet/provider/service/launchd.rb
+++ b/lib/puppet/provider/service/launchd.rb
@@ -3,33 +3,36 @@ require 'facter/util/plist'
Puppet::Type.type(:service).provide :launchd, :parent => :base do
desc "launchd service management framework.
- This provider manages launchd jobs, the default service framework for
- Mac OS X, that has also been open sourced by Apple for possible use on
- other platforms.
+ This provider manages jobs with launchd, which is the default service framework for
+ Mac OS X and is potentially available for use on other platforms.
See:
+
* http://developer.apple.com/macosx/launchd.html
* http://launchd.macosforge.org/
This provider reads plists out of the following directories:
+
* /System/Library/LaunchDaemons
* /System/Library/LaunchAgents
* /Library/LaunchDaemons
* /Library/LaunchAgents
- and builds up a list of services based upon each plists \"Label\" entry.
+ ...and builds up a list of services based upon each plist's \"Label\" entry.
This provider supports:
+
* ensure => running/stopped,
* enable => true/false
* status
* restart
Here is how the Puppet states correspond to launchd states:
- * stopped => job unloaded
- * started => job loaded
- * enabled => 'Disable' removed from job plist file
- * disabled => 'Disable' added to job plist file
+
+ * stopped --- job unloaded
+ * started --- job loaded
+ * enabled --- 'Disable' removed from job plist file
+ * disabled --- 'Disable' added to job plist file
Note that this allows you to do something launchctl can't do, which is to
be in a state of \"stopped/enabled\ or \"running/disabled\".
diff --git a/lib/puppet/provider/service/runit.rb b/lib/puppet/provider/service/runit.rb
index 0315b9597..736e3db71 100644
--- a/lib/puppet/provider/service/runit.rb
+++ b/lib/puppet/provider/service/runit.rb
@@ -18,10 +18,10 @@ Puppet::Type.type(:service).provide :runit, :parent => :daemontools do
or this can be overriden in the service resource parameters::
- service {
- \"myservice\":
- provider => \"runit\", path => \"/path/to/daemons\";
- }
+ service { \"myservice\":
+ provider => \"runit\",
+ path => \"/path/to/daemons\",
+ }
This provider supports out of the box:
diff --git a/lib/puppet/provider/user/useradd.rb b/lib/puppet/provider/user/useradd.rb
index ba406cc63..b87971738 100644
--- a/lib/puppet/provider/user/useradd.rb
+++ b/lib/puppet/provider/user/useradd.rb
@@ -19,7 +19,7 @@ Puppet::Type.type(:user).provide :useradd, :parent => Puppet::Provider::NameServ
value !~ /\s/
end
- has_features :manages_homedir, :allows_duplicates, :manages_expiry
+ has_features :manages_homedir, :allows_duplicates, :manages_expiry, :system_users
has_features :manages_passwords, :manages_password_age if Puppet.features.libshadow?
@@ -46,6 +46,10 @@ Puppet::Type.type(:user).provide :useradd, :parent => Puppet::Provider::NameServ
cmd
end
+ def check_system_users
+ @resource.system? ? ["-r"] : []
+ end
+
def add_properties
cmd = []
Puppet::Type.type(:user).validproperties.each do |property|
@@ -66,6 +70,7 @@ Puppet::Type.type(:user).provide :useradd, :parent => Puppet::Provider::NameServ
cmd += check_allow_dup
cmd += check_manage_home
cmd += check_manage_expiry
+ cmd += check_system_users
cmd << @resource[:name]
end
diff --git a/lib/puppet/provider/zpool/solaris.rb b/lib/puppet/provider/zpool/solaris.rb
index e597c2ae1..758ea618a 100644
--- a/lib/puppet/provider/zpool/solaris.rb
+++ b/lib/puppet/provider/zpool/solaris.rb
@@ -19,11 +19,13 @@ Puppet::Type.type(:zpool).provide(:solaris) do
pool_array.reverse.each do |value|
sym = nil
case value
- when "spares"; sym = :spare
- when "logs"; sym = :log
- when "mirror", "raidz1", "raidz2"
- sym = value == "mirror" ? :mirror : :raidz
- pool[:raid_parity] = "raidz2" if value == "raidz2"
+ when "spares";
+ sym = :spare
+ when "logs";
+ sym = :log
+ when /^mirror|^raidz1|^raidz2/;
+ sym = value =~ /^mirror/ ? :mirror : :raidz
+ pool[:raid_parity] = "raidz2" if value =~ /^raidz2/
else
tmp << value
sym = :disk if value == pool_array.first
diff --git a/lib/puppet/rails/database/004_add_inventory_service_tables.rb b/lib/puppet/rails/database/004_add_inventory_service_tables.rb
new file mode 100644
index 000000000..6e6b28c0c
--- /dev/null
+++ b/lib/puppet/rails/database/004_add_inventory_service_tables.rb
@@ -0,0 +1,36 @@
+class AddInventoryServiceTables < ActiveRecord::Migration
+ def self.up
+ unless ActiveRecord::Base.connection.tables.include?("inventory_nodes")
+ create_table :inventory_nodes do |t|
+ t.column :name, :string, :null => false
+ t.column :timestamp, :datetime, :null => false
+ t.column :updated_at, :datetime
+ t.column :created_at, :datetime
+ end
+
+ add_index :inventory_nodes, :name, :unique => true
+ end
+
+ unless ActiveRecord::Base.connection.tables.include?("inventory_facts")
+ create_table :inventory_facts, :id => false do |t|
+ t.column :node_id, :integer, :null => false
+ t.column :name, :string, :null => false
+ t.column :value, :text, :null => false
+ end
+
+ add_index :inventory_facts, [:node_id, :name], :unique => true
+ end
+ end
+
+ def self.down
+ unless ActiveRecord::Base.connection.tables.include?("inventory_nodes")
+ remove_index :inventory_nodes, :name
+ drop_table :inventory_nodes
+ end
+
+ if ActiveRecord::Base.connection.tables.include?("inventory_facts")
+ remove_index :inventory_facts, [:node_id, :name]
+ drop_table :inventory_facts
+ end
+ end
+end
diff --git a/lib/puppet/rails/database/schema.rb b/lib/puppet/rails/database/schema.rb
index 8b389d773..7b75f4216 100644
--- a/lib/puppet/rails/database/schema.rb
+++ b/lib/puppet/rails/database/schema.rb
@@ -103,6 +103,23 @@ class Puppet::Rails::Schema
t.column :created_at, :datetime
end
add_index :param_names, :name
+
+ create_table :inventory_nodes do |t|
+ t.column :name, :string, :null => false
+ t.column :timestamp, :datetime, :null => false
+ t.column :updated_at, :datetime
+ t.column :created_at, :datetime
+ end
+
+ add_index :inventory_nodes, :name, :unique => true
+
+ create_table :inventory_facts, :id => false do |t|
+ t.column :node_id, :integer, :null => false
+ t.column :name, :string, :null => false
+ t.column :value, :text, :null => false
+ end
+
+ add_index :inventory_facts, [:node_id, :name], :unique => true
end
end
ensure
diff --git a/lib/puppet/rails/fact_name.rb b/lib/puppet/rails/fact_name.rb
index fb40ec48f..4273399e5 100644
--- a/lib/puppet/rails/fact_name.rb
+++ b/lib/puppet/rails/fact_name.rb
@@ -3,5 +3,3 @@ require 'puppet/rails/fact_value'
class Puppet::Rails::FactName < ActiveRecord::Base
has_many :fact_values, :dependent => :destroy
end
-
-# $Id: fact_name.rb 1952 2006-12-19 05:47:57Z luke $
diff --git a/lib/puppet/rails/fact_value.rb b/lib/puppet/rails/fact_value.rb
index 45a88b2dc..9fd81ae1c 100644
--- a/lib/puppet/rails/fact_value.rb
+++ b/lib/puppet/rails/fact_value.rb
@@ -6,5 +6,3 @@ class Puppet::Rails::FactValue < ActiveRecord::Base
"#{self.fact_name.name}"
end
end
-
-# $Id: fact_value.rb 1952 2006-12-19 05:47:57Z luke $
diff --git a/lib/puppet/rails/inventory_fact.rb b/lib/puppet/rails/inventory_fact.rb
new file mode 100644
index 000000000..aa6334eef
--- /dev/null
+++ b/lib/puppet/rails/inventory_fact.rb
@@ -0,0 +1,5 @@
+require 'puppet/rails/inventory_node'
+
+class Puppet::Rails::InventoryFact < ::ActiveRecord::Base
+ belongs_to :node, :class_name => "Puppet::Rails::InventoryNode"
+end
diff --git a/lib/puppet/rails/inventory_node.rb b/lib/puppet/rails/inventory_node.rb
new file mode 100644
index 000000000..52f8621a4
--- /dev/null
+++ b/lib/puppet/rails/inventory_node.rb
@@ -0,0 +1,25 @@
+require 'puppet/rails/inventory_fact'
+
+class Puppet::Rails::InventoryNode < ::ActiveRecord::Base
+ has_many :facts, :class_name => "Puppet::Rails::InventoryFact", :foreign_key => :node_id, :dependent => :delete_all
+
+ named_scope :has_fact_with_value, lambda { |name,value|
+ {
+ :conditions => ["inventory_facts.name = ? AND inventory_facts.value = ?", name, value],
+ :joins => :facts
+ }
+ }
+
+ named_scope :has_fact_without_value, lambda { |name,value|
+ {
+ :conditions => ["inventory_facts.name = ? AND inventory_facts.value != ?", name, value],
+ :joins => :facts
+ }
+ }
+
+ def facts_to_hash
+ facts.inject({}) do |fact_hash,fact|
+ fact_hash.merge(fact.name => fact.value)
+ end
+ end
+end
diff --git a/lib/puppet/reference/configuration.rb b/lib/puppet/reference/configuration.rb
index c8ff145ba..6581427ff 100644
--- a/lib/puppet/reference/configuration.rb
+++ b/lib/puppet/reference/configuration.rb
@@ -122,7 +122,7 @@ likewise be redirected to a file:
Puppet can also create user and group accounts for itself (one `puppet` group
and one `puppet` user) if it is invoked as `root` with the `--mkusers` argument:
- $ puppet agent --mkusers
+ $ puppet master --mkusers
## Signals
diff --git a/lib/puppet/reference/metaparameter.rb b/lib/puppet/reference/metaparameter.rb
index c16a1d33a..3c4c08701 100644
--- a/lib/puppet/reference/metaparameter.rb
+++ b/lib/puppet/reference/metaparameter.rb
@@ -29,7 +29,7 @@ in your manifest, including defined components.
params.sort { |a,b|
a.to_s <=> b.to_s
}.each { |param|
- str += paramwrap(param.to_s, scrub(Puppet::Type.metaparamdoc(param)), :level => 4)
+ str += paramwrap(param.to_s, scrub(Puppet::Type.metaparamdoc(param)), :level => 3)
}
rescue => detail
puts detail.backtrace
diff --git a/lib/puppet/reports/store.rb b/lib/puppet/reports/store.rb
index 99a9fc177..625a263b3 100644
--- a/lib/puppet/reports/store.rb
+++ b/lib/puppet/reports/store.rb
@@ -15,7 +15,10 @@ Puppet::Reports.register_report(:store) do
dir = File.join(Puppet[:reportdir], client)
- Dir.mkdir(dir, 0750) unless FileTest.exists?(dir)
+ if ! FileTest.exists?(dir)
+ FileUtils.mkdir_p(dir)
+ FileUtils.chmod_R(0750, dir)
+ end
# Now store the report.
now = Time.now.gmtime
diff --git a/lib/puppet/resource.rb b/lib/puppet/resource.rb
index e832804f5..214516908 100644
--- a/lib/puppet/resource.rb
+++ b/lib/puppet/resource.rb
@@ -5,6 +5,11 @@ require 'puppet/util/pson'
# The simplest resource class. Eventually it will function as the
# base class for all resource-like behaviour.
class Puppet::Resource
+ # This stub class is only needed for serialization compatibility with 0.25.x.
+ # Specifically, it exists to provide a compatibility API when using YAML
+ # serialized objects loaded from StoreConfigs.
+ Reference = Puppet::Resource
+
include Puppet::Util::Tagging
require 'puppet/resource/type_collection_helper'
@@ -87,7 +92,7 @@ class Puppet::Resource
def yaml_property_munge(x)
case x
when Hash
- x.inject({}) { |h,kv|
+ x.inject({}) { |h,kv|
k,v = kv
h[k] = self.class.value_to_pson_data(v)
h
@@ -104,7 +109,7 @@ class Puppet::Resource
# be overridden at some point, but this works for now.
%w{has_key? keys length delete empty? <<}.each do |method|
define_method(method) do |*args|
- @parameters.send(method, *args)
+ parameters.send(method, *args)
end
end
@@ -112,13 +117,13 @@ class Puppet::Resource
# to lower-case symbols.
def []=(param, value)
validate_parameter(param) if validate_parameters
- @parameters[parameter_name(param)] = value
+ parameters[parameter_name(param)] = value
end
# Return a given parameter's value. Converts all passed names
# to lower-case symbols.
def [](param)
- @parameters[parameter_name(param)]
+ parameters[parameter_name(param)]
end
def ==(other)
@@ -140,11 +145,11 @@ class Puppet::Resource
# Iterate over each param/value pair, as required for Enumerable.
def each
- @parameters.each { |p,v| yield p, v }
+ parameters.each { |p,v| yield p, v }
end
def include?(parameter)
- super || @parameters.keys.include?( parameter_name(parameter) )
+ super || parameters.keys.include?( parameter_name(parameter) )
end
# These two methods are extracted into a Helper
@@ -170,14 +175,6 @@ class Puppet::Resource
end
end
- # This stub class is only needed for serialization compatibility with 0.25.x
- class Reference
- attr_accessor :type,:title
- def initialize(type,title)
- @type,@title = type,title
- end
- end
-
# Create our resource.
def initialize(type, title = nil, attributes = {})
@parameters = {}
@@ -204,7 +201,7 @@ class Puppet::Resource
tag(self.type)
tag(self.title) if valid_tag?(self.title)
- @reference = Reference.new(@type,@title) # for serialization compatibility with 0.25.x
+ @reference = self # for serialization compatibility with 0.25.x
if strict? and ! resource_type
if @type == 'Class'
raise ArgumentError, "Could not find declared class #{title}"
@@ -234,7 +231,7 @@ class Puppet::Resource
# Produce a simple hash of our parameters.
def to_hash
- parse_title.merge @parameters
+ parse_title.merge parameters
end
def to_s
@@ -255,15 +252,26 @@ class Puppet::Resource
# Convert our resource to Puppet code.
def to_manifest
- "%s { '%s':\n%s\n}" % [self.type.to_s.downcase, self.title,
- @parameters.collect { |p, v|
- if v.is_a? Array
- " #{p} => [\'#{v.join("','")}\']"
- else
- " #{p} => \'#{v}\'"
- end
- }.join(",\n")
- ]
+ # Collect list of attributes to align => and move ensure first
+ attr = parameters.keys
+ attr_max = attr.inject(0) { |max,k| k.to_s.length > max ? k.to_s.length : max }
+
+ attr.sort!
+ if attr.first != :ensure && attr.include?(:ensure)
+ attr.delete(:ensure)
+ attr.unshift(:ensure)
+ end
+
+ attributes = attr.collect { |k|
+ v = parameters[k]
+ if v.is_a? Array
+ " %-#{attr_max}s => %s,\n" % [ k, "[\'#{v.join("', '")}\']" ]
+ else
+ " %-#{attr_max}s => %s,\n" % [ k, "\'#{v}\'" ]
+ end
+ }
+
+ "%s { '%s':\n%s}" % [self.type.to_s.downcase, self.title, attributes]
end
def to_ref
@@ -422,4 +430,10 @@ class Puppet::Resource
return { :name => title.to_s }
end
end
+
+ def parameters
+ # @parameters could have been loaded from YAML, causing it to be nil (by
+ # bypassing initialize).
+ @parameters ||= {}
+ end
end
diff --git a/lib/puppet/simple_graph.rb b/lib/puppet/simple_graph.rb
index 9d7f218a6..e39aa8770 100644
--- a/lib/puppet/simple_graph.rb
+++ b/lib/puppet/simple_graph.rb
@@ -1,6 +1,3 @@
-# Created by Luke A. Kanies on 2007-11-07.
-# Copyright (c) 2007. All rights reserved.
-
require 'puppet/external/dot'
require 'puppet/relationship'
require 'set'
@@ -92,36 +89,177 @@ class Puppet::SimpleGraph
vertices
end
- # Provide a topological sort with cycle reporting
- def topsort_with_cycles
- degree = {}
- zeros = []
- result = []
+ # This is a simple implementation of Tarjan's algorithm to find strongly
+ # connected components in the graph; this is a fairly ugly implementation,
+ # because I can't just decorate the vertices themselves.
+ #
+ # This method has an unhealthy relationship with the find_cycles_in_graph
+ # method below, which contains the knowledge of how the state object is
+ # maintained.
+ def tarjan(root, s)
+ # initialize the recursion stack we use to work around the nasty lack of a
+ # decent Ruby stack.
+ recur = [{ :node => root }]
+
+ while not recur.empty? do
+ frame = recur.last
+ vertex = frame[:node]
+
+ case frame[:step]
+ when nil then
+ s[:index][vertex] = s[:number]
+ s[:lowlink][vertex] = s[:number]
+ s[:number] = s[:number] + 1
+
+ s[:stack].push(vertex)
+ s[:seen][vertex] = true
+
+ frame[:children] = adjacent(vertex)
+ frame[:step] = :children
+
+ when :children then
+ if frame[:children].length > 0 then
+ child = frame[:children].shift
+ if ! s[:index][child] then
+ # Never seen, need to recurse.
+ frame[:step] = :after_recursion
+ frame[:child] = child
+ recur.push({ :node => child })
+ elsif s[:seen][child] then
+ s[:lowlink][vertex] = [s[:lowlink][vertex], s[:index][child]].min
+ end
+ else
+ if s[:lowlink][vertex] == s[:index][vertex] then
+ this_scc = []
+ begin
+ top = s[:stack].pop
+ s[:seen][top] = false
+ this_scc << top
+ end until top == vertex
+ # NOTE: if we don't reverse we get the components in the opposite
+ # order to what a human being would expect; reverse should be an
+ # O(1) operation, without even copying, because we know the length
+ # of the source, but I worry that an implementation will get this
+ # wrong. Still, the worst case is O(n) for n vertices as we can't
+ # possibly put a vertex into two SCCs.
+ #
+ # Also, my feeling is that most implementations are going to do
+ # better with a reverse operation than a string of 'unshift'
+ # insertions at the head of the array; if they were going to mess
+ # up the performance of one, it would be unshift.
+ s[:scc] << this_scc.reverse
+ end
+ recur.pop # done with this node, finally.
+ end
- # Collect each of our vertices, with the number of in-edges each has.
- vertices.each do |v|
- edges = @in_to[v].dup
- zeros << v if edges.empty?
- degree[v] = edges
+ when :after_recursion then
+ s[:lowlink][vertex] = [s[:lowlink][vertex], s[:lowlink][frame[:child]]].min
+ frame[:step] = :children
+
+ else
+ fail "#{frame[:step]} is an unknown step"
+ end
end
+ end
- # Iterate over each 0-degree vertex, decrementing the degree of
- # each of its out-edges.
- while v = zeros.pop
- result << v
- @out_from[v].each { |v2,es|
- degree[v2].delete(v)
- zeros << v2 if degree[v2].empty?
- }
+ # Find all cycles in the graph by detecting all the strongly connected
+ # components, then eliminating everything with a size of one as
+ # uninteresting - which it is, because it can't be a cycle. :)
+ #
+ # This has an unhealthy relationship with the 'tarjan' method above, which
+ # it uses to implement the detection of strongly connected components.
+ def find_cycles_in_graph
+ state = {
+ :number => 0, :index => {}, :lowlink => {}, :scc => [],
+ :stack => [], :seen => {}
+ }
+
+ # we usually have a disconnected graph, must walk all possible roots
+ vertices.each do |vertex|
+ if ! state[:index][vertex] then
+ tarjan vertex, state
+ end
end
- # If we have any vertices left with non-zero in-degrees, then we've found a cycle.
- if cycles = degree.values.reject { |ns| ns.empty? } and cycles.length > 0
- message = cycles.collect { |edges| '('+edges.collect { |e| e.to_s }.join(", ")+')' }.join(", ")
- raise Puppet::Error, "Found dependency cycles in the following relationships: #{message}; try using the '--graph' option and open the '.dot' files in OmniGraffle or GraphViz"
+ state[:scc].select { |c| c.length > 1 }
+ end
+
+ # Perform a BFS on the sub graph representing the cycle, with a view to
+ # generating a sufficient set of paths to report the cycle meaningfully, and
+ # ideally usefully, for the end user.
+ #
+ # BFS is preferred because it will generally report the shortest paths
+ # through the graph first, which are more likely to be interesting to the
+ # user. I think; it would be interesting to verify that. --daniel 2011-01-23
+ def paths_in_cycle(cycle, max_paths = 1)
+ raise ArgumentError, "negative or zero max_paths" if max_paths < 1
+
+ # Calculate our filtered outbound vertex lists...
+ adj = {}
+ cycle.each do |vertex|
+ adj[vertex] = adjacent(vertex).select{|s| cycle.member? s}
end
- result
+ found = []
+
+ # frame struct is vertex, [path]
+ stack = [[cycle.first, []]]
+ while frame = stack.shift do
+ if frame[1].member?(frame[0]) then
+ found << frame[1] + [frame[0]]
+ break if found.length >= max_paths
+ else
+ adj[frame[0]].each do |to|
+ stack.push [to, frame[1] + [frame[0]]]
+ end
+ end
+ end
+
+ return found
+ end
+
+ def report_cycles_in_graph
+ cycles = find_cycles_in_graph
+ n = cycles.length # where is "pluralize"? --daniel 2011-01-22
+ s = n == 1 ? '' : 's'
+
+ message = "Found #{n} dependency cycle#{s}:\n"
+ cycles.each do |cycle|
+ paths = paths_in_cycle(cycle)
+ message += paths.map{ |path| '(' + path.join(" => ") + ')'}.join("\n") + "\n"
+ end
+
+ if Puppet[:graph] then
+ filename = write_cycles_to_graph(cycles)
+ message += "Cycle graph written to #{filename}."
+ else
+ message += "Try the '--graph' option and opening the "
+ message += "resulting '.dot' file in OmniGraffle or GraphViz"
+ end
+
+ raise Puppet::Error, message
+ end
+
+ def write_cycles_to_graph(cycles)
+ # This does not use the DOT graph library, just writes the content
+ # directly. Given the complexity of this, there didn't seem much point
+ # using a heavy library to generate exactly the same content. --daniel 2011-01-27
+ Puppet.settings.use(:graphing)
+
+ graph = ["digraph Resource_Cycles {"]
+ graph << ' label = "Resource Cycles"'
+
+ cycles.each do |cycle|
+ paths_in_cycle(cycle, 10).each do |path|
+ graph << path.map { |v| '"' + v.to_s.gsub(/"/, '\\"') + '"' }.join(" -> ")
+ end
+ end
+
+ graph << '}'
+
+ filename = File.join(Puppet[:graphdir], "cycles.dot")
+ File.open(filename, "w") { |f| f.puts graph }
+ return filename
end
# Provide a topological sort.
@@ -141,14 +279,14 @@ class Puppet::SimpleGraph
# each of its out-edges.
while v = zeros.pop
result << v
- @out_from[v].each { |v2,es|
+ @out_from[v].each { |v2,es|
zeros << v2 if (degree[v2] -= 1) == 0
}
end
# If we have any vertices left with non-zero in-degrees, then we've found a cycle.
if cycles = degree.values.reject { |ns| ns == 0 } and cycles.length > 0
- topsort_with_cycles
+ report_cycles_in_graph
end
result
diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb
index e03650b54..d24cc8554 100644
--- a/lib/puppet/type.rb
+++ b/lib/puppet/type.rb
@@ -200,7 +200,7 @@ class Type
end
def uniqueness_key
- to_resource.uniqueness_key
+ self.class.key_attributes.sort_by { |attribute_name| attribute_name.to_s }.map{ |attribute_name| self[attribute_name] }
end
# Create a new parameter. Requires a block and a name, stores it in the
@@ -382,8 +382,8 @@ class Type
fail("Invalid parameter #{name}(#{name.inspect})") unless self.class.validattr?(name)
- if name == :name
- name = name_var
+ if name == :name && nv = name_var
+ name = nv
end
if obj = @parameters[name]
@@ -403,8 +403,8 @@ class Type
fail("Invalid parameter #{name}") unless self.class.validattr?(name)
- if name == :name
- name = name_var
+ if name == :name && nv = name_var
+ name = nv
end
raise Puppet::Error.new("Got nil value for #{name}") if value.nil?
@@ -957,12 +957,25 @@ class Type
end
newmetaparam(:audit) do
- desc "Audit specified attributes of resources over time, and report if any have changed.
- This attribute can be used to track changes to any resource over time, and can
- provide an audit trail of every change that happens on any given machine.
-
- Note that you cannot both audit and manage an attribute - managing it guarantees
- the value, and any changes already get logged."
+ desc "Marks a subset of this resource's unmanaged attributes for auditing. Accepts an
+ attribute name or a list of attribute names.
+
+ Auditing a resource attribute has two effects: First, whenever a catalog
+ is applied with puppet apply or puppet agent, Puppet will check whether
+ that attribute of the resource has been modified, comparing its current
+ value to the previous run; any change will be logged alongside any actions
+ performed by Puppet while applying the catalog.
+
+ Secondly, marking a resource attribute for auditing will include that
+ attribute in inspection reports generated by puppet inspect; see the
+ puppet inspect documentation for more details.
+
+ Managed attributes for a resource can also be audited, but note that
+ changes made by Puppet will be logged as additional modifications. (I.e.
+ if a user manually edits a file whose contents are audited and managed,
+ puppet agent's next two runs will both log an audit notice: the first run
+ will log the user's edit and then revert the file to the desired state,
+ and the second run will log the edit made by Puppet.)"
validate do |list|
list = Array(list).collect {|p| p.to_sym}
diff --git a/lib/puppet/type/augeas.rb b/lib/puppet/type/augeas.rb
index d29bda648..a8fb1f15f 100644
--- a/lib/puppet/type/augeas.rb
+++ b/lib/puppet/type/augeas.rb
@@ -98,10 +98,10 @@ Puppet::Type.newtype(:augeas) do
can be either a string which contains a command or an array of commands.
Commands supported are:
- set [PATH] [VALUE] Sets the value VALUE at loction PATH
- rm [PATH] Removes the node at location PATH
- remove [PATH] Synonym for rm
- clear [PATH] Keeps the node at PATH, but removes the value.
+ set [PATH] [VALUE] Sets the value VALUE at loction PATH
+ rm [PATH] Removes the node at location PATH
+ remove [PATH] Synonym for rm
+ clear [PATH] Keeps the node at PATH, but removes the value.
ins [LABEL] [WHERE] [PATH] Inserts an empty node LABEL either [WHERE={before|after}] PATH.
insert [LABEL] [WHERE] [PATH] Synonym for ins
diff --git a/lib/puppet/type/computer.rb b/lib/puppet/type/computer.rb
index 89a0692bf..7a2c52d53 100644
--- a/lib/puppet/type/computer.rb
+++ b/lib/puppet/type/computer.rb
@@ -14,7 +14,11 @@ Puppet::Type.newtype(:computer) do
type as per other platforms.
This type primarily exists to create localhost Computer objects that MCX
- policy can then be attached to."
+ policy can then be attached to.
+
+ **Autorequires:** If Puppet is managing the plist file representing a
+ Computer object (located at `/var/db/dslocal/nodes/Default/computers/{name}.plist`),
+ the Computer resource will autorequire it."
# ensurable
diff --git a/lib/puppet/type/exec.rb b/lib/puppet/type/exec.rb
index daa49e223..ae579502a 100755
--- a/lib/puppet/type/exec.rb
+++ b/lib/puppet/type/exec.rb
@@ -22,7 +22,9 @@ module Puppet
to native Puppet types as quickly as possible. If you find that
you are doing a lot of work with `exec`, please at least notify
us at Puppet Labs what you are doing, and hopefully we can work with
- you to get a native resource type for the work you are doing."
+ you to get a native resource type for the work you are doing.
+
+ **Autorequires:** If Puppet is managing an exec's cwd or the executable file used in an exec's command, the exec resource will autorequire those files. If Puppet is managing the user that an exec should run as, the exec resource will autorequire that user."
require 'open3'
@@ -211,15 +213,6 @@ module Puppet
end
end
- newparam(:env) do
- desc "This parameter is deprecated. Use 'environment' instead."
-
- munge do |value|
- warning "'env' is deprecated on exec; use 'environment' instead."
- resource[:environment] = value
- end
- end
-
newparam(:environment) do
desc "Any additional environment variables you want to set for a
command. Note that if you use this to set PATH, it will override
diff --git a/lib/puppet/type/file.rb b/lib/puppet/type/file.rb
index 963b9e5dd..16b1f962d 100644
--- a/lib/puppet/type/file.rb
+++ b/lib/puppet/type/file.rb
@@ -22,7 +22,9 @@ Puppet::Type.newtype(:file) do
If you find that you are often copying files in from a central
location, rather than using native resources, please contact
Puppet Labs and we can hopefully work with you to develop a
- native resource to support what you are doing."
+ native resource to support what you are doing.
+
+ **Autorequires:** If Puppet is managing the user or group that owns a file, the file resource will autorequire them. If Puppet is managing any parent directories of a file, the file resource will autorequire them."
def self.title_patterns
[ [ /^(.*?)\/*\Z/m, [ [ :path, lambda{|x| x} ] ] ] ]
diff --git a/lib/puppet/type/file/content.rb b/lib/puppet/type/file/content.rb
index cf924f371..827183213 100755
--- a/lib/puppet/type/file/content.rb
+++ b/lib/puppet/type/file/content.rb
@@ -17,22 +17,21 @@ module Puppet
desc "Specify the contents of a file as a string. Newlines, tabs, and
spaces can be specified using the escaped syntax (e.g., \\n for a newline). The primary purpose of this parameter is to provide a
- kind of limited templating::
-
- define resolve(nameserver1, nameserver2, domain, search) {
- $str = \"search $search
- domain $domain
- nameserver $nameserver1
- nameserver $nameserver2
- \"
-
- file { \"/etc/resolv.conf\":
- content => $str
+ kind of limited templating:
+
+ define resolve(nameserver1, nameserver2, domain, search) {
+ $str = \"search $search
+ domain $domain
+ nameserver $nameserver1
+ nameserver $nameserver2
+ \"
+
+ file { \"/etc/resolv.conf\":
+ content => $str
+ }
}
- }
- This attribute is especially useful when used with
- `PuppetTemplating templating`:trac:."
+ This attribute is especially useful when used with templating."
# Store a checksum as the value, rather than the actual content.
# Simplifies everything.
@@ -164,13 +163,15 @@ module Puppet
Puppet.settings[:name] == "apply"
end
+ # the content is munged so if it's a checksum source_or_content is nil
+ # unless the checksum indirectly comes from source
def each_chunk_from(source_or_content)
if source_or_content.is_a?(String)
yield source_or_content
- elsif source_or_content.nil? && resource.parameter(:ensure) && [:present, :file].include?(resource.parameter(:ensure).value)
- yield ''
- elsif source_or_content.nil?
+ elsif content_is_really_a_checksum? && source_or_content.nil?
yield read_file_from_filebucket
+ elsif source_or_content.nil?
+ yield ''
elsif self.class.standalone?
yield source_or_content.content
elsif source_or_content.local?
@@ -182,6 +183,10 @@ module Puppet
private
+ def content_is_really_a_checksum?
+ checksum?(should)
+ end
+
def chunk_file_from_disk(source_or_content)
File.open(source_or_content.full_path, "r") do |src|
while chunk = src.read(8192)
@@ -195,7 +200,6 @@ module Puppet
connection = Puppet::Network::HttpPool.http_instance(source_or_content.server, source_or_content.port)
connection.request_get(indirection2uri(request), add_accept_encoding({"Accept" => "raw"})) do |response|
case response.code
- when "404"; nil
when /^2/; uncompress(response) { |uncompressor| response.read_body { |chunk| yield uncompressor.uncompress(chunk) } }
else
# Raise the http error if we didn't get a 'success' of some kind.
diff --git a/lib/puppet/type/file/ensure.rb b/lib/puppet/type/file/ensure.rb
index 4a68551ee..99652ecc6 100755
--- a/lib/puppet/type/file/ensure.rb
+++ b/lib/puppet/type/file/ensure.rb
@@ -7,29 +7,23 @@ module Puppet
if the file is missing will create an empty file. Specifying
`absent` will delete the file (and directory if recurse => true).
- Anything other than those values will be considered to be a symlink.
- For instance, the following text creates a link:
+ Anything other than those values will create a symlink. In the interest of readability and clarity, you should use `ensure => link` and explicitly specify a
+ target; however, if a `target` attribute isn't provided, the value of the `ensure`
+ attribute will be used as the symlink target:
- # Useful on solaris
+ # (Useful on Solaris)
+ # Less maintainable:
file { \"/etc/inetd.conf\":
- ensure => \"/etc/inet/inetd.conf\"
+ ensure => \"/etc/inet/inetd.conf\",
}
- You can make relative links:
-
- # Useful on solaris
+ # More maintainable:
file { \"/etc/inetd.conf\":
- ensure => \"inet/inetd.conf\"
+ ensure => link,
+ target => \"/etc/inet/inetd.conf\",
}
-
- If you need to make a relative link to a file named the same
- as one of the valid values, you must prefix it with `./` or
- something similar.
-
- You can also make recursive symlinks, which will create a
- directory structure that maps to the target directory,
- with directories corresponding to each directory
- and links corresponding to each file."
+
+ These two declarations are equivalent."
# Most 'ensure' properties have a default, but with files we, um, don't.
nodefault
diff --git a/lib/puppet/type/file/selcontext.rb b/lib/puppet/type/file/selcontext.rb
index a33c6a000..ea385eec0 100644
--- a/lib/puppet/type/file/selcontext.rb
+++ b/lib/puppet/type/file/selcontext.rb
@@ -32,9 +32,14 @@ module Puppet
end
def retrieve_default_context(property)
+ if @resource[:selinux_ignore_defaults] == :true
+ return nil
+ end
+
unless context = self.get_selinux_default_context(@resource[:path])
return nil
end
+
property_default = self.parse_selinux_context(property, context)
self.debug "Found #{property} default '#{property_default}' for #{@resource[:path]}" if not property_default.nil?
property_default
@@ -54,6 +59,17 @@ module Puppet
end
end
+ Puppet::Type.type(:file).newparam(:selinux_ignore_defaults) do
+ desc "If this is set then Puppet will not ask SELinux (via matchpathcon) to
+ supply defaults for the SELinux attributes (seluser, selrole,
+ seltype, and selrange). In general, you should leave this set at its
+ default and only set it to true when you need Puppet to not try to fix
+ SELinux labels automatically."
+ newvalues(:true, :false)
+
+ defaultto :false
+ end
+
Puppet::Type.type(:file).newproperty(:seluser, :parent => Puppet::SELFileContext) do
desc "What the SELinux user component of the context of the file should be.
Any valid SELinux user component is accepted. For example `user_u`.
diff --git a/lib/puppet/type/file/source.rb b/lib/puppet/type/file/source.rb
index ac06a26a1..d3b3a48eb 100755
--- a/lib/puppet/type/file/source.rb
+++ b/lib/puppet/type/file/source.rb
@@ -132,10 +132,6 @@ module Puppet
end
end
- def pinparams
- [:mode, :type, :owner, :group, :content]
- end
-
def found?
! (metadata.nil? or metadata.ftype.nil?)
end
@@ -161,16 +157,6 @@ module Puppet
result
end
- # Make sure we're also checking the checksum
- def value=(value)
- super
-
- checks = (pinparams + [:ensure])
- checks.delete(:checksum)
-
- resource[:audit] = checks
- end
-
def local?
found? and uri and (uri.scheme || "file") == "file"
end
diff --git a/lib/puppet/type/file/target.rb b/lib/puppet/type/file/target.rb
index b9fe9213b..7d391e672 100644
--- a/lib/puppet/type/file/target.rb
+++ b/lib/puppet/type/file/target.rb
@@ -1,7 +1,20 @@
module Puppet
Puppet::Type.type(:file).newproperty(:target) do
desc "The target for creating a link. Currently, symlinks are the
- only type supported."
+ only type supported.
+
+ You can make relative links:
+
+ # (Useful on Solaris)
+ file { \"/etc/inetd.conf\":
+ ensure => link,
+ target => \"inet/inetd.conf\",
+ }
+
+ You can also make recursive symlinks, which will create a
+ directory structure that maps to the target directory,
+ with directories corresponding to each directory
+ and links corresponding to each file."
newvalue(:notlink) do
# We do nothing if the value is absent
diff --git a/lib/puppet/type/k5login.rb b/lib/puppet/type/k5login.rb
index a343e9e5c..eac142ff7 100644
--- a/lib/puppet/type/k5login.rb
+++ b/lib/puppet/type/k5login.rb
@@ -1,5 +1,3 @@
-# $Id: k5login.rb 2468 2007-08-07 23:30:20Z digant $
-#
# Plug-in type for handling k5login files
Puppet::Type.newtype(:k5login) do
diff --git a/lib/puppet/type/macauthorization.rb b/lib/puppet/type/macauthorization.rb
index ef6fbb6c1..e89aa7c89 100644
--- a/lib/puppet/type/macauthorization.rb
+++ b/lib/puppet/type/macauthorization.rb
@@ -1,7 +1,10 @@
Puppet::Type.newtype(:macauthorization) do
@doc = "Manage the Mac OS X authorization database.
- See the [Apple developer site](http://developer.apple.com/documentation/Security/Conceptual/Security_Overview/Security_Services/chapter_4_section_5.html) for more information."
+ See the [Apple developer site](http://developer.apple.com/documentation/Security/Conceptual/Security_Overview/Security_Services/chapter_4_section_5.html) for more information.
+
+ **Autorequires:** If Puppet is managing the `/etc/authorization` file, each
+ macauthorization resource will autorequire it."
ensurable
diff --git a/lib/puppet/type/mcx.rb b/lib/puppet/type/mcx.rb
index 4f0a6c3c5..07c9348dd 100644
--- a/lib/puppet/type/mcx.rb
+++ b/lib/puppet/type/mcx.rb
@@ -27,8 +27,11 @@ content property of the file type in Puppet.
The recommended method of using this type is to use Work Group Manager
to manage users and groups on the local computer, record the resulting
-puppet manifest using the command 'ralsh mcx' then deploying this
+puppet manifest using the command `puppet resource mcx`, then deploy it
to other machines.
+
+**Autorequires:** If Puppet is managing the user, group, or computer that these
+MCX settings refer to, the MCX resource will autorequire that user, group, or computer.
"
feature :manages_content, \
"The provider can manage MCXSettings as a string.",
diff --git a/lib/puppet/type/mount.rb b/lib/puppet/type/mount.rb
index 915bb8e6c..5b8c5ca58 100755
--- a/lib/puppet/type/mount.rb
+++ b/lib/puppet/type/mount.rb
@@ -21,6 +21,11 @@ module Puppet
fstab and mount it. Set to `present` to add to fstab but not change
mount/unmount status"
+ # IS -> SHOULD In Sync Action
+ # ghost -> present NO create
+ # absent -> present NO create
+ # (mounted -> present YES)
+ # (unmounted -> present YES)
newvalue(:defined) do
provider.create
return :mount_created
@@ -28,55 +33,66 @@ module Puppet
aliasvalue :present, :defined
+ # IS -> SHOULD In Sync Action
+ # ghost -> unmounted NO create, unmount
+ # absent -> unmounted NO create
+ # mounted -> unmounted NO unmount
newvalue(:unmounted) do
- if provider.mounted?
- syncothers
+ case self.retrieve
+ when :ghost # (not in fstab but mounted)
+ provider.create
+ @resource.flush
provider.unmount
return :mount_unmounted
- else
+ when nil, :absent # (not in fstab and not mounted)
provider.create
return :mount_created
+ when :mounted # (in fstab and mounted)
+ provider.unmount
+ syncothers # I guess it's more likely that the mount was originally mounted with
+ # the wrong attributes so I sync AFTER the umount
+ return :mount_unmounted
+ else
+ raise Puppet::Error, "Unexpected change from #{current_value} to unmounted}"
end
end
+ # IS -> SHOULD In Sync Action
+ # ghost -> absent NO unmount
+ # mounted -> absent NO provider.destroy AND unmount
+ # unmounted -> absent NO provider.destroy
newvalue(:absent, :event => :mount_deleted) do
+ current_value = self.retrieve
provider.unmount if provider.mounted?
-
- provider.destroy
+ provider.destroy unless current_value == :ghost
end
+ # IS -> SHOULD In Sync Action
+ # ghost -> mounted NO provider.create
+ # absent -> mounted NO provider.create AND mount
+ # unmounted -> mounted NO mount
newvalue(:mounted, :event => :mount_mounted) do
# Create the mount point if it does not already exist.
current_value = self.retrieve
- provider.create if current_value.nil? or current_value == :absent
+ currently_mounted = provider.mounted?
+ provider.create if [nil, :absent, :ghost].include?(current_value)
syncothers
# The fs can be already mounted if it was absent but mounted
- provider.mount unless provider.mounted?
+ provider.property_hash[:needs_mount] = true unless currently_mounted
end
+ # insync: mounted -> present
+ # unmounted -> present
def insync?(is)
- if should == :defined and is != :absent
+ if should == :defined and [:mounted,:unmounted].include?(is)
true
else
super
end
end
- def retrieve
- # We need to special case :mounted; if we're absent, we still
- # want
- curval = super()
- if curval == :absent
- return :absent
- elsif provider.mounted?
- return :mounted
- else
- return :unmounted
- end
- end
-
def syncothers
# We have to flush any changes to disk.
currentvalues = @resource.retrieve_resource
@@ -210,7 +226,7 @@ module Puppet
def refresh
# Only remount if we're supposed to be mounted.
- provider.remount if self.should(:fstype) != "swap" and self.should(:ensure) == :mounted
+ provider.remount if self.should(:fstype) != "swap" and provider.mounted?
end
def value(name)
diff --git a/lib/puppet/type/package.rb b/lib/puppet/type/package.rb
index d73d90dff..1222a5319 100644
--- a/lib/puppet/type/package.rb
+++ b/lib/puppet/type/package.rb
@@ -15,7 +15,11 @@ module Puppet
using based on the platform you are on, but you can override it
using the `provider` parameter; each provider defines what it
requires in order to function, and you must meet those requirements
- to use a given provider."
+ to use a given provider.
+
+ **Autorequires:** If Puppet is managing the files specified as a package's
+ `adminfile`, `responsefile`, or `source`, the package resource will autorequire
+ those files."
feature :installable, "The provider can install packages.",
:methods => [:install]
diff --git a/lib/puppet/type/schedule.rb b/lib/puppet/type/schedule.rb
index 82f17e533..5fb008f6f 100755
--- a/lib/puppet/type/schedule.rb
+++ b/lib/puppet/type/schedule.rb
@@ -18,11 +18,11 @@ module Puppet
wanted to restrict certain resources to only running once, between
the hours of two and 4 AM, then you would use this schedule:
- schedule { maint:
- range => \"2 - 4\",
- period => daily,
- repeat => 1
- }
+ schedule { maint:
+ range => \"2 - 4\",
+ period => daily,
+ repeat => 1
+ }
With this schedule, the first time that Puppet runs between 2 and 4 AM,
all resources with this schedule will get applied, but they won't
@@ -35,10 +35,10 @@ module Puppet
a schedule named *puppet* is created and used as the default,
with the following attributes:
- schedule { puppet:
- period => hourly,
- repeat => 2
- }
+ schedule { puppet:
+ period => hourly,
+ repeat => 2
+ }
This will cause resources to be applied every 30 minutes by default.
"
@@ -47,14 +47,14 @@ module Puppet
desc "The name of the schedule. This name is used to retrieve the
schedule when assigning it to an object:
- schedule { daily:
- period => daily,
- range => \"2 - 4\",
- }
-
- exec { \"/usr/bin/apt-get update\":
- schedule => daily
- }
+ schedule { daily:
+ period => daily,
+ range => \"2 - 4\",
+ }
+
+ exec { \"/usr/bin/apt-get update\":
+ schedule => daily
+ }
"
isnamevar
@@ -67,9 +67,9 @@ module Puppet
seconds can be provided, using the normal colon as a separator.
For instance:
- schedule { maintenance:
- range => \"1:30 - 4:30\"
- }
+ schedule { maintenance:
+ range => \"1:30 - 4:30\"
+ }
This is mostly useful for restricting certain resources to being
applied in maintenance windows or during off-peak hours."
diff --git a/lib/puppet/type/selmodule.rb b/lib/puppet/type/selmodule.rb
index 60be8a855..e76c18cc0 100644
--- a/lib/puppet/type/selmodule.rb
+++ b/lib/puppet/type/selmodule.rb
@@ -5,7 +5,9 @@
Puppet::Type.newtype(:selmodule) do
@doc = "Manages loading and unloading of SELinux policy modules
on the system. Requires SELinux support. See man semodule(8)
- for more information on SELinux policy modules."
+ for more information on SELinux policy modules.
+
+ **Autorequires:** If Puppet is managing the file containing this SELinux policy module (which is either explicitly specified in the `selmodulepath` attribute or will be found at {`selmoduledir`}/{`name`}.pp), the selmodule resource will autorequire that file."
ensurable
diff --git a/lib/puppet/type/ssh_authorized_key.rb b/lib/puppet/type/ssh_authorized_key.rb
index e3320140e..8338e2d64 100644
--- a/lib/puppet/type/ssh_authorized_key.rb
+++ b/lib/puppet/type/ssh_authorized_key.rb
@@ -1,7 +1,11 @@
module Puppet
newtype(:ssh_authorized_key) do
@doc = "Manages SSH authorized keys. Currently only type 2 keys are
- supported."
+ supported.
+
+ **Autorequires:** If Puppet is managing the user account in which this
+ SSH key should be installed, the `ssh_authorized_key` resource will autorequire
+ that user."
ensurable
diff --git a/lib/puppet/type/user.rb b/lib/puppet/type/user.rb
index e7389a0d1..f74e4266f 100755
--- a/lib/puppet/type/user.rb
+++ b/lib/puppet/type/user.rb
@@ -12,7 +12,9 @@ module Puppet
This resource type uses the prescribed native tools for creating
groups and generally uses POSIX APIs for retrieving information
- about them. It does not directly modify `/etc/passwd` or anything."
+ about them. It does not directly modify `/etc/passwd` or anything.
+
+ **Autorequires:** If Puppet is managing the user's primary group (as provided in the `gid` attribute), the user resource will autorequire that group. If Puppet is managing any role accounts corresponding to the user's roles, the user resource will autorequire those role accounts."
feature :allows_duplicates,
"The provider supports duplicate users with the same UID."
@@ -34,6 +36,9 @@ module Puppet
feature :manages_expiry,
"The provider can manage the expiry date for a user."
+ feature :system_users,
+ "The provider allows you to create system users with lower UIDs."
+
newproperty(:ensure, :parent => Puppet::Property::Ensure) do
newvalue(:present, :event => :user_created) do
provider.create
@@ -230,6 +235,14 @@ module Puppet
defaultto :minimum
end
+ newparam(:system, :boolean => true) do
+ desc "Whether the user is a system user with lower UID."
+
+ newvalues(:true, :false)
+
+ defaultto false
+ end
+
newparam(:allowdupe, :boolean => true) do
desc "Whether to allow duplicate UIDs."
diff --git a/lib/puppet/type/zfs.rb b/lib/puppet/type/zfs.rb
index be18ab5aa..7123f8ac9 100755
--- a/lib/puppet/type/zfs.rb
+++ b/lib/puppet/type/zfs.rb
@@ -1,6 +1,8 @@
module Puppet
newtype(:zfs) do
- @doc = "Manage zfs. Create destroy and set properties on zfs instances."
+ @doc = "Manage zfs. Create destroy and set properties on zfs instances.
+
+**Autorequires:** If Puppet is managing the zpool at the root of this zfs instance, the zfs resource will autorequire it. If Puppet is managing any parent zfs instances, the zfs resource will autorequire them."
ensurable
diff --git a/lib/puppet/type/zone.rb b/lib/puppet/type/zone.rb
index fc524a541..1bae93120 100644
--- a/lib/puppet/type/zone.rb
+++ b/lib/puppet/type/zone.rb
@@ -1,5 +1,7 @@
Puppet::Type.newtype(:zone) do
- @doc = "Solaris zones."
+ @doc = "Solaris zones.
+
+**Autorequires:** If Puppet is managing the directory specified as the root of the zone's filesystem (with the `path` attribute), the zone resource will autorequire that directory."
# These properties modify the zone configuration, and they need to provide
# the text separately from syncing it, so all config statements can be rolled
@@ -413,6 +415,23 @@ Puppet::Type.newtype(:zone) do
end
end
+ # If Puppet is also managing the zfs filesystem which is the zone dataset
+ # then list it as a prerequisite. Zpool's get autorequired by the zfs
+ # type. We just need to autorequire the dataset zfs itself as the zfs type
+ # will autorequire all of the zfs parents and zpool.
+ autorequire(:zfs) do
+
+ # Check if we have datasets in our zone configuration
+ if @parameters.include? :dataset
+ reqs = []
+ # Autorequire each dataset
+ self[:dataset].each { |value|
+ reqs << value
+ }
+ reqs
+ end
+ end
+
def validate_ip(ip, name)
IPAddr.new(ip) if ip
rescue ArgumentError
diff --git a/lib/puppet/type/zpool.rb b/lib/puppet/type/zpool.rb
index df06522e8..40ee8f286 100755
--- a/lib/puppet/type/zpool.rb
+++ b/lib/puppet/type/zpool.rb
@@ -40,9 +40,10 @@ module Puppet
end
newproperty(:mirror, :array_matching => :all, :parent => Puppet::Property::MultiVDev) do
- desc "List of all the devices to mirror for this pool. Each mirror should be a space separated string:
+ desc "List of all the devices to mirror for this pool. Each mirror should be a
+ space separated string:
- mirror => [\"disk1 disk2\", \"disk3 disk4\"]
+ mirror => [\"disk1 disk2\", \"disk3 disk4\"],
"
@@ -52,9 +53,10 @@ module Puppet
end
newproperty(:raidz, :array_matching => :all, :parent => Puppet::Property::MultiVDev) do
- desc "List of all the devices to raid for this pool. Should be an array of space separated strings:
-
- raidz => [\"disk1 disk2\", \"disk3 disk4\"]
+ desc "List of all the devices to raid for this pool. Should be an array of
+ space separated strings:
+
+ raidz => [\"disk1 disk2\", \"disk3 disk4\"],
"
diff --git a/lib/puppet/util.rb b/lib/puppet/util.rb
index 850d147e2..d06f44808 100644
--- a/lib/puppet/util.rb
+++ b/lib/puppet/util.rb
@@ -4,6 +4,7 @@ require 'puppet/util/monkey_patches'
require 'sync'
require 'puppet/external/lock'
require 'monitor'
+require 'puppet/util/execution_stub'
module Puppet
# A command failed to execute.
@@ -264,6 +265,10 @@ module Util
arguments[:uid] = Puppet::Util::SUIDManager.convert_xid(:uid, arguments[:uid]) if arguments[:uid]
arguments[:gid] = Puppet::Util::SUIDManager.convert_xid(:gid, arguments[:gid]) if arguments[:gid]
+ if execution_stub = Puppet::Util::ExecutionStub.current_value
+ return execution_stub.call(command, arguments)
+ end
+
@@os ||= Facter.value(:operatingsystem)
output = nil
child_pid, child_status = nil
diff --git a/lib/puppet/util/command_line.rb b/lib/puppet/util/command_line.rb
index 3562a3dc0..7f74d266a 100644
--- a/lib/puppet/util/command_line.rb
+++ b/lib/puppet/util/command_line.rb
@@ -33,8 +33,12 @@ module Puppet
end
def available_subcommands
- absolute_appdir = $LOAD_PATH.collect { |x| File.join(x,'puppet','application') }.detect{ |x| File.directory?(x) }
- Dir[File.join(absolute_appdir, '*.rb')].map{|fn| File.basename(fn, '.rb')}
+ absolute_appdirs = $LOAD_PATH.collect do |x|
+ File.join(x,'puppet','application')
+ end.select{ |x| File.directory?(x) }
+ absolute_appdirs.inject([]) do |commands, dir|
+ commands + Dir[File.join(dir, '*.rb')].map{|fn| File.basename(fn, '.rb')}
+ end.uniq
end
def usage_message
@@ -81,7 +85,7 @@ module Puppet
if zero == 'puppet'
case argv.first
when nil; [ stdin.tty? ? nil : "apply", argv] # ttys get usage info
- when "--help"; [nil, argv] # help should give you usage, not the help for `puppet apply`
+ when "--help", "-h"; [nil, argv] # help should give you usage, not the help for `puppet apply`
when /^-|\.pp$|\.rb$/; ["apply", argv]
else [ argv.first, argv[1..-1] ]
end
diff --git a/lib/puppet/util/command_line/filebucket b/lib/puppet/util/command_line/filebucket
deleted file mode 100755
index 34b01508e..000000000
--- a/lib/puppet/util/command_line/filebucket
+++ /dev/null
@@ -1,97 +0,0 @@
-#!/usr/bin/env ruby
-
-#
-# = Synopsis
-#
-# A stand-alone Puppet filebucket client.
-#
-# = Usage
-#
-# puppet filebucket [-h|--help] [-V|--version] [-d|--debug] [-v|--verbose]
-# [-l|--local] [-r|--remote]
-# [-s|--server <server>] [-b|--bucket <directory>] <file> <file> ...
-#
-# = Description
-#
-# This is a stand-alone filebucket client for sending files to a local
-# or central filebucket.
-#
-# = Usage
-#
-# This client can operate in three modes, with only one mode per call:
-#
-# backup::
-# Send one or more files to the specified file bucket. Each sent file
-# is printed with its resulting md5 sum.
-#
-# get::
-# Return the text associated with an md5 sum. The text is printed to
-# stdout, and only one file can be retrieved at a time.
-#
-# restore::
-# Given a file path and an md5 sum, store the content associated with the
-# sum into the specified file path. You can specify an entirely new path
-# to this argument; you are not restricted to restoring the content to its
-# original location.
-#
-# Note that +filebucket+ defaults to using a network-based filebucket available on
-# the server named +puppet+. To use this, you'll have to be running as a user
-# with valid Puppet certificates. Alternatively, you can use your local file bucket
-# by specifying +--local+.
-#
-# = Example
-#
-# $ puppet filebucket backup /etc/passwd
-# /etc/passwd: 429b225650b912a2ee067b0a4cf1e949
-# $ puppet filebucket restore /tmp/passwd 429b225650b912a2ee067b0a4cf1e949
-# $
-#
-# = Options
-#
-# Note that any configuration parameter that's valid in the configuration file
-# is also a valid long argument. For example, 'ssldir' is a valid configuration
-# parameter, so you can specify '--ssldir <directory>' as an argument.
-#
-# See the configuration file documentation at
-# http://docs.puppetlabs.com/references/stable/configuration.html for
-# the full list of acceptable parameters. A commented list of all
-# configuration options can also be generated by running puppet with
-# '--genconfig'.
-#
-# debug::
-# Enable full debugging.
-#
-# help::
-# Print this help message
-#
-# local::
-# Use the local filebucket. This will use the default configuration
-# information.
-#
-# remote::
-# Use a remote filebucket. This will use the default configuration
-# information.
-#
-# server::
-# The server to send the file to, instead of locally.
-#
-# verbose::
-# Print extra information.
-#
-# version::
-# Print version information.
-#
-# = Example
-#
-# puppet filebucket -b /tmp/filebucket /my/file
-#
-# = Author
-#
-# Luke Kanies
-#
-# = Copyright
-#
-# Copyright (c) 2005 Puppet Labs, LLC
-# Licensed under the GNU Public License
-
-#Puppet::Application[:filebucket].run
diff --git a/lib/puppet/util/command_line/pi b/lib/puppet/util/command_line/pi
deleted file mode 100755
index 3d80eea8f..000000000
--- a/lib/puppet/util/command_line/pi
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/env ruby
-
-#
-# = Synopsis
-#
-# Print help about puppet types on the console. Run with '-h' to get detailed
-# help.
-# = Usage
-#
-# puppet describe [-h|--help] [-s|--short] [-p|--providers] [-l|--list] [-m|--meta]
-#
-# = Description
-#
-# Prints details of Puppet types, providers and metaparameters on the console.
-#
-# = Options
-#
-# help::
-# Print this help text
-#
-# providers::
-# Describe providers in detail for each type
-#
-# list::
-# List all types
-#
-# meta::
-# List all metaparameters
-#
-# short::
-# List only parameters without detail
-#
-# = Example
-#
-# puppet describe --list
-# puppet describe file --providers
-# puppet describe user -s -m
-#
-# = Author
-#
-# David Lutterkort
-#
-# = Copyright
-#
-# Copyright (c) 2005 Puppet Labs, LLC
-# Licensed under the GNU Public License
-
-#Puppet::Application[:describe].run
diff --git a/lib/puppet/util/command_line/puppet b/lib/puppet/util/command_line/puppet
deleted file mode 100755
index e75b92af8..000000000
--- a/lib/puppet/util/command_line/puppet
+++ /dev/null
@@ -1,69 +0,0 @@
-
-#
-# = Synopsis
-#
-# Run a stand-alone +puppet+ manifest.
-#
-# = Usage
-#
-# puppet apply [-h|--help] [-V|--version] [-d|--debug] [-v|--verbose] [-e|--execute]
-# [--detailed-exitcodes] [-l|--logdest <file>] <file>
-#
-# = Description
-#
-# This is the standalone puppet execution tool; use it to execute
-# individual manifests that you write. If you need to execute site-wide
-# manifests, use 'puppet agent' and 'puppet master'.
-#
-# = Options
-#
-# Note that any configuration parameter that's valid in the configuration file
-# is also a valid long argument. For example, 'ssldir' is a valid configuration
-# parameter, so you can specify '--ssldir <directory>' as an argument.
-#
-# See the configuration file documentation at
-# http://docs.puppetlabs.com/references/stable/configuration.html for
-# the full list of acceptable parameters. A commented list of all
-# configuration options can also be generated by running puppet with
-# '--genconfig'.
-#
-# debug::
-# Enable full debugging.
-#
-# detailed-exitcodes::
-# Provide transaction information via exit codes. If this is enabled, an exit
-# code of '2' means there were changes, and an exit code of '4' means that there
-# were failures during the transaction.
-#
-# help::
-# Print this help message
-#
-# loadclasses::
-# Load any stored classes. 'puppet agent' caches configured classes (usually at
-# /etc/puppet/classes.txt), and setting this option causes all of those classes
-# to be set in your puppet manifest.
-#
-# logdest::
-# Where to send messages. Choose between syslog, the console, and a log file.
-# Defaults to sending messages to the console.
-#
-# execute::
-# Execute a specific piece of Puppet code
-#
-# verbose::
-# Print extra information.
-#
-# = Example
-#
-# puppet -l /tmp/manifest.log manifest.pp
-#
-# = Author
-#
-# Luke Kanies
-#
-# = Copyright
-#
-# Copyright (c) 2005 Puppet Labs, LLC
-# Licensed under the GNU Public License
-
-#Puppet::Application[:apply].run
diff --git a/lib/puppet/util/command_line/puppetca b/lib/puppet/util/command_line/puppetca
deleted file mode 100755
index 317d99881..000000000
--- a/lib/puppet/util/command_line/puppetca
+++ /dev/null
@@ -1,110 +0,0 @@
-#!/usr/bin/env ruby
-
-#
-# = Synopsis
-#
-# Stand-alone certificate authority. Capable of generating certificates
-# but mostly meant for signing certificate requests from puppet clients.
-#
-# = Usage
-#
-# puppet cert [-h|--help] [-V|--version] [-d|--debug] [-v|--verbose]
-# [-g|--generate] [-l|--list] [-s|--sign] [-r|--revoke]
-# [-p|--print] [-c|--clean] [--verify] [--digest DIGEST]
-# [--fingerprint] [host]
-#
-# = Description
-#
-# Because the puppetmasterd daemon defaults to not signing client certificate
-# requests, this script is available for signing outstanding requests. It
-# can be used to list outstanding requests and then either sign them individually
-# or sign all of them.
-#
-# = Options
-#
-# Note that any configuration parameter that's valid in the configuration file
-# is also a valid long argument. For example, 'ssldir' is a valid configuration
-# parameter, so you can specify '--ssldir <directory>' as an argument.
-#
-# See the configuration file documentation at
-# http://docs.puppetlabs.com/references/stable/configuration.html for
-# the full list of acceptable parameters. A commented list of all
-# configuration options can also be generated by running puppet cert with
-# '--genconfig'.
-#
-# all::
-# Operate on all items. Currently only makes sense with '--sign',
-# '--clean', or '--list'.
-#
-# digest::
-# Set the digest for fingerprinting (defaults to md5). Valid values depends
-# on your openssl and openssl ruby extension version, but should contain at
-# least md5, sha1, md2, sha256.
-#
-# clean::
-# Remove all files related to a host from puppet cert's storage. This is
-# useful when rebuilding hosts, since new certificate signing requests
-# will only be honored if puppet cert does not have a copy of a signed
-# certificate for that host. The certificate of the host is also revoked.
-# If '--all' is specified then all host certificates, both signed and
-# unsigned, will be removed.
-#
-# debug::
-# Enable full debugging.
-#
-# generate::
-# Generate a certificate for a named client. A certificate/keypair will be
-# generated for each client named on the command line.
-#
-# help::
-# Print this help message
-#
-# list::
-# List outstanding certificate requests. If '--all' is specified,
-# signed certificates are also listed, prefixed by '+', and revoked
-# or invalid certificates are prefixed by '-' (the verification outcome
-# is printed in parenthesis).
-#
-# print::
-# Print the full-text version of a host's certificate.
-#
-# fingerprint::
-# Print the DIGEST (defaults to md5) fingerprint of a host's certificate.
-#
-# revoke::
-# Revoke the certificate of a client. The certificate can be specified
-# either by its serial number, given as a decimal number or a hexadecimal
-# number prefixed by '0x', or by its hostname. The certificate is revoked
-# by adding it to the Certificate Revocation List given by the 'cacrl'
-# config parameter. Note that the puppetmasterd needs to be restarted
-# after revoking certificates.
-#
-# sign::
-# Sign an outstanding certificate request. Unless '--all' is specified,
-# hosts must be listed after all flags.
-#
-# verbose::
-# Enable verbosity.
-#
-# version::
-# Print the puppet version number and exit.
-#
-# verify::
-# Verify the named certificate against the local CA certificate.
-#
-# = Example
-#
-# $ puppet cert -l
-# culain.madstop.com
-# $ puppet cert -s culain.madstop.com
-#
-# = Author
-#
-# Luke Kanies
-#
-# = Copyright
-#
-# Copyright (c) 2005 Puppet Labs, LLC
-# Licensed under the GNU Public License
-
-#Puppet::Application[:cert].run
diff --git a/lib/puppet/util/command_line/puppetd b/lib/puppet/util/command_line/puppetd
deleted file mode 100755
index 71b28429b..000000000
--- a/lib/puppet/util/command_line/puppetd
+++ /dev/null
@@ -1,188 +0,0 @@
-#!/usr/bin/env ruby
-
-# == Synopsis
-#
-# Retrieve the client configuration from the puppet master and apply
-# it to the local host.
-#
-# Currently must be run out periodically, using cron or something similar.
-#
-# = Usage
-#
-# puppet agent [-D|--daemonize|--no-daemonize] [-d|--debug]
-# [--detailed-exitcodes] [--disable] [--enable]
-# [-h|--help] [--certname <host name>] [-l|--logdest syslog|<file>|console]
-# [-o|--onetime] [--serve <handler>] [-t|--test] [--noop]
-# [--digest <digest>] [--fingerprint] [-V|--version]
-# [-v|--verbose] [-w|--waitforcert <seconds>]
-#
-# = Description
-#
-# This is the main puppet client. Its job is to retrieve the local machine's
-# configuration from a remote server and apply it. In order to successfully
-# communicate with the remote server, the client must have a certificate signed
-# by a certificate authority that the server trusts; the recommended method
-# for this, at the moment, is to run a certificate authority as part of the
-# puppet server (which is the default). The client will connect and request
-# a signed certificate, and will continue connecting until it receives one.
-#
-# Once the client has a signed certificate, it will retrieve its configuration
-# and apply it.
-#
-# = Usage Notes
-#
-# +puppet agent+ does its best to find a compromise between interactive use and
-# daemon use. Run with no arguments and no configuration, it will go into the
-# backgroun, attempt to get a signed certificate, and retrieve and apply its
-# configuration every 30 minutes.
-#
-# Some flags are meant specifically for interactive use -- in particular,
-# +test+, +tags+ or +fingerprint+ are useful. +test+ enables verbose logging, causes
-# the daemon to stay in the foreground, exits if the server's configuration is
-# invalid (this happens if, for instance, you've left a syntax error on the
-# server), and exits after running the configuration once (rather than hanging
-# around as a long-running process).
-#
-# +tags+ allows you to specify what portions of a configuration you want to apply.
-# Puppet elements are tagged with all of the class or definition names that
-# contain them, and you can use the +tags+ flag to specify one of these names,
-# causing only configuration elements contained within that class or definition
-# to be applied. This is very useful when you are testing new configurations --
-# for instance, if you are just starting to manage +ntpd+, you would put all of
-# the new elements into an +ntpd+ class, and call puppet with +--tags ntpd+,
-# which would only apply that small portion of the configuration during your
-# testing, rather than applying the whole thing.
-#
-# +fingerprint+ is a one-time flag. In this mode +puppet agent+ will run once and
-# display on the console (and in the log) the current certificate (or certificate
-# request) fingerprint. Providing the +--digest+ option allows to use a different
-# digest algorithm to generate the fingerprint. The main use is to verify that
-# before signing a certificate request on the master, the certificate request the
-# master received is the same as the one the client sent (to prevent against
-# man-in-the-middle attacks when signing certificates).
-#
-#
-# = Options
-#
-# Note that any configuration parameter that's valid in the configuration file
-# is also a valid long argument. For example, 'server' is a valid configuration
-# parameter, so you can specify '--server <servername>' as an argument.
-#
-# See the configuration file documentation at
-# http://docs.puppetlabs.com/references/stable/configuration.html for
-# the full list of acceptable parameters. A commented list of all
-# configuration options can also be generated by running puppet agent with
-# '--genconfig'.
-#
-# daemonize::
-# Send the process into the background. This is the default.
-#
-# no-daemonize::
-# Do not send the process into the background.
-#
-# debug::
-# Enable full debugging.
-#
-# digest::
-# Change the certificate fingerprinting digest algorithm. The default is MD5.
-# Valid values depends on the version of OpenSSL installed, but should always
-# at least contain MD5, MD2, SHA1 and SHA256.
-#
-# detailed-exitcodes::
-# Provide transaction information via exit codes. If this is enabled, an
-# exit code of '2' means there were changes, and an exit code of '4' means
-# that there were failures during the transaction. This option only makes
-# sense in conjunction with --onetime.
-#
-# disable::
-# Disable working on the local system. This puts a lock file in place,
-# causing +puppet agent+ not to work on the system until the lock file is removed.
-# This is useful if you are testing a configuration and do not want the central
-# configuration to override the local state until everything is tested and
-# committed.
-#
-# +puppet agent+ uses the same lock file while it is running, so no more than one
-# +puppet agent+ process is working at a time.
-#
-# +puppet agent+ exits after executing this.
-#
-# enable::
-# Enable working on the local system. This removes any lock file, causing
-# +puppet agent+ to start managing the local system again (although it will continue
-# to use its normal scheduling, so it might not start for another half hour).
-#
-# +puppet agent+ exits after executing this.
-#
-# certname::
-# Set the certname (unique ID) of the client. The master reads this unique
-# identifying string, which is usually set to the node's fully-qualified domain
-# name, to determine which configurations the node will receive. Use this option
-# to debug setup problems or implement unusual node identification schemes.
-#
-# help::
-# Print this help message
-#
-# logdest::
-# Where to send messages. Choose between syslog, the console, and a log file.
-# Defaults to sending messages to syslog, or the console if debugging or
-# verbosity is enabled.
-#
-# no-client::
-# Do not create a config client. This will cause the daemon to run
-# without ever checking for its configuration automatically, and only
-# makes sense when used in conjunction with --listen.
-#
-# onetime::
-# Run the configuration once. Runs a single (normally daemonized) Puppet run.
-# Useful for interactively running puppet agent when used in conjunction with
-# the --no-daemonize option.
-#
-# fingerprint::
-# Display the current certificate or certificate signing request fingerprint
-# and then exit. Use the +--digest+ option to change the digest algorithm used.
-#
-# serve::
-# Start another type of server. By default, +puppet agent+ will start
-# a service handler that allows authenticated and authorized remote nodes to
-# trigger the configuration to be pulled down and applied. You can specify
-# any handler here that does not require configuration, e.g., filebucket, ca,
-# or resource. The handlers are in +lib/puppet/network/handler+, and the names
-# must match exactly, both in the call to +serve+ and in +namespaceauth.conf+.
-#
-# test::
-# Enable the most common options used for testing. These are +onetime+,
-# +verbose+, +ignorecache, +no-daemonize+, +no-usecacheonfailure+,
-# +detailed-exit-codes+, +no-splay+, and +show_diff+.
-#
-# noop::
-# Use +noop+ mode where the daemon runs in a no-op or dry-run mode. This is useful
-# for seeing what changes Puppet will make without actually executing the changes.
-#
-# verbose::
-# Turn on verbose reporting.
-#
-# version::
-# Print the puppet version number and exit.
-#
-# waitforcert::
-# This option only matters for daemons that do not yet have certificates
-# and it is enabled by default, with a value of 120 (seconds). This causes
-# +puppet agent+ to connect to the server every 2 minutes and ask it to sign a
-# certificate request. This is useful for the initial setup of a puppet
-# client. You can turn off waiting for certificates by specifying a time
-# of 0.
-#
-# = Example
-#
-# puppet agent --server puppet.domain.com
-#
-# = Author
-#
-# Luke Kanies
-#
-# = Copyright
-#
-# Copyright (c) 2005, 2006 Puppet Labs, LLC
-# Licensed under the GNU Public License
-
-#Puppet::Application[:agent].run
diff --git a/lib/puppet/util/command_line/puppetdoc b/lib/puppet/util/command_line/puppetdoc
deleted file mode 100755
index 45a9c6518..000000000
--- a/lib/puppet/util/command_line/puppetdoc
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/env ruby
-
-#
-# = Synopsis
-#
-# Generate a reference for all Puppet types. Largely meant for internal Puppet
-# Labs use.
-#
-# = Usage
-#
-# puppet doc [-a|--all] [-h|--help] [-o|--outputdir <rdoc outputdir>] [-m|--mode <text|pdf|rdoc>]
-# [-r|--reference <[type]|configuration|..>] [--charset CHARSET] [manifest-file]
-#
-# = Description
-#
-# If mode is not 'rdoc', then this command generates a Markdown document describing all installed
-# Puppet types or all allowable arguments to puppet executables. It is largely
-# meant for internal use and is used to generate the reference document
-# available on the Puppet Labs web site.
-#
-# In 'rdoc' mode, this command generates an html RDoc hierarchy describing the manifests that
-# 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, puppet doc generate a single
-# manifest documentation that is output on stdout.
-#
-# = Options
-#
-# all::
-# Output the docs for all of the reference types. In 'rdoc' modes, this also outputs documentation for all resources
-#
-# help::
-# Print this help message
-#
-# outputdir::
-# Specifies the directory where to output the rdoc documentation in 'rdoc' mode.
-#
-# mode::
-# Determine the output mode. Valid modes are 'text', 'pdf' and 'rdoc'. The 'pdf' mode creates PDF formatted files in the /tmp directory. The default mode is 'text'. In 'rdoc' mode you must provide 'manifests-path'
-#
-# reference::
-# Build a particular reference. Get a list of references by running +puppet doc --list+.
-#
-# charset::
-# Used only in 'rdoc' mode. It sets the charset used in the html files produced.
-#
-# = Example
-#
-# $ puppet doc -r type > /tmp/type_reference.markdown
-# or
-# $ puppet doc --outputdir /tmp/rdoc --mode rdoc /path/to/manifests
-# or
-# $ puppet doc /etc/puppet/manifests/site.pp
-# or
-# $ puppet doc -m pdf -r configuration
-#
-# = Author
-#
-# Luke Kanies
-#
-# = Copyright
-#
-# Copyright (c) 2005-2007 Puppet Labs, LLC
-# Licensed under the GNU Public License
-
-#Puppet::Application[:doc].run
diff --git a/lib/puppet/util/command_line/puppetmasterd b/lib/puppet/util/command_line/puppetmasterd
deleted file mode 100755
index 445169820..000000000
--- a/lib/puppet/util/command_line/puppetmasterd
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/usr/bin/env ruby
-
-#
-# = Synopsis
-#
-# The central puppet server. Functions as a certificate authority by default.
-#
-# = Usage
-#
-# puppet master [-D|--daemonize|--no-daemonize] [-d|--debug] [-h|--help]
-# [-l|--logdest <file>|console|syslog] [-v|--verbose] [-V|--version]
-# [--compile <nodename>] [--apply <catalog>]
-#
-# = Description
-#
-# This is the puppet central daemon.
-#
-# = Options
-#
-# Note that any configuration parameter that's valid in the configuration file
-# is also a valid long argument. For example, 'ssldir' is a valid configuration
-# parameter, so you can specify '--ssldir <directory>' as an argument.
-#
-# See the configuration file documentation at
-# http://docs.puppetlabs.com/references/stable/configuration.html for
-# the full list of acceptable parameters. A commented list of all
-# configuration options can also be generated by running puppetmasterdd with
-# '--genconfig'.
-#
-# daemonize::
-# Send the process into the background. This is the default.
-#
-# no-daemonize::
-# Do not send the process into the background.
-#
-# debug::
-# Enable full debugging.
-#
-# help::
-# Print this help message.
-#
-# logdest::
-# Where to send messages. Choose between syslog, the console, and a log file.
-# Defaults to sending messages to syslog, or the console
-# if debugging or verbosity is enabled.
-#
-# verbose::
-# Enable verbosity.
-#
-# version::
-# Print the puppet version number and exit.
-#
-# compile::
-# Capability to compile a catalogue and output it in JSON from the Puppet master. Uses
-# facts contained in the $vardir/yaml/ directory to compile the catalog.
-#
-# apply::
-# Capability to apply JSON catalog (such as one generated with --compile). You can either specify
-# a JSON file or pipe in JSON from standard input.
-#
-# = Example
-#
-# puppet master
-#
-# = Author
-#
-# Luke Kanies
-#
-# = Copyright
-#
-# Copyright (c) 2005 Puppet Labs, LLC
-# Licensed under the GNU Public License
-
-#Puppet::Application[:master].run
diff --git a/lib/puppet/util/command_line/puppetqd b/lib/puppet/util/command_line/puppetqd
deleted file mode 100755
index 81963d537..000000000
--- a/lib/puppet/util/command_line/puppetqd
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/env ruby
-
-# == Synopsis
-#
-# Retrieve serialized records from a queue and process them in order.
-#
-# = Usage
-#
-# puppet queue [-d|--debug] [-v|--verbose]
-#
-# = Description
-#
-# This is a simple application that just processes entities in a queue as they
-# are recieved.
-#
-# = Options
-#
-# Note that any configuration parameter that's valid in the configuration file
-# is also a valid long argument. For example, 'server' is a valid configuration
-# parameter, so you can specify '--server <servername>' as an argument.
-#
-# See the configuration file documentation at
-# http://docs.puppetlabs.com/references/stable/configuration.html for
-# the full list of acceptable parameters. A commented list of all
-# configuration options can also be generated by running puppetd with
-# '--genconfig'.
-#
-# debug::
-# Enable full debugging.
-#
-# help::
-# Print this help message
-#
-# verbose::
-# Turn on verbose reporting.
-#
-# version::
-# Print the puppet version number and exit.
-#
-# = Example
-#
-# puppet queue
-#
-# = Author
-#
-# Luke Kanies
-#
-# = Copyright
-#
-# Copyright (c) 2009 Puppet Labs, LLC
-# Licensed under the GNU Public License
-
-#Puppet::Application[:queue].run
diff --git a/lib/puppet/util/command_line/puppetrun b/lib/puppet/util/command_line/puppetrun
deleted file mode 100755
index 7eba3b2c4..000000000
--- a/lib/puppet/util/command_line/puppetrun
+++ /dev/null
@@ -1,126 +0,0 @@
-#!/usr/bin/env ruby
-
-#
-# = Synopsis
-#
-# Trigger a puppet agent run on a set of hosts.
-#
-# = Usage
-#
-# puppet kick [-a|--all] [-c|--class <class>] [-d|--debug] [-f|--foreground]
-# [-h|--help] [--host <host>] [--no-fqdn] [--ignoreschedules]
-# [-t|--tag <tag>] [--test] [-p|--ping] <host> [<host> [...]]
-#
-# = Description
-#
-# This script can be used to connect to a set of machines running +puppet agent+
-# and trigger them to run their configurations. The most common usage would
-# be to specify a class of hosts and a set of tags, and +puppet kick+ would
-# look up in LDAP all of the hosts matching that class, then connect to
-# each host and trigger a run of all of the objects with the specified tags.
-#
-# If you are not storing your host configurations in LDAP, you can specify
-# hosts manually.
-#
-# You will most likely have to run +puppet kick+ as root to get access to
-# the SSL certificates.
-#
-# +puppet kick+ reads +puppet master+'s configuration file, so that it can copy
-# things like LDAP settings.
-#
-# = Usage Notes
-#
-# +puppet kick+ is useless unless +puppet agent+ is listening. See its documentation
-# for more information, but the gist is that you must enable +listen+ on the
-# +puppet agent+ daemon, either using +--listen+ on the command line or adding
-# 'listen: true' in its config file. In addition, you need to set the daemons
-# up to specifically allow connections by creating the +namespaceauth+ file,
-# normally at '/etc/puppet/namespaceauth.conf'. This file specifies who has
-# access to each namespace; if you create the file you must add every namespace
-# you want any Puppet daemon to allow -- it is currently global to all Puppet
-# daemons.
-#
-# An example file looks like this::
-#
-# [fileserver]
-# allow *.madstop.com
-#
-# [puppetmaster]
-# allow *.madstop.com
-#
-# [puppetrunner]
-# allow culain.madstop.com
-#
-# This is what you would install on your Puppet master; non-master hosts could
-# leave off the 'fileserver' and 'puppetmaster' namespaces.
-#
-# = Options
-#
-# Note that any configuration parameter that's valid in the configuration file
-# is also a valid long argument. For example, 'ssldir' is a valid configuration
-# parameter, so you can specify '--ssldir <directory>' as an argument.
-#
-# See the configuration file documentation at
-# http://reductivelabs.com/projects/puppet/reference/configref.html for
-# the full list of acceptable parameters. A commented list of all
-# configuration options can also be generated by running puppet master with
-# '--genconfig'.
-#
-#
-# all::
-# Connect to all available hosts. Requires LDAP support at this point.
-#
-# class::
-# Specify a class of machines to which to connect. This only works if you
-# have LDAP configured, at the moment.
-#
-# debug::
-# Enable full debugging.
-#
-# foreground::
-# Run each configuration in the foreground; that is, when connecting to a host,
-# do not return until the host has finished its run. The default is false.
-#
-# help::
-# Print this help message
-#
-# host::
-# A specific host to which to connect. This flag can be specified more
-# than once.
-#
-# ignoreschedules::
-# Whether the client should ignore schedules when running its configuration.
-# This can be used to force the client to perform work it would not normally
-# perform so soon. The default is false.
-#
-# parallel::
-# How parallel to make the connections. Parallelization is provided by forking
-# for each client to which to connect. The default is 1, meaning serial execution.
-#
-# tag::
-# Specify a tag for selecting the objects to apply. Does not work with the
-# --test option.
-#
-#
-# test::
-# Print the hosts you would connect to but do not actually connect. This
-# option requires LDAP support at this point.
-#
-# ping::
-#
-# Do a ICMP echo against the target host. Skip hosts that don't respond to ping.
-#
-# = Example
-#
-# sudo puppet kick -p 10 -t remotefile -t webserver host1 host2
-#
-# = Author
-#
-# Luke Kanies
-#
-# = Copyright
-#
-# Copyright (c) 2005 Puppet Labs, LLC
-# Licensed under the GNU Public License
-
-#Puppet::Application[:kick].run
diff --git a/lib/puppet/util/command_line/ralsh b/lib/puppet/util/command_line/ralsh
deleted file mode 100755
index 5c1f719e2..000000000
--- a/lib/puppet/util/command_line/ralsh
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/usr/bin/env ruby
-
-#
-# = Synopsis
-#
-# Use the Puppet RAL to directly interact with the system.
-#
-# = Usage
-#
-# puppet resource [-h|--help] [-d|--debug] [-v|--verbose] [-e|--edit]
-# [-H|--host <host>] [-p|--param <param>] [-t|--types]
-# type <name>
-#
-# = Description
-#
-# This command provides simple facilities for converting current system state
-# into Puppet code, along with some ability to use Puppet to affect the current
-# state.
-#
-# By default, you must at least provide a type to list, which case puppet resource
-# will tell you everything it knows about all instances of that type. You can
-# optionally specify an instance name, and puppet resource will only describe that single
-# instance.
-#
-# You can also add +--edit+ as an argument, and puppet resource will write its output
-# to a file, open that file in an editor, and then apply the file as a Puppet
-# transaction. You can easily use this to use Puppet to make simple changes to
-# a system.
-#
-# = Options
-#
-# Note that any configuration parameter that's valid in the configuration file
-# is also a valid long argument. For example, 'ssldir' is a valid configuration
-# parameter, so you can specify '--ssldir <directory>' as an argument.
-#
-# See the configuration file documentation at
-# http://docs.puppetlabs.com/references/stable/configuration.html for
-# the full list of acceptable parameters. A commented list of all
-# configuration options can also be generated by running puppet with
-# '--genconfig'.
-#
-# debug::
-# Enable full debugging.
-#
-# edit:
-# Write the results of the query to a file, open the file in an editor,
-# and read the file back in as an executable Puppet manifest.
-#
-# host:
-# When specified, connect to the resource server on the named host
-# and retrieve the list of resouces of the type specified.
-#
-# help:
-# Print this help message.
-#
-# param:
-# Add more parameters to be outputted from queries.
-#
-# types:
-# List all available types.
-#
-# verbose:
-# Print extra information.
-#
-# = Example
-#
-# This example uses `puppet resource` to return Puppet configuration for the user `luke`:
-#
-# $ puppet resource user luke
-# user { 'luke':
-# home => '/home/luke',
-# uid => '100',
-# ensure => 'present',
-# comment => 'Luke Kanies,,,',
-# gid => '1000',
-# shell => '/bin/bash',
-# groups => ['sysadmin','audio','video','puppet']
-# }
-#
-# = Author
-#
-# Luke Kanies
-#
-# = Copyright
-#
-# Copyright (c) 2005-2007 Puppet Labs, LLC
-# Licensed under the GNU Public License
-
-#Puppet::Application[:resource].run
diff --git a/lib/puppet/util/execution.rb b/lib/puppet/util/execution.rb
index dd820f856..69f4f2c15 100644
--- a/lib/puppet/util/execution.rb
+++ b/lib/puppet/util/execution.rb
@@ -4,16 +4,15 @@ module Puppet::Util::Execution
# Run some code with a specific environment. Resets the environment back to
# what it was at the end of the code.
def withenv(hash)
- oldvals = {}
+ saved = ENV.to_hash
hash.each do |name, val|
- name = name.to_s
- oldvals[name] = ENV[name]
- ENV[name] = val
+ ENV[name.to_s] = val
end
yield
ensure
- oldvals.each do |name, val|
+ ENV.clear
+ saved.each do |name, val|
ENV[name] = val
end
end
diff --git a/lib/puppet/util/execution_stub.rb b/lib/puppet/util/execution_stub.rb
new file mode 100644
index 000000000..af74e0f72
--- /dev/null
+++ b/lib/puppet/util/execution_stub.rb
@@ -0,0 +1,26 @@
+module Puppet::Util
+ class ExecutionStub
+ class << self
+ # Set a stub block that Puppet::Util.execute() should invoke instead
+ # of actually executing commands on the target machine. Intended
+ # for spec testing.
+ #
+ # The arguments passed to the block are |command, options|, where
+ # command is an array of strings and options is an options hash.
+ def set(&block)
+ @value = block
+ end
+
+ # Uninstall any execution stub, so that calls to
+ # Puppet::Util.execute() behave normally again.
+ def reset
+ @value = nil
+ end
+
+ # Retrieve the current execution stub, or nil if there is no stub.
+ def current_value
+ @value
+ end
+ end
+ end
+end
diff --git a/lib/puppet/util/log.rb b/lib/puppet/util/log.rb
index 2f9f356bb..d34fbaf55 100644
--- a/lib/puppet/util/log.rb
+++ b/lib/puppet/util/log.rb
@@ -68,6 +68,12 @@ class Puppet::Util::Log
}
end
+ def Log.autoflush=(v)
+ @destinations.each do |type, dest|
+ dest.autoflush = v if dest.respond_to?(:autoflush=)
+ end
+ end
+
# Create a new log message. The primary role of this method is to
# avoid creating log messages below the loglevel.
def Log.create(hash)
diff --git a/lib/puppet/util/log/destinations.rb b/lib/puppet/util/log/destinations.rb
index 2e2f9a5b7..dd0d996bf 100644
--- a/lib/puppet/util/log/destinations.rb
+++ b/lib/puppet/util/log/destinations.rb
@@ -50,6 +50,8 @@ Puppet::Util::Log.newdesttype :file do
@file.flush if defined?(@file)
end
+ attr_accessor :autoflush
+
def initialize(path)
@name = path
# first make sure the directory exists
diff --git a/lib/puppet/util/monkey_patches.rb b/lib/puppet/util/monkey_patches.rb
index 1c35ae523..a93c66b07 100644
--- a/lib/puppet/util/monkey_patches.rb
+++ b/lib/puppet/util/monkey_patches.rb
@@ -21,6 +21,9 @@ class Symbol
z.emit("!ruby/sym ")
to_s.to_zaml(z)
end
+ def <=> (other)
+ self.to_s <=> other.to_s
+ end
end
[Object, Exception, Integer, Struct, Date, Time, Range, Regexp, Hash, Array, Float, String, FalseClass, TrueClass, Symbol, NilClass, Class].each { |cls|
@@ -48,7 +51,6 @@ if RUBY_VERSION == '1.8.7'
end
end
-
class Object
# ActiveSupport 2.3.x mixes in a dangerous method
# that can cause rspec to fork bomb
@@ -56,6 +58,23 @@ class Object
def daemonize
raise NotImplementedError, "Kernel.daemonize is too dangerous, please don't try to use it."
end
+
+ # The following code allows callers to make assertions that are only
+ # checked when the environment variable PUPPET_ENABLE_ASSERTIONS is
+ # set to a non-empty string. For example:
+ #
+ # assert_that { condition }
+ # assert_that(message) { condition }
+ if ENV["PUPPET_ENABLE_ASSERTIONS"].to_s != ''
+ def assert_that(message = nil)
+ unless yield
+ raise Exception.new("Assertion failure: #{message}")
+ end
+ end
+ else
+ def assert_that(message = nil)
+ end
+ end
end
# Workaround for yaml_initialize, which isn't supported before Ruby
diff --git a/lib/puppet/util/rdoc.rb b/lib/puppet/util/rdoc.rb
index bdac579d6..c00bc6f85 100644
--- a/lib/puppet/util/rdoc.rb
+++ b/lib/puppet/util/rdoc.rb
@@ -31,6 +31,7 @@ module Puppet::Util::RDoc
options << "--force-update" if Options::OptionList.options.any? { |o| o[0] == "--force-update" }
options += [ "--charset", charset] if charset
options += files
+ #TODO dedup file paths (not strict duplication sense, parents, children, etc
# launch the documentation process
r.document(options)
@@ -53,17 +54,10 @@ module Puppet::Util::RDoc
# of a manifest
def output(file, ast)
astobj = []
- ast.nodes.each do |name, k|
- astobj << k if k.file == file
+ ast.instantiate('').each do |resource_type|
+ astobj << resource_type if resource_type.file == file
end
- ast.hostclasses.each do |name,k|
- astobj << k if k.file == file
- end
-
- ast.definitions.each do |name, k|
- astobj << k if k.file == file
- end
astobj.sort! {|a,b| a.line <=> b.line }.each do |k|
output_astnode_doc(k)
end
@@ -89,4 +83,4 @@ module Puppet::Util::RDoc
end
end
-end \ No newline at end of file
+end
diff --git a/lib/puppet/util/rdoc/code_objects.rb b/lib/puppet/util/rdoc/code_objects.rb
index 3854fbc01..3c789a0c5 100644
--- a/lib/puppet/util/rdoc/code_objects.rb
+++ b/lib/puppet/util/rdoc/code_objects.rb
@@ -124,6 +124,45 @@ module RDoc
def add_child(child)
@childs << child
end
+
+ # Look up the given symbol. RDoc only looks for class1::class2.method
+ # or class1::class2#method. Since our definitions are mapped to RDoc methods
+ # but are written class1::class2::define we need to perform the lookup by
+ # ourselves.
+ def find_symbol(symbol, method=nil)
+ result = super
+ if not result and symbol =~ /::/
+ modules = symbol.split(/::/)
+ unless modules.empty?
+ module_name = modules.shift
+ result = find_module_named(module_name)
+ if result
+ last_name = ""
+ previous = nil
+ modules.each do |module_name|
+ previous = result
+ last_name = module_name
+ result = result.find_module_named(module_name)
+ break unless result
+ end
+ unless result
+ result = previous
+ method = last_name
+ end
+ end
+ end
+ if result && method
+ if !result.respond_to?(:find_local_symbol)
+ p result.name
+ p method
+ fail
+ end
+ result = result.find_local_symbol(method)
+ end
+ end
+ result
+ end
+
end
# PuppetNode holds a puppet node
diff --git a/lib/puppet/util/rdoc/generators/puppet_generator.rb b/lib/puppet/util/rdoc/generators/puppet_generator.rb
index e6bbb2e1e..249c9a8ba 100644
--- a/lib/puppet/util/rdoc/generators/puppet_generator.rb
+++ b/lib/puppet/util/rdoc/generators/puppet_generator.rb
@@ -31,6 +31,24 @@ module Generators
NODE_DIR = "nodes"
PLUGIN_DIR = "plugins"
+ # We're monkey patching RDoc markup to allow
+ # lowercase class1::class2::class3 crossref hyperlinking
+ module MarkUp
+ alias :old_markup :markup
+
+ def new_markup(str, remove_para=false)
+ first = @markup.nil?
+ res = old_markup(str, remove_para)
+ if first and not @markup.nil?
+ @markup.add_special(/\b([a-z]\w+(::\w+)*)/,:CROSSREF)
+ # we need to call it again, since we added a rule
+ res = old_markup(str, remove_para)
+ end
+ res
+ end
+ alias :markup :new_markup
+ end
+
# This is a specialized HTMLGenerator tailored to Puppet manifests
class PuppetGenerator < HTMLGenerator
diff --git a/lib/puppet/util/rdoc/parser.rb b/lib/puppet/util/rdoc/parser.rb
index ce34442ab..0f746e2ea 100644
--- a/lib/puppet/util/rdoc/parser.rb
+++ b/lib/puppet/util/rdoc/parser.rb
@@ -34,18 +34,19 @@ class Parser
# main entry point
def scan
environment = Puppet::Node::Environment.new
+ @known_resource_types = environment.known_resource_types
unless environment.known_resource_types.watching_file?(@input_file_name)
Puppet.info "rdoc: scanning #{@input_file_name}"
if @input_file_name =~ /\.pp$/
@parser = Puppet::Parser::Parser.new(environment)
@parser.file = @input_file_name
- @known_resource_types = environment.known_resource_types
@parser.parse.instantiate('').each do |type|
@known_resource_types.add type
end
- scan_top_level(@top_level)
end
end
+
+ scan_top_level(@top_level)
@top_level
end
@@ -160,8 +161,8 @@ class Parser
if stmt.is_a?(Puppet::Parser::AST::Function) and ['include','require'].include?(stmt.name)
stmt.arguments.each do |included|
- Puppet.debug "found #{stmt.name}: #{included.value}"
- container.send("add_#{stmt.name}",Include.new(included.value, stmt.doc))
+ Puppet.debug "found #{stmt.name}: #{included}"
+ container.send("add_#{stmt.name}",Include.new(included.to_s, stmt.doc))
end
end
end
@@ -342,6 +343,7 @@ class Parser
# that contains the documentation
def parse_elements(container)
Puppet.debug "rdoc: scanning manifest"
+
@known_resource_types.hostclasses.values.sort { |a,b| a.name <=> b.name }.each do |klass|
name = klass.name
if klass.file == @input_file_name
diff --git a/lib/puppet/util/settings.rb b/lib/puppet/util/settings.rb
index 626ed20eb..f243b8691 100644
--- a/lib/puppet/util/settings.rb
+++ b/lib/puppet/util/settings.rb
@@ -91,7 +91,7 @@ class Puppet::Util::Settings
varname = $2 || $1
if varname == "environment" and environment
environment
- elsif pval = self.value(varname)
+ elsif pval = self.value(varname, environment)
pval
else
raise Puppet::DevError, "Could not find value for #{value}"
diff --git a/lib/puppet/util/zaml.rb b/lib/puppet/util/zaml.rb
index 2155e989c..bbb2af2d2 100644
--- a/lib/puppet/util/zaml.rb
+++ b/lib/puppet/util/zaml.rb
@@ -60,6 +60,7 @@ class ZAML
def initialize(obj,indent)
@indent = indent
@this_label_number = nil
+ @obj = obj # prevent garbage collection so that object id isn't reused
end
def to_s
@this_label_number ? ('&id%03d%s' % [@this_label_number, @indent]) : ''