summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.queueing2
-rw-r--r--Rakefile2
-rwxr-xr-xconf/solaris/smf/svc-puppetd2
-rwxr-xr-xconf/solaris/smf/svc-puppetmasterd2
-rwxr-xr-xexamples/etc/init.d/sleeper2
-rw-r--r--examples/modules/sample-module/README.txt4
-rw-r--r--ext/puppetstoredconfigclean.rb2
-rwxr-xr-xinstall.rb45
-rw-r--r--lib/puppet/application/agent.rb4
-rw-r--r--lib/puppet/application/apply.rb4
-rw-r--r--lib/puppet/application/cert.rb38
-rw-r--r--lib/puppet/application/filebucket.rb2
-rw-r--r--lib/puppet/application/inspect.rb2
-rw-r--r--lib/puppet/application/kick.rb4
-rw-r--r--lib/puppet/application/master.rb2
-rw-r--r--lib/puppet/application/queue.rb4
-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.rb20
-rwxr-xr-xlib/puppet/external/nagios.rb2
-rwxr-xr-xlib/puppet/external/nagios/base.rb2
-rw-r--r--lib/puppet/indirector/facts/inventory_active_record.rb97
-rw-r--r--lib/puppet/indirector/facts/rest.rb2
-rw-r--r--lib/puppet/indirector/facts/yaml.rb75
-rw-r--r--lib/puppet/indirector/indirection.rb1
-rw-r--r--lib/puppet/module.rb2
-rw-r--r--lib/puppet/network/http/api/v1.rb7
-rw-r--r--lib/puppet/network/http/compression.rb5
-rw-r--r--lib/puppet/network/http/handler.rb2
-rw-r--r--lib/puppet/network/rest_authconfig.rb2
-rwxr-xr-xlib/puppet/node/facts.rb29
-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.rb4038
-rw-r--r--lib/puppet/parser/parser_support.rb6
-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/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/type.rb10
-rw-r--r--lib/puppet/type/augeas.rb8
-rw-r--r--lib/puppet/type/computer.rb6
-rwxr-xr-xlib/puppet/type/exec.rb4
-rw-r--r--lib/puppet/type/file.rb4
-rwxr-xr-xlib/puppet/type/file/content.rb28
-rwxr-xr-xlib/puppet/type/file/ensure.rb28
-rw-r--r--lib/puppet/type/file/selcontext.rb16
-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.rb58
-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.rb4
-rwxr-xr-xlib/puppet/type/zpool.rb12
-rw-r--r--lib/puppet/util.rb5
-rw-r--r--lib/puppet/util/command_line.rb2
-rw-r--r--lib/puppet/util/execution.rb9
-rw-r--r--lib/puppet/util/execution_stub.rb26
-rw-r--r--lib/puppet/util/monkey_patches.rb21
-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.rb8
-rw-r--r--lib/puppet/util/settings.rb2
-rwxr-xr-xspec/integration/parser/parser_spec.rb7
-rw-r--r--spec/integration/provider/mount_spec.rb151
-rwxr-xr-xspec/integration/type/file_spec.rb61
-rw-r--r--spec/spec_helper.rb2
-rwxr-xr-xspec/unit/application/agent_spec.rb10
-rwxr-xr-xspec/unit/application/apply_spec.rb19
-rwxr-xr-xspec/unit/application/cert_spec.rb68
-rw-r--r--spec/unit/application/filebucket_spec.rb2
-rwxr-xr-xspec/unit/application/queue_spec.rb6
-rwxr-xr-xspec/unit/configurer/downloader_spec.rb32
-rwxr-xr-xspec/unit/daemon_spec.rb6
-rw-r--r--spec/unit/indirector/facts/inventory_active_record_spec.rb163
-rwxr-xr-xspec/unit/indirector/facts/yaml_spec.rb218
-rwxr-xr-xspec/unit/indirector/queue_spec.rb3
-rwxr-xr-xspec/unit/module_spec.rb4
-rw-r--r--spec/unit/network/handler/fileserver_spec.rb2
-rw-r--r--spec/unit/network/http/api/v1_spec.rb28
-rwxr-xr-x[-rw-r--r--]spec/unit/network/http/compression_spec.rb2
-rwxr-xr-xspec/unit/network/http/handler_spec.rb11
-rwxr-xr-xspec/unit/node/facts_spec.rb24
-rwxr-xr-xspec/unit/parser/ast/collection_spec.rb28
-rwxr-xr-xspec/unit/parser/lexer_spec.rb16
-rwxr-xr-xspec/unit/parser/parser_spec.rb37
-rwxr-xr-xspec/unit/provider/mount/parsed_spec.rb313
-rwxr-xr-xspec/unit/provider/mount_spec.rb107
-rwxr-xr-xspec/unit/provider/ssh_authorized_key/parsed_spec.rb1
-rw-r--r--spec/unit/provider/user/user_role_add_spec.rb1
-rwxr-xr-xspec/unit/provider/user/useradd_spec.rb46
-rw-r--r--spec/unit/reports/store_spec.rb2
-rwxr-xr-xspec/unit/resource_spec.rb52
-rwxr-xr-xspec/unit/type/file/content_spec.rb175
-rw-r--r--spec/unit/type/file/selinux_spec.rb5
-rwxr-xr-xspec/unit/type/mount_spec.rb289
-rwxr-xr-xspec/unit/type/user_spec.rb4
-rwxr-xr-xspec/unit/type_spec.rb13
-rw-r--r--spec/unit/util/execution_spec.rb49
-rw-r--r--spec/unit/util/execution_stub_spec.rb35
-rwxr-xr-xspec/unit/util/rdoc/parser_spec.rb18
-rwxr-xr-xspec/unit/util/settings_spec.rb13
-rw-r--r--tasks/rake/git_workflow.rake2
-rw-r--r--test/Rakefile2
-rw-r--r--test/data/providers/mount/parsed/aix.mount7
-rw-r--r--test/data/providers/mount/parsed/darwin.mount6
-rw-r--r--test/data/providers/mount/parsed/hpux.mount17
-rw-r--r--test/data/providers/mount/parsed/linux.mount5
-rw-r--r--test/data/providers/mount/parsed/solaris.mount6
-rw-r--r--test/data/types/mount/linux.fstab1
-rw-r--r--test/data/types/mount/solaris.fstab1
137 files changed, 4454 insertions, 2825 deletions
diff --git a/README.queueing b/README.queueing
index 8c4a18029..83a8e19c0 100644
--- a/README.queueing
+++ b/README.queueing
@@ -8,7 +8,7 @@ Queue Daemon).
Currently this is only supported for "Storeconfigs" which is
documented at:
-http://reductivelabs.com/trac/puppet/wiki/UsingStoredConfiguration
+http://projects.puppetlabs.com/projects/1/wiki/Using_Stored_Configuration
In the future this feature can be extended to any new puppet
data which involves storage in a database.
diff --git a/Rakefile b/Rakefile
index 38cfec6ce..6cc53fe18 100644
--- a/Rakefile
+++ b/Rakefile
@@ -44,7 +44,7 @@ task :puppetpackages => [:create_gem, :package]
RSpec::Core::RakeTask.new do |t|
t.pattern ='spec/{unit,integration}/**/*.rb'
- t.fail_on_error = false
+ t.fail_on_error = true
end
desc "Run the unit tests"
diff --git a/conf/solaris/smf/svc-puppetd b/conf/solaris/smf/svc-puppetd
index b6cf05736..8acc19cfa 100755
--- a/conf/solaris/smf/svc-puppetd
+++ b/conf/solaris/smf/svc-puppetd
@@ -62,5 +62,3 @@ status)
fi
esac
exit 0
-
-# $Id$
diff --git a/conf/solaris/smf/svc-puppetmasterd b/conf/solaris/smf/svc-puppetmasterd
index 80e3d464a..683324dec 100755
--- a/conf/solaris/smf/svc-puppetmasterd
+++ b/conf/solaris/smf/svc-puppetmasterd
@@ -58,5 +58,3 @@ status)
fi
esac
exit 0
-
-# $Id$
diff --git a/examples/etc/init.d/sleeper b/examples/etc/init.d/sleeper
index 63f7e9c2e..c60a5555c 100755
--- a/examples/etc/init.d/sleeper
+++ b/examples/etc/init.d/sleeper
@@ -1,7 +1,5 @@
#!/bin/bash
-# $Id$
-
script=$0
path=`echo $script | sed 's/etc..*/bin/'`
diff --git a/examples/modules/sample-module/README.txt b/examples/modules/sample-module/README.txt
index cd35c83a1..233e54b8d 100644
--- a/examples/modules/sample-module/README.txt
+++ b/examples/modules/sample-module/README.txt
@@ -12,6 +12,6 @@ templates/sample.erb
Note the consistent naming of files for Puppet::Util::Autoload
Reference Documents:
-http://reductivelabs.com/trac/puppet/wiki/ModuleOrganisation
+http://docs.puppetlabs.com/guides/modules.html
http://docs.puppetlabs.com/guides/custom_functions.html
-http://reductivelabs.com/trac/puppet/wiki/FunctionReference
+http://docs.puppetlabs.com/references/latest/function.html
diff --git a/ext/puppetstoredconfigclean.rb b/ext/puppetstoredconfigclean.rb
index 16f39efa1..dcbefa816 100644
--- a/ext/puppetstoredconfigclean.rb
+++ b/ext/puppetstoredconfigclean.rb
@@ -3,7 +3,7 @@
# Script to clean up stored configs for (a) given host(s)
#
# Credits:
-# Script was taken from http://reductivelabs.com/trac/puppet/attachment/wiki/UsingStoredConfiguration/kill_node_in_storedconfigs_db.rb
+# Script was taken from http://reductivelabs.com/trac/puppet/attachment/wiki/UsingStoredConfiguration/kill_node_in_storedconfigs_db.rb (link no longer valid),
# which haven been initially posted by James Turnbull
# duritong adapted and improved the script a bit.
diff --git a/install.rb b/install.rb
index 7627a8d11..e8755e07a 100755
--- a/install.rb
+++ b/install.rb
@@ -300,34 +300,29 @@ def prepare_installation
mandir = Config::CONFIG['mandir']
end
- # To be deprecated once people move over to using --destdir option
- if (destdir = ENV['DESTDIR'])
- configdir = "#{destdir}#{configdir}"
- bindir = "#{destdir}#{bindir}"
- sbindir = "#{destdir}#{sbindir}"
- mandir = "#{destdir}#{mandir}"
- sitelibdir = "#{destdir}#{sitelibdir}"
-
- FileUtils.makedirs(configdir) if InstallOptions.configs
- FileUtils.makedirs(bindir)
- FileUtils.makedirs(sbindir)
- FileUtils.makedirs(mandir)
- FileUtils.makedirs(sitelibdir)
# This is the new way forward
- elsif (destdir = InstallOptions.destdir)
- configdir = "#{destdir}#{configdir}"
- bindir = "#{destdir}#{bindir}"
- sbindir = "#{destdir}#{sbindir}"
- mandir = "#{destdir}#{mandir}"
- sitelibdir = "#{destdir}#{sitelibdir}"
-
- FileUtils.makedirs(configdir) if InstallOptions.configs
- FileUtils.makedirs(bindir)
- FileUtils.makedirs(sbindir)
- FileUtils.makedirs(mandir)
- FileUtils.makedirs(sitelibdir)
+ if not InstallOptions.destdir.nil?
+ destdir = InstallOptions.destdir
+ # To be deprecated once people move over to using --destdir option
+ elsif ENV['DESTDIR'] != nil?
+ destdir = ENV['DESTDIR']
+ warn "DESTDIR is deprecated. Use --destdir instead."
+ else
+ destdir = ''
end
+ configdir = "#{destdir}#{configdir}"
+ bindir = "#{destdir}#{bindir}"
+ sbindir = "#{destdir}#{sbindir}"
+ mandir = "#{destdir}#{mandir}"
+ sitelibdir = "#{destdir}#{sitelibdir}"
+
+ FileUtils.makedirs(configdir) if InstallOptions.configs
+ FileUtils.makedirs(bindir)
+ FileUtils.makedirs(sbindir)
+ FileUtils.makedirs(mandir)
+ FileUtils.makedirs(sitelibdir)
+
tmpdirs << bindir
InstallOptions.tmp_dirs = tmpdirs.compact
diff --git a/lib/puppet/application/agent.rb b/lib/puppet/application/agent.rb
index 2b75505fd..3749241f8 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
@@ -119,7 +119,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 33a70ce8a..cc733e1f5 100644
--- a/lib/puppet/application/apply.rb
+++ b/lib/puppet/application/apply.rb
@@ -125,7 +125,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 +143,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..ee59b7e56 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
@@ -54,8 +56,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 +66,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 +85,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/filebucket.rb b/lib/puppet/application/filebucket.rb
index 9c3c79bc3..5c91c4f64 100644
--- a/lib/puppet/application/filebucket.rb
+++ b/lib/puppet/application/filebucket.rb
@@ -52,7 +52,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 764c8c4c0..ce32c661c 100644
--- a/lib/puppet/application/inspect.rb
+++ b/lib/puppet/application/inspect.rb
@@ -82,7 +82,7 @@ Licensed under the GNU General Public License version 2
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
diff --git a/lib/puppet/application/kick.rb b/lib/puppet/application/kick.rb
index 37aeb1ef2..b3c95e21d 100644
--- a/lib/puppet/application/kick.rb
+++ b/lib/puppet/application/kick.rb
@@ -151,7 +151,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 +195,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 fde474907..6d1cdef1b 100644
--- a/lib/puppet/application/master.rb
+++ b/lib/puppet/application/master.rb
@@ -26,7 +26,7 @@ class Puppet::Application::Master < Puppet::Application
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 239f6b2ad..ede47d0a6 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
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 687ac4eb0..8da104086 100644
--- a/lib/puppet/defaults.rb
+++ b/lib/puppet/defaults.rb
@@ -119,7 +119,17 @@ module Puppet
:node_terminus => ["plain", "Where to find information about nodes."],
:catalog_terminus => ["compiler", "Where to get node catalogs. This is useful to change if, for instance,
you'd like to pre-compile catalogs and store them in memcached or some other easily-accessed store."],
- :facts_terminus => [Puppet.application_name.to_s == "master" ? 'yaml' : 'facter', "The node facts terminus."],
+ :facts_terminus => {
+ :default => Puppet.application_name.to_s == "master" ? 'yaml' : 'facter',
+ :desc => "The node facts terminus.",
+ :hook => proc do |value|
+ require 'puppet/node/facts'
+ if value.to_s == "rest"
+ Puppet::Node::Facts.cache_class = :yaml
+ end
+ end
+ },
+ :inventory_terminus => [ "$facts_terminus", "Should usually be the same as the facts terminus" ],
:httplog => { :default => "$logdir/http.log",
:owner => "root",
:mode => 0640,
@@ -582,11 +592,17 @@ module Puppet
end
},
:report_server => ["$server",
- "The server to which to send transaction reports."
+ "The server to send transaction reports to."
],
:report_port => ["$masterport",
"The port to communicate with the report_server."
],
+ :inventory_server => ["$server",
+ "The server to send facts to."
+ ],
+ :inventory_port => ["$masterport",
+ "The port to communicate with the inventory_server."
+ ],
:report => [false,
"Whether to send reports after every transaction."
],
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/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/rest.rb b/lib/puppet/indirector/facts/rest.rb
index 07491fc77..e2afa14b2 100644
--- a/lib/puppet/indirector/facts/rest.rb
+++ b/lib/puppet/indirector/facts/rest.rb
@@ -3,4 +3,6 @@ require 'puppet/indirector/rest'
class Puppet::Node::Facts::Rest < Puppet::Indirector::REST
desc "Find and save facts about nodes over HTTP via REST."
+ use_server_setting(:inventory_server)
+ use_port_setting(:inventory_port)
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/indirection.rb b/lib/puppet/indirector/indirection.rb
index ec147ec69..3d17e6e47 100644
--- a/lib/puppet/indirector/indirection.rb
+++ b/lib/puppet/indirector/indirection.rb
@@ -248,6 +248,7 @@ class Puppet::Indirector::Indirection
if result = terminus.search(request)
raise Puppet::DevError, "Search results from terminus #{terminus.name} are not an array" unless result.is_a?(Array)
result.each do |instance|
+ next unless instance.respond_to? :expiration
instance.expiration ||= self.expiration
end
return result
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 8aa1f0ee1..9e51aae36 100644
--- a/lib/puppet/network/http/api/v1.rb
+++ b/lib/puppet/network/http/api/v1.rb
@@ -60,13 +60,12 @@ module Puppet::Network::HTTP::API::V1
# fix to not need this, and our goal is to move away from the complication
# that leads to the fix being too long.
return :singular if indirection == "facts"
-
- # "status" really is singular
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/handler.rb b/lib/puppet/network/http/handler.rb
index 9e9356b2f..e192613ad 100644
--- a/lib/puppet/network/http/handler.rb
+++ b/lib/puppet/network/http/handler.rb
@@ -131,7 +131,7 @@ module Puppet::Network::HTTP::Handler
def do_search(indirection_request, request, response)
result = indirection_request.model.search(indirection_request.key, indirection_request.to_hash)
- if result.nil? or (result.is_a?(Array) and result.empty?)
+ if result.nil?
return do_exception(response, "Could not find instances in #{indirection_request.indirection_name} with '#{indirection_request.key}'", 404)
end
diff --git a/lib/puppet/network/rest_authconfig.rb b/lib/puppet/network/rest_authconfig.rb
index 7a6147a82..e6067612a 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/node/facts.rb b/lib/puppet/node/facts.rb
index b77ad22d5..0a96e553b 100755
--- a/lib/puppet/node/facts.rb
+++ b/lib/puppet/node/facts.rb
@@ -1,12 +1,17 @@
+require 'time'
+
require 'puppet/node'
require 'puppet/indirector'
+require 'puppet/util/pson'
+
# Manage a given node's facts. This either accepts facts and stores them, or
# returns facts for a given node.
class Puppet::Node::Facts
# Set up indirection, so that nodes can be looked for in
# the node sources.
extend Puppet::Indirector
+ extend Puppet::Util::Pson
# We want to expire any cached nodes if the facts are saved.
module NodeExpirer
@@ -54,6 +59,30 @@ class Puppet::Node::Facts
strip_internal == other.send(:strip_internal)
end
+ def timestamp=(time)
+ self.values[:_timestamp] = time
+ end
+
+ def timestamp
+ self.values[:_timestamp]
+ end
+
+ def self.from_pson(data)
+ result = new(data['name'], data['values'])
+ result.timestamp = Time.parse(data['timestamp'])
+ result.expiration = Time.parse(data['expiration'])
+ result
+ end
+
+ def to_pson(*args)
+ {
+ 'expiration' => expiration,
+ 'name' => name,
+ 'timestamp' => timestamp,
+ 'values' => strip_internal,
+ }.to_pson(*args)
+ end
+
private
# Add internal data to the facts for storage.
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 7a316d4d7..af0ab182b 100644
--- a/lib/puppet/parser/grammar.ra
+++ b/lib/puppet/parser/grammar.ra
@@ -642,6 +642,7 @@ selectlhand: name
| funcrvalue
| boolean
| undef
+ | hasharrayaccess
| DEFAULT {
result = ast AST::Default, :value => val[0][:value], :line => val[0][:line]
}
@@ -844,7 +845,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]
}
@@ -870,6 +871,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 5be9e5a3f..c2fbf976d 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'
@@ -13,19 +12,16 @@ require 'puppet/parser/lexer'
require 'puppet/parser/ast'
module Puppet
- class ParseError < Puppet::Error; end
- class ImportError < Racc::ParseError; end
- class AlreadyImportedError < ImportError; end
+ class ParseError < Puppet::Error; end
+ class ImportError < Racc::ParseError; end
+ class AlreadyImportedError < ImportError; end
end
-
module Puppet
-
module Parser
-
class Parser < Racc::Parser
-module_eval <<'..end grammar.ra modeval..id7145220b1b', 'grammar.ra', 876
+module_eval(<<'...end grammar.ra/module_eval...', 'grammar.ra', 866)
# It got too annoying having code in a file that needs to be compiled.
require 'puppet/parser/parser_support'
@@ -36,878 +32,627 @@ require 'puppet/parser/parser_support'
# End:
# $Id$
-
-..end grammar.ra modeval..id7145220b1b
-
-##### racc 1.4.5 generates ###
-
-racc_reduce_table = [
- 0, 0, :racc_error,
- 1, 70, :_reduce_1,
- 1, 70, :_reduce_none,
- 1, 71, :_reduce_none,
- 2, 71, :_reduce_4,
- 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, 87, :_reduce_19,
- 3, 87, :_reduce_20,
- 1, 88, :_reduce_none,
- 1, 88, :_reduce_none,
- 1, 88, :_reduce_none,
- 1, 89, :_reduce_none,
- 1, 89, :_reduce_none,
- 1, 89, :_reduce_none,
- 1, 89, :_reduce_none,
- 4, 81, :_reduce_28,
- 5, 81, :_reduce_29,
- 3, 81, :_reduce_30,
- 2, 81, :_reduce_31,
- 1, 91, :_reduce_none,
- 1, 91, :_reduce_none,
- 3, 91, :_reduce_34,
- 3, 91, :_reduce_35,
- 1, 92, :_reduce_none,
- 1, 92, :_reduce_none,
- 1, 92, :_reduce_none,
- 1, 92, :_reduce_none,
- 1, 92, :_reduce_none,
- 1, 92, :_reduce_none,
- 1, 92, :_reduce_none,
- 1, 92, :_reduce_none,
- 1, 92, :_reduce_44,
- 5, 74, :_reduce_45,
- 5, 74, :_reduce_46,
- 5, 74, :_reduce_47,
- 5, 85, :_reduce_48,
- 2, 75, :_reduce_49,
- 1, 108, :_reduce_50,
- 2, 108, :_reduce_51,
- 6, 76, :_reduce_52,
- 2, 76, :_reduce_53,
- 3, 109, :_reduce_54,
- 3, 109, :_reduce_55,
- 1, 110, :_reduce_none,
- 1, 110, :_reduce_none,
- 3, 110, :_reduce_58,
- 1, 111, :_reduce_none,
- 3, 111, :_reduce_60,
- 1, 112, :_reduce_61,
- 1, 112, :_reduce_62,
- 3, 113, :_reduce_63,
- 3, 113, :_reduce_64,
- 1, 114, :_reduce_none,
- 1, 114, :_reduce_none,
- 4, 116, :_reduce_67,
- 1, 102, :_reduce_none,
- 3, 102, :_reduce_69,
- 0, 103, :_reduce_none,
- 1, 103, :_reduce_none,
- 1, 118, :_reduce_72,
- 1, 93, :_reduce_73,
- 1, 95, :_reduce_74,
- 1, 117, :_reduce_none,
- 1, 117, :_reduce_none,
- 1, 117, :_reduce_none,
- 1, 117, :_reduce_none,
- 1, 117, :_reduce_none,
- 1, 117, :_reduce_none,
- 1, 117, :_reduce_none,
- 3, 77, :_reduce_82,
- 3, 77, :_reduce_83,
- 3, 86, :_reduce_84,
- 0, 104, :_reduce_85,
- 1, 104, :_reduce_86,
- 3, 104, :_reduce_87,
- 3, 122, :_reduce_88,
- 3, 124, :_reduce_89,
- 1, 125, :_reduce_none,
- 1, 125, :_reduce_none,
- 0, 107, :_reduce_92,
- 1, 107, :_reduce_93,
- 3, 107, :_reduce_94,
- 1, 126, :_reduce_none,
- 3, 126, :_reduce_96,
- 1, 115, :_reduce_none,
- 1, 115, :_reduce_none,
- 1, 115, :_reduce_none,
- 1, 115, :_reduce_none,
- 1, 115, :_reduce_none,
- 1, 115, :_reduce_none,
- 1, 123, :_reduce_none,
- 1, 123, :_reduce_none,
- 1, 123, :_reduce_none,
- 1, 123, :_reduce_none,
- 1, 123, :_reduce_none,
- 1, 123, :_reduce_none,
- 1, 123, :_reduce_none,
- 1, 123, :_reduce_none,
- 1, 123, :_reduce_none,
- 1, 123, :_reduce_none,
- 1, 123, :_reduce_none,
- 1, 123, :_reduce_none,
- 4, 97, :_reduce_115,
- 3, 97, :_reduce_116,
- 1, 99, :_reduce_117,
- 2, 99, :_reduce_118,
- 2, 129, :_reduce_119,
- 1, 130, :_reduce_120,
- 2, 130, :_reduce_121,
- 1, 96, :_reduce_122,
- 4, 90, :_reduce_123,
- 4, 90, :_reduce_124,
- 2, 79, :_reduce_125,
- 5, 131, :_reduce_126,
- 4, 131, :_reduce_127,
- 0, 132, :_reduce_none,
- 2, 132, :_reduce_129,
- 4, 132, :_reduce_130,
- 3, 132, :_reduce_131,
- 1, 120, :_reduce_none,
- 3, 120, :_reduce_133,
- 3, 120, :_reduce_134,
- 3, 120, :_reduce_135,
- 3, 120, :_reduce_136,
- 3, 120, :_reduce_137,
- 3, 120, :_reduce_138,
- 3, 120, :_reduce_139,
- 3, 120, :_reduce_140,
- 3, 120, :_reduce_141,
- 2, 120, :_reduce_142,
- 3, 120, :_reduce_143,
- 3, 120, :_reduce_144,
- 3, 120, :_reduce_145,
- 3, 120, :_reduce_146,
- 3, 120, :_reduce_147,
- 3, 120, :_reduce_148,
- 2, 120, :_reduce_149,
- 3, 120, :_reduce_150,
- 3, 120, :_reduce_151,
- 3, 120, :_reduce_152,
- 5, 78, :_reduce_153,
- 1, 134, :_reduce_none,
- 2, 134, :_reduce_155,
- 5, 135, :_reduce_156,
- 4, 135, :_reduce_157,
- 1, 136, :_reduce_none,
- 3, 136, :_reduce_159,
- 3, 98, :_reduce_160,
- 1, 138, :_reduce_none,
- 4, 138, :_reduce_162,
- 1, 140, :_reduce_none,
- 3, 140, :_reduce_164,
- 3, 139, :_reduce_165,
- 1, 137, :_reduce_none,
- 1, 137, :_reduce_none,
- 1, 137, :_reduce_none,
- 1, 137, :_reduce_none,
- 1, 137, :_reduce_none,
- 1, 137, :_reduce_none,
- 1, 137, :_reduce_none,
- 1, 137, :_reduce_173,
- 1, 137, :_reduce_none,
- 1, 141, :_reduce_175,
- 1, 142, :_reduce_none,
- 3, 142, :_reduce_177,
- 2, 80, :_reduce_178,
- 6, 82, :_reduce_179,
- 5, 82, :_reduce_180,
- 7, 83, :_reduce_181,
- 6, 83, :_reduce_182,
- 6, 84, :_reduce_183,
- 5, 84, :_reduce_184,
- 1, 106, :_reduce_185,
- 1, 101, :_reduce_186,
- 1, 101, :_reduce_187,
- 1, 101, :_reduce_188,
- 1, 145, :_reduce_none,
- 3, 145, :_reduce_190,
- 1, 147, :_reduce_191,
- 1, 148, :_reduce_192,
- 1, 148, :_reduce_193,
- 1, 148, :_reduce_194,
- 1, 148, :_reduce_none,
- 0, 72, :_reduce_196,
- 0, 149, :_reduce_197,
- 1, 143, :_reduce_none,
- 3, 143, :_reduce_199,
- 3, 143, :_reduce_200,
- 1, 150, :_reduce_none,
- 3, 150, :_reduce_202,
- 3, 151, :_reduce_203,
- 1, 151, :_reduce_204,
- 3, 151, :_reduce_205,
- 1, 151, :_reduce_206,
- 1, 146, :_reduce_none,
- 2, 146, :_reduce_208,
- 1, 144, :_reduce_none,
- 2, 144, :_reduce_210,
- 1, 152, :_reduce_none,
- 1, 152, :_reduce_none,
- 1, 94, :_reduce_213,
- 3, 119, :_reduce_214,
- 4, 119, :_reduce_215,
- 2, 119, :_reduce_216,
- 1, 127, :_reduce_none,
- 1, 127, :_reduce_none,
- 0, 105, :_reduce_none,
- 1, 105, :_reduce_220,
- 1, 133, :_reduce_221,
- 3, 128, :_reduce_222,
- 4, 128, :_reduce_223,
- 2, 128, :_reduce_224,
- 1, 153, :_reduce_none,
- 3, 153, :_reduce_226,
- 3, 154, :_reduce_227,
- 1, 155, :_reduce_228,
- 1, 155, :_reduce_229,
- 4, 121, :_reduce_230,
- 1, 100, :_reduce_none,
- 4, 100, :_reduce_232 ]
-
-racc_reduce_n = 233
-
-racc_shift_n = 384
+...end grammar.ra/module_eval...
+##### State transition tables begin ###
racc_action_table = [
- 256, 257, 228, 82, 54, 72, 75, 181, 251, 48,
- 72, 75, 194, 205, 210, 163, 156, 348, 46, 47,
- 344, 184, 201, 203, 206, 209, 162, 352, 54, 182,
- 351, 169, 54, -168, 72, 75, 241, 242, 102, 305,
- 106, 158, 58, 193, 230, 60, 204, 208, 193, 306,
+ 256, 257, 228, 63, 327, 64, 156, 54, 82, 356,
+ -166, 245, 176, 205, 210, 254, 37, 357, 65, 244,
+ 38, -168, 201, 203, 206, 209, 184, 11, 255, 241,
+ 242, 158, 54, 251, 72, 75, 72, 75, 102, 117,
+ 106, -170, 62, 194, 230, 58, 204, 208, 60, 306,
213, 196, 197, 198, 200, 202, 97, 207, 211, 72,
- 75, 72, 75, 163, 199, 59, 58, 71, 245, 60,
- 58, 83, 86, 60, 162, 92, 244, 72, 75, 169,
- 78, 100, 352, 269, 89, 351, 63, 94, 64, 59,
- 228, 326, 71, 59, 162, 59, 83, 86, 83, 268,
- 92, 65, 92, 184, 76, 78, 307, 137, 163, 89,
- 162, 89, 72, 75, 83, 268, 241, 242, 92, 162,
- 59, 163, 59, 137, 169, 62, 254, 89, 207, 211,
- 72, 75, 162, 308, 102, 199, 106, 169, 59, 255,
- 213, 196, 197, 198, -166, 162, 309, 207, 211, 83,
- 268, 310, 97, 92, 199, 72, 75, 355, 137, 102,
- -170, 106, 89, 71, 218, 356, 173, 83, 86, 220,
- 313, 92, -171, 59, 72, 75, 78, 100, 37, 218,
- 89, 249, 38, 94, 220, 246, 247, 173, 71, 11,
- 210, 59, 83, 86, 246, 367, 92, 271, 201, 37,
- -167, 78, 37, 38, 270, 89, 38, 71, 246, 247,
- 11, 83, 86, 11, 14, 92, 59, 72, 75, 76,
- 78, 102, 278, 106, 89, 277, 213, 196, 197, 198,
- 200, 202, 275, 207, 211, 59, 246, 274, 152, 97,
- 199, 37, 318, 72, 75, 127, 319, 102, -169, 106,
- 71, 63, 11, 14, 83, 86, -167, 37, 92, 207,
- 211, 127, -169, 78, 100, 97, 199, 89, 11, 14,
- 94, -166, 117, 72, 75, -185, 71, 82, 59, 336,
- 83, 86, 197, 198, 92, 231, 338, 207, 211, 78,
- 100, 181, 48, 89, 199, 74, 94, 240, -168, 72,
- 75, 241, 242, 102, 59, 106, 71, 184, 176, 37,
- 83, 86, 59, 38, 92, 345, 322, 175, 76, 78,
- 11, 97, -172, 89, -171, 72, 75, -170, 59, 102,
- 214, 106, 71, 64, 59, 215, 83, 86, 173, 217,
- 92, -23, -23, -23, -23, 78, 100, 97, 155, 89,
- 72, 75, 94, 122, 102, 152, 106, 82, 71, 223,
- 59, 122, 83, 86, 72, 75, 92, -168, 102, 225,
- 106, 78, 100, -166, 276, 89, 226, 117, 94, 44,
- 45, 41, 42, 71, -169, -167, 59, 83, 86, 72,
- 75, 92, 226, 102, 229, 106, 78, 71, 52, -168,
- 89, 83, 86, 72, 75, 92, -166, 102, -169, 106,
- 78, 59, 197, 198, 89, -167, -171, 207, 211, 365,
- 231, 152, 71, 234, 199, 59, 83, 86, 50, 210,
- 92, -21, -21, -21, -21, 78, 71, 201, 372, 89,
- 83, 86, 49, 374, 92, 72, 75, 228, -220, 78,
- 59, 226, 354, 89, 377, 72, 75, 40, 39, 102,
- 237, 106, 341, nil, 59, 213, 196, 197, 198, 200,
- 202, nil, 207, 211, nil, nil, nil, 97, 162, 199,
- nil, nil, 83, 268, nil, nil, 92, nil, 71, nil,
- nil, 137, 83, 86, nil, 89, 92, 44, 45, 41,
- 42, 78, 100, 72, 75, 89, 59, 102, 94, 106,
- 213, 196, 197, 198, 200, 202, 59, 207, 211, nil,
- 213, 196, 197, 198, 199, 97, nil, 207, 211, 72,
- 75, nil, nil, 102, 199, 106, 71, nil, nil, nil,
- 83, 86, nil, nil, 92, nil, nil, nil, nil, 78,
- 100, 97, nil, 89, nil, nil, 94, nil, nil, 72,
- 75, nil, 71, 102, 59, 106, 83, 86, nil, nil,
- 92, nil, nil, nil, nil, 78, 100, nil, nil, 89,
- nil, 97, 94, nil, nil, 72, 75, nil, nil, 102,
- 59, 106, 71, nil, nil, nil, 83, 86, nil, nil,
- 92, nil, nil, nil, nil, 78, 100, 97, nil, 89,
- 72, 75, 94, nil, 102, nil, 106, nil, 71, nil,
- 59, nil, 83, 86, 72, 75, 92, nil, 102, nil,
- nil, 78, 100, nil, nil, 89, nil, nil, 94, nil,
- nil, nil, nil, 71, nil, nil, 59, 83, 86, 72,
- 75, 92, nil, 102, nil, 106, 78, 71, nil, nil,
- 89, 83, 143, nil, nil, 92, nil, nil, nil, nil,
- 137, 59, nil, nil, 89, 72, 75, nil, nil, 102,
- nil, 106, 71, nil, nil, 59, 83, 86, nil, nil,
- 92, nil, nil, nil, nil, 78, nil, 97, nil, 89,
- nil, 72, 75, nil, nil, 102, nil, 106, 71, nil,
- 59, nil, 83, 86, nil, nil, 92, nil, nil, nil,
+ 75, 241, 242, 102, 199, 106, 163, 71, 59, 307,
+ 58, 83, 86, 60, 193, 92, 54, 162, 72, 75,
+ 78, 100, 169, 163, 89, 72, 75, 94, 308, 102,
+ 163, 106, 71, 59, 162, 59, 83, 86, 59, 169,
+ 92, 162, 311, 72, 75, 78, 169, 97, 181, 89,
+ 353, 71, 228, 352, 58, 83, 269, 60, 71, 92,
+ 59, 345, 83, 86, 137, 184, 92, -171, 89, 72,
+ 75, 78, 100, 246, 368, 89, 71, 59, 94, 59,
+ 83, 86, 309, 173, 92, 314, 59, 163, 76, 78,
+ 72, 75, -167, 89, 102, 310, 106, 37, 162, 173,
+ 218, 127, 71, 169, 59, 220, 83, 269, 11, 14,
+ 92, 63, 97, 152, 37, 137, 72, 75, 127, 89,
+ 102, 319, 106, 71, 218, 11, 14, 83, 86, 220,
+ 59, 92, 72, 75, 72, 75, 78, 100, 270, 279,
+ 89, 349, 278, 94, 353, 207, 211, 352, 320, 71,
+ -169, 59, 199, 83, 86, 197, 198, 92, 72, 75,
+ 207, 211, 78, -169, 37, 71, 89, 199, 38, 83,
+ 269, -167, 193, 92, -166, 11, 14, 59, 137, 72,
+ 75, 272, 89, 102, 182, 106, 37, 207, 211, -186,
+ 38, 71, 181, 59, 199, 83, 86, 11, 337, 92,
+ 231, 97, 339, 76, 78, 72, 75, 37, 89, 82,
+ 48, 38, 71, 48, 323, 176, 83, 86, 11, 59,
+ 92, 342, 46, 47, 184, 78, 100, 74, -168, 89,
+ 72, 75, 94, -172, 102, 346, 106, -173, 71, 175,
+ 59, 59, 83, 86, 240, -171, 92, -170, 241, 242,
+ 76, 78, 97, 197, 198, 89, 72, 75, 207, 211,
+ 102, 214, 106, 71, 64, 199, 59, 83, 86, 276,
+ 215, 92, 217, 246, 275, 173, 78, 100, 97, 82,
+ 89, 72, 75, 94, 155, 102, 122, 106, 152, 71,
+ 223, 59, -168, 83, 86, 249, 277, 92, 176, 246,
+ 247, 122, 78, 100, 225, -166, 89, 72, 75, 94,
+ 117, 102, 226, 106, 71, -169, 271, 59, 83, 86,
+ 246, 247, 92, -21, -21, -21, -21, 78, 226, 97,
+ -167, 89, 72, 75, 52, -168, 102, -166, 106, -169,
+ 71, -167, 59, -171, 83, 86, 366, 152, 92, -23,
+ -23, -23, -23, 78, 100, 228, 226, 89, 72, 75,
+ 94, 50, 102, 373, 106, 71, 49, 375, 59, 83,
+ 86, 229, -221, 92, 237, 378, 72, 75, 78, 40,
+ 97, 39, 89, 355, 44, 45, 41, 42, 231, 234,
+ nil, 71, nil, 59, nil, 83, 86, nil, nil, 92,
+ 44, 45, 41, 42, 78, 100, 72, 75, 89, 71,
+ 102, 94, 106, 83, 269, nil, nil, 92, nil, 59,
+ nil, nil, 137, nil, nil, nil, 89, nil, 97, nil,
+ nil, nil, 72, 75, nil, nil, 102, 59, 106, 71,
+ nil, nil, nil, 83, 86, nil, nil, 92, nil, nil,
+ nil, nil, 78, 100, 97, nil, 89, nil, nil, 94,
+ nil, nil, 72, 75, nil, 71, 102, 59, 106, 83,
+ 86, nil, nil, 92, nil, nil, nil, nil, 78, 100,
+ nil, nil, 89, nil, 97, 94, nil, nil, 72, 75,
+ nil, nil, 102, 59, 106, 71, nil, nil, nil, 83,
+ 86, nil, nil, 92, nil, nil, 72, 75, 78, 100,
+ 97, nil, 89, 72, 75, 94, nil, 102, nil, 106,
+ nil, 71, nil, 59, nil, 83, 86, 72, 75, 92,
+ nil, 102, nil, nil, 78, 100, nil, nil, 89, 71,
+ nil, 94, nil, 83, 269, nil, 71, 92, nil, 59,
+ 83, 86, 137, nil, 92, nil, 89, nil, nil, 78,
+ 71, nil, nil, 89, 83, 143, nil, 59, 92, nil,
+ nil, nil, nil, 137, 59, 72, 75, 89, nil, 102,
+ nil, 106, 213, 196, 197, 198, 200, 202, 59, 207,
+ 211, nil, 213, 196, 197, 198, 199, 97, nil, 207,
+ 211, 72, 75, nil, nil, 102, 199, 106, 71, nil,
+ nil, nil, 83, 86, nil, nil, 92, nil, nil, nil,
nil, 78, 100, 97, nil, 89, nil, nil, 94, nil,
nil, 72, 75, nil, 71, 102, 59, 106, 83, 86,
nil, nil, 92, nil, nil, nil, nil, 78, 100, nil,
- nil, 89, nil, 97, 94, nil, nil, 72, 75, nil,
- nil, 102, 59, 106, 71, nil, nil, nil, 83, 86,
- nil, nil, 92, nil, nil, nil, nil, 78, 100, 97,
- nil, 89, 72, 75, 94, nil, 102, nil, 106, nil,
- 71, nil, 59, nil, 83, 86, nil, nil, 92, nil,
- nil, nil, nil, 78, 100, nil, nil, 89, 72, 75,
- 94, nil, 102, nil, 106, 71, nil, nil, 59, 83,
- 86, nil, nil, 92, nil, nil, nil, nil, 78, nil,
- 97, nil, 89, nil, 72, 75, nil, nil, 102, nil,
- 106, 71, nil, 59, nil, 83, 86, nil, nil, 92,
- nil, nil, 72, 75, 78, 100, 97, nil, 89, 72,
- 75, 94, nil, 102, nil, 106, nil, 71, nil, 59,
- nil, 83, 86, nil, nil, 92, nil, nil, nil, nil,
- 78, 100, nil, nil, 89, 162, nil, 94, nil, 83,
- 268, nil, 71, 92, nil, 59, 83, 86, 137, nil,
- 92, nil, 89, nil, nil, 78, 72, 75, nil, 89,
- 102, nil, 106, 59, nil, nil, nil, nil, nil, nil,
- 59, nil, nil, nil, nil, 72, 75, nil, 97, nil,
- nil, nil, nil, nil, nil, nil, nil, nil, nil, 71,
- nil, nil, nil, 83, 86, nil, nil, 92, 177, nil,
- 72, 75, 78, 100, nil, nil, 89, nil, 71, 94,
- nil, nil, 83, 86, nil, nil, 92, 59, 72, 75,
- 76, 78, 102, 339, 106, 89, nil, nil, nil, nil,
- nil, nil, nil, 71, nil, nil, 59, 83, 86, nil,
- 97, 92, nil, 72, 75, 76, 78, 102, nil, 106,
- 89, 71, nil, 72, 75, 83, 86, nil, nil, 92,
- nil, 59, nil, nil, 78, 100, nil, nil, 89, 72,
- 75, 94, nil, nil, nil, nil, 71, nil, nil, 59,
- 83, 86, nil, nil, 92, nil, 162, nil, nil, 78,
- 83, 268, nil, 89, 92, nil, 72, 75, nil, 137,
- 102, nil, 162, 89, 59, nil, 83, 268, nil, nil,
- 92, nil, 72, 75, 59, 137, 102, nil, 106, 89,
- nil, nil, 72, 75, nil, nil, 102, nil, 106, 71,
- 59, nil, nil, 83, 268, nil, nil, 92, nil, nil,
- nil, nil, 137, nil, 97, 71, 89, nil, nil, 83,
- 86, nil, nil, 92, nil, 71, nil, 59, 78, 83,
- 86, nil, 89, 92, nil, nil, nil, nil, 78, 100,
- 72, 75, 89, 59, 102, 94, 106, 213, 196, 197,
- 198, 200, 202, 59, 207, 211, nil, nil, nil, 72,
- 75, 199, 97, 102, 189, 106, 72, 75, nil, nil,
+ nil, 89, nil, 97, 94, nil, nil, nil, nil, nil,
+ nil, nil, 59, nil, 71, nil, nil, nil, 83, 86,
+ 72, 75, 92, nil, 102, 189, 106, 78, 100, nil,
+ nil, 89, nil, nil, 94, nil, nil, nil, nil, 72,
+ 75, nil, 59, 102, nil, 106, 72, 75, nil, nil,
102, nil, 106, 71, nil, nil, nil, 83, 86, nil,
- nil, 92, nil, nil, nil, nil, 78, 100, 72, 75,
- 89, nil, 71, 94, nil, nil, 83, 86, nil, 71,
+ nil, 92, nil, nil, nil, nil, 78, nil, 97, nil,
+ 89, nil, 71, nil, nil, nil, 83, 86, nil, 71,
92, 59, nil, 83, 86, 78, nil, 92, nil, 89,
- nil, nil, 78, 72, 75, nil, 89, 102, nil, 106,
- 59, 162, nil, nil, nil, 83, 268, 59, nil, 92,
- nil, 72, 75, nil, 137, 102, nil, 106, 89, nil,
- nil, nil, nil, nil, nil, nil, 71, nil, nil, 59,
- 83, 86, nil, 97, 92, nil, nil, nil, nil, 78,
- nil, 72, 75, 89, 71, 102, nil, 106, 83, 86,
- nil, nil, 92, nil, 59, nil, nil, 78, 100, nil,
- nil, 89, nil, 97, 94, nil, nil, 72, 75, nil,
- nil, 102, 59, 106, 71, nil, nil, nil, 83, 86,
- nil, nil, 92, nil, nil, nil, nil, 78, 100, 97,
- nil, 89, nil, nil, 94, nil, nil, nil, nil, nil,
- 71, nil, 59, nil, 83, 86, 212, nil, 92, nil,
- nil, nil, nil, 78, 100, 205, 210, 89, nil, nil,
- 94, nil, nil, nil, 201, 203, 206, 209, 59, nil,
- 205, 210, nil, nil, nil, nil, nil, nil, nil, 201,
- 203, 206, 209, nil, nil, nil, nil, nil, 204, 208,
- nil, nil, 213, 196, 197, 198, 200, 202, nil, 207,
- 211, nil, nil, 204, 208, nil, 199, 213, 196, 197,
- 198, 200, 202, nil, 207, 211, 205, 210, nil, nil,
- nil, 199, nil, nil, nil, 201, 203, 206, 209, nil,
- nil, 205, 210, nil, nil, nil, nil, nil, nil, nil,
- 201, 203, 206, 209, nil, nil, nil, nil, nil, 204,
- 208, nil, nil, 213, 196, 197, 198, 200, 202, nil,
- 207, 211, nil, nil, 204, 208, nil, 199, 213, 196,
- 197, 198, 200, 202, nil, 207, 211, 205, 210, nil,
- nil, nil, 199, nil, nil, nil, 201, 203, 206, 209,
- nil, nil, 205, 210, nil, nil, nil, nil, nil, nil,
- 273, 201, 203, 206, 209, nil, nil, nil, nil, nil,
- nil, 208, nil, nil, 213, 196, 197, 198, 200, 202,
- nil, 207, 211, nil, nil, 204, 208, nil, 199, 213,
- 196, 197, 198, 200, 202, nil, 207, 211, 205, 210,
- nil, nil, nil, 199, nil, nil, nil, 201, 203, 206,
- 209, nil, nil, 26, 210, 33, 1, nil, 7, 12,
- nil, 17, 201, 23, nil, 29, nil, 3, nil, nil,
- 11, 14, nil, 210, nil, 213, 196, 197, 198, 200,
- 202, 201, 207, 211, nil, nil, nil, nil, nil, 199,
- 213, 196, 197, 198, 200, 202, nil, 207, 211, nil,
- nil, 324, nil, nil, 199, nil, nil, nil, nil, 213,
- 196, 197, 198, 200, 202, nil, 207, 211, nil, nil,
- 379, nil, 26, 199, 33, 1, nil, 7, 12, nil,
+ nil, nil, 78, 100, nil, nil, 89, 72, 75, 94,
+ 59, 102, nil, 106, nil, nil, nil, 59, nil, nil,
+ nil, nil, nil, nil, nil, nil, 72, 75, nil, 97,
+ 102, nil, 106, 72, 75, nil, nil, 102, nil, 106,
+ 71, nil, nil, nil, 83, 86, nil, nil, 92, nil,
+ nil, nil, nil, 78, 100, 97, nil, 89, nil, 71,
+ 94, nil, nil, 83, 86, nil, 71, 92, 59, nil,
+ 83, 86, 78, nil, 92, nil, 89, nil, nil, 78,
+ 100, nil, nil, 89, 72, 75, 94, 59, 102, nil,
+ 106, nil, nil, nil, 59, nil, nil, nil, nil, nil,
+ nil, nil, nil, 72, 75, nil, 97, nil, nil, 72,
+ 75, nil, nil, nil, nil, nil, nil, 71, nil, nil,
+ nil, 83, 86, nil, nil, 92, 340, nil, nil, nil,
+ 78, 100, 177, nil, 89, nil, 71, 94, nil, nil,
+ 83, 86, 71, nil, 92, 59, 83, 86, 76, 78,
+ 92, nil, nil, 89, 76, 78, 72, 75, nil, 89,
+ 102, nil, 106, nil, 59, nil, 213, 196, 197, 198,
+ 59, nil, nil, 207, 211, 72, 75, nil, 97, 102,
+ 199, 106, 72, 75, nil, nil, nil, nil, nil, 71,
+ nil, nil, nil, 83, 86, nil, nil, 92, nil, nil,
+ 72, 75, 78, 100, nil, nil, 89, nil, 71, 94,
+ nil, nil, 83, 86, nil, 71, 92, 59, nil, 83,
+ 269, 78, nil, 92, nil, 89, nil, nil, 137, nil,
+ nil, nil, 89, 71, nil, nil, 59, 83, 269, nil,
+ nil, 92, nil, 59, nil, nil, 137, 72, 75, nil,
+ 89, 102, nil, 106, nil, nil, nil, nil, nil, nil,
+ nil, 59, nil, nil, nil, nil, 72, 75, nil, 97,
+ 102, nil, 106, 72, 75, nil, nil, 102, nil, 106,
+ 71, nil, nil, nil, 83, 86, nil, nil, 92, nil,
+ nil, nil, nil, 78, 100, 72, 75, 89, nil, 71,
+ 94, nil, nil, 83, 86, nil, 71, 92, 59, nil,
+ 83, 86, 78, nil, 92, nil, 89, nil, nil, 78,
+ 72, 75, nil, 89, 102, nil, 106, 59, 71, nil,
+ nil, nil, 83, 269, 59, nil, 92, nil, 72, 75,
+ nil, 137, 102, nil, 106, 89, nil, nil, nil, nil,
+ nil, nil, nil, 71, nil, nil, 59, 83, 86, nil,
+ 97, 92, nil, 72, 75, nil, 78, 102, nil, 106,
+ 89, 71, nil, 72, 75, 83, 86, 102, nil, 92,
+ nil, 59, nil, nil, 78, 100, nil, nil, 89, nil,
+ nil, 94, nil, nil, nil, nil, 71, nil, nil, 59,
+ 83, 86, nil, nil, 92, nil, 71, nil, nil, 78,
+ 83, 269, nil, 89, 92, nil, 72, 75, nil, 137,
+ 102, nil, 106, 89, 59, nil, nil, nil, nil, nil,
+ nil, nil, nil, nil, 59, 72, 75, nil, 97, 102,
+ nil, 106, 72, 75, nil, nil, 102, nil, 106, 71,
+ nil, nil, nil, 83, 86, nil, nil, 92, nil, nil,
+ nil, nil, 78, 100, 97, nil, 89, nil, 71, 94,
+ nil, nil, 83, 86, nil, 71, 92, 59, nil, 83,
+ 86, 78, nil, 92, nil, 89, nil, nil, 78, 100,
+ 212, nil, 89, nil, nil, 94, 59, nil, nil, 205,
+ 210, nil, nil, 59, nil, nil, nil, nil, 201, 203,
+ 206, 209, nil, nil, 205, 210, nil, nil, nil, nil,
+ nil, nil, 274, 201, 203, 206, 209, nil, nil, nil,
+ nil, nil, 204, 208, nil, nil, 213, 196, 197, 198,
+ 200, 202, nil, 207, 211, nil, nil, 204, 208, nil,
+ 199, 213, 196, 197, 198, 200, 202, nil, 207, 211,
+ 205, 210, nil, nil, nil, 199, nil, nil, nil, 201,
+ 203, 206, 209, nil, nil, 205, 210, nil, nil, nil,
+ nil, nil, nil, nil, 201, 203, 206, 209, nil, nil,
+ nil, nil, nil, nil, 208, nil, nil, 213, 196, 197,
+ 198, 200, 202, nil, 207, 211, nil, nil, 204, 208,
+ nil, 199, 213, 196, 197, 198, 200, 202, nil, 207,
+ 211, 205, 210, nil, nil, nil, 199, nil, nil, nil,
+ 201, 203, 206, 209, nil, nil, 205, 210, nil, nil,
+ nil, nil, nil, nil, nil, 201, 203, 206, 209, nil,
+ nil, nil, nil, nil, 204, 208, nil, nil, 213, 196,
+ 197, 198, 200, 202, nil, 207, 211, nil, nil, nil,
+ nil, nil, 199, 213, 196, 197, 198, 200, 202, nil,
+ 207, 211, 205, 210, nil, nil, nil, 199, nil, nil,
+ nil, 201, 203, 206, 209, nil, nil, nil, 210, nil,
+ 213, 196, 197, 198, 200, 202, 201, 207, 211, nil,
+ nil, nil, nil, nil, 199, 204, 208, 210, nil, 213,
+ 196, 197, 198, 200, 202, 201, 207, 211, nil, nil,
+ nil, nil, 210, 199, 213, 196, 197, 198, 200, 202,
+ 201, 207, 211, nil, nil, nil, nil, nil, 199, nil,
+ nil, 210, nil, 213, 196, 197, 198, 200, 202, 201,
+ 207, 211, nil, nil, nil, nil, nil, 199, 213, 196,
+ 197, 198, 200, 202, nil, 207, 211, nil, nil, 384,
+ nil, nil, 199, nil, nil, nil, nil, 213, 196, 197,
+ 198, 200, 202, nil, 207, 211, nil, nil, 297, nil,
+ 26, 199, 33, 1, nil, 7, 12, nil, 17, nil,
+ 23, nil, 29, nil, 3, nil, nil, 11, 14, 26,
+ 305, 33, 1, nil, 7, 12, nil, 17, nil, 23,
+ nil, 29, nil, 3, nil, nil, 11, 14, nil, 383,
+ nil, 26, nil, 33, 1, nil, 7, 12, nil, 17,
+ nil, 23, nil, 29, nil, 3, nil, nil, 11, 14,
+ 26, 325, 33, 1, nil, 7, 12, nil, 17, nil,
+ 23, nil, 29, nil, 3, nil, nil, 11, 14, nil,
+ 382, nil, 26, nil, 33, 1, nil, 7, 12, nil,
17, nil, 23, nil, 29, nil, 3, nil, nil, 11,
- 14, 26, 382, 33, 1, nil, 7, 12, nil, 17,
+ 14, 26, 380, 33, 1, nil, 7, 12, nil, 17,
nil, 23, nil, 29, nil, 3, nil, nil, 11, 14,
- nil, 296, nil, 26, nil, 33, 1, nil, 7, 12,
+ nil, 376, nil, 26, nil, 33, 1, nil, 7, 12,
nil, 17, nil, 23, nil, 29, nil, 3, nil, nil,
- 11, 14, 26, 364, 33, 1, nil, 7, 12, nil,
+ 11, 14, 26, 350, 33, 1, nil, 7, 12, nil,
17, nil, 23, nil, 29, nil, 3, nil, nil, 11,
- 14, nil, 381, nil, 26, nil, 33, 1, nil, 7,
+ 14, nil, 358, nil, 26, nil, 33, 1, nil, 7,
12, nil, 17, nil, 23, nil, 29, nil, 3, nil,
- nil, 11, 14, 26, 383, 33, 1, nil, 7, 12,
+ nil, 11, 14, 26, 365, 33, 1, nil, 7, 12,
nil, 17, nil, 23, nil, 29, nil, 3, nil, nil,
- 11, 14, nil, 357, nil, 26, nil, 33, 1, nil,
+ 11, 14, nil, 364, nil, 26, nil, 33, 1, nil,
7, 12, nil, 17, nil, 23, nil, 29, nil, 3,
- nil, nil, 11, 14, 26, 363, 33, 1, nil, 7,
+ nil, nil, 11, 14, 26, nil, 33, 1, nil, 7,
12, nil, 17, nil, 23, nil, 29, nil, 3, nil,
- nil, 11, 14, nil, 375, nil, 26, nil, 33, 1,
- nil, 7, 12, nil, 17, nil, 23, nil, 29, nil,
- 3, nil, nil, 11, 14, 26, 304, 33, 1, nil,
- 7, 12, nil, 17, nil, 23, nil, 29, nil, 3,
- nil, nil, 11, 14, nil, 349, nil, 26, nil, 33,
- 1, nil, 7, 12, nil, 17, nil, 23, nil, 29,
- nil, 3, nil, nil, 11, 14, 26, nil, 33, 1,
- nil, 7, 12, nil, 17, nil, 23, nil, 29, nil,
- 3, nil, nil, 11, 14, 26, nil, 33, 1, nil,
- 7, 12, nil, 17, nil, 23, nil, 29, nil, 3,
- nil, nil, 11, 14 ]
+ nil, 11, 14, 26, nil, 33, 1, nil, 7, 12,
+ nil, 17, nil, 23, nil, 29, nil, 3, nil, nil,
+ 11, 14, 26, nil, 33, 1, nil, 7, 12, nil,
+ 17, nil, 23, nil, 29, nil, 3, nil, nil, 11,
+ 14 ]
racc_action_check = [
- 180, 180, 152, 86, 156, 106, 106, 272, 174, 7,
- 277, 277, 106, 180, 180, 65, 55, 277, 7, 7,
- 272, 86, 180, 180, 180, 180, 65, 296, 17, 80,
- 296, 65, 158, 95, 202, 202, 174, 174, 202, 218,
- 202, 55, 156, 106, 152, 156, 180, 180, 277, 219,
- 180, 180, 180, 180, 180, 180, 202, 180, 180, 181,
- 181, 368, 368, 239, 180, 156, 17, 202, 165, 17,
- 158, 202, 202, 158, 239, 202, 165, 182, 182, 239,
- 202, 202, 349, 182, 202, 349, 22, 202, 22, 17,
- 143, 243, 181, 158, 368, 202, 181, 181, 368, 368,
- 181, 22, 368, 143, 181, 181, 220, 368, 163, 181,
- 182, 368, 355, 355, 182, 182, 243, 243, 182, 163,
- 181, 62, 368, 182, 163, 22, 178, 182, 281, 281,
- 351, 351, 62, 221, 351, 281, 351, 62, 182, 178,
- 285, 285, 285, 285, 101, 355, 221, 285, 285, 355,
- 355, 224, 351, 355, 285, 341, 341, 300, 355, 341,
- 91, 341, 355, 351, 308, 300, 226, 351, 351, 308,
- 227, 351, 90, 355, 184, 184, 351, 351, 12, 122,
- 351, 171, 12, 351, 122, 171, 171, 229, 341, 12,
- 286, 351, 341, 341, 343, 343, 341, 184, 286, 1,
- 87, 341, 30, 1, 183, 341, 30, 184, 183, 183,
- 1, 184, 184, 30, 30, 184, 341, 196, 196, 184,
- 184, 196, 195, 196, 184, 195, 286, 286, 286, 286,
- 286, 286, 188, 286, 286, 184, 188, 188, 231, 196,
- 286, 120, 232, 197, 197, 120, 233, 197, 103, 197,
- 196, 85, 120, 120, 196, 196, 105, 43, 196, 280,
- 280, 43, 84, 196, 196, 197, 280, 196, 43, 43,
- 196, 81, 215, 23, 23, 78, 197, 23, 196, 250,
- 197, 197, 279, 279, 197, 252, 253, 279, 279, 197,
- 197, 77, 71, 197, 279, 23, 197, 160, 68, 26,
- 26, 160, 160, 26, 197, 26, 23, 268, 67, 234,
- 23, 23, 211, 234, 23, 274, 234, 66, 23, 23,
- 234, 26, 107, 23, 108, 198, 198, 109, 207, 198,
- 114, 198, 26, 115, 23, 119, 26, 26, 64, 121,
- 26, 35, 35, 35, 35, 26, 26, 198, 52, 26,
- 29, 29, 26, 51, 29, 50, 29, 127, 198, 132,
- 26, 36, 198, 198, 307, 307, 198, 133, 307, 136,
- 307, 198, 198, 138, 192, 198, 139, 33, 198, 34,
- 34, 34, 34, 29, 140, 142, 198, 29, 29, 305,
- 305, 29, 315, 305, 144, 305, 29, 307, 16, 327,
- 29, 307, 307, 199, 199, 307, 328, 199, 330, 199,
- 307, 29, 297, 297, 307, 331, 332, 297, 297, 337,
- 153, 175, 305, 154, 297, 307, 305, 305, 9, 288,
- 305, 28, 28, 28, 28, 305, 199, 288, 352, 305,
- 199, 199, 8, 356, 199, 298, 298, 173, 367, 199,
- 305, 172, 298, 199, 369, 200, 200, 3, 2, 200,
- 157, 200, 263, nil, 199, 288, 288, 288, 288, 288,
- 288, nil, 288, 288, nil, nil, nil, 200, 298, 288,
- nil, nil, 298, 298, nil, nil, 298, nil, 200, nil,
- nil, 298, 200, 200, nil, 298, 200, 4, 4, 4,
- 4, 200, 200, 39, 39, 200, 298, 39, 200, 39,
- 293, 293, 293, 293, 293, 293, 200, 293, 293, nil,
- 283, 283, 283, 283, 293, 39, nil, 283, 283, 201,
- 201, nil, nil, 201, 283, 201, 39, nil, nil, nil,
- 39, 39, nil, nil, 39, nil, nil, nil, nil, 39,
- 39, 201, nil, 39, nil, nil, 39, nil, nil, 46,
- 46, nil, 201, 46, 39, 46, 201, 201, nil, nil,
- 201, nil, nil, nil, nil, 201, 201, nil, nil, 201,
- nil, 46, 201, nil, nil, 47, 47, nil, nil, 47,
- 201, 47, 46, nil, nil, nil, 46, 46, nil, nil,
- 46, nil, nil, nil, nil, 46, 46, 47, nil, 46,
- 48, 48, 46, nil, 48, nil, 48, nil, 47, nil,
- 46, nil, 47, 47, 49, 49, 47, nil, 49, nil,
- nil, 47, 47, nil, nil, 47, nil, nil, 47, nil,
- nil, nil, nil, 48, nil, nil, 47, 48, 48, 176,
- 176, 48, nil, 176, nil, 176, 48, 49, nil, nil,
- 48, 49, 49, nil, nil, 49, nil, nil, nil, nil,
- 49, 48, nil, nil, 49, 203, 203, nil, nil, 203,
- nil, 203, 176, nil, nil, 49, 176, 176, nil, nil,
- 176, nil, nil, nil, nil, 176, nil, 203, nil, 176,
- nil, 204, 204, nil, nil, 204, nil, 204, 203, nil,
- 176, nil, 203, 203, nil, nil, 203, nil, nil, nil,
- nil, 203, 203, 204, nil, 203, nil, nil, 203, nil,
- nil, 205, 205, nil, 204, 205, 203, 205, 204, 204,
- nil, nil, 204, nil, nil, nil, nil, 204, 204, nil,
- nil, 204, nil, 205, 204, nil, nil, 100, 100, nil,
- nil, 100, 204, 100, 205, nil, nil, nil, 205, 205,
- nil, nil, 205, nil, nil, nil, nil, 205, 205, 100,
- nil, 205, 63, 63, 205, nil, 63, nil, 63, nil,
- 100, nil, 205, nil, 100, 100, nil, nil, 100, nil,
- nil, nil, nil, 100, 100, nil, nil, 100, 208, 208,
- 100, nil, 208, nil, 208, 63, nil, nil, 100, 63,
- 63, nil, nil, 63, nil, nil, nil, nil, 63, nil,
- 208, nil, 63, nil, 209, 209, nil, nil, 209, nil,
- 209, 208, nil, 63, nil, 208, 208, nil, nil, 208,
- nil, nil, 269, 269, 208, 208, 209, nil, 208, 276,
- 276, 208, nil, 276, nil, 276, nil, 209, nil, 208,
- nil, 209, 209, nil, nil, 209, nil, nil, nil, nil,
- 209, 209, nil, nil, 209, 269, nil, 209, nil, 269,
- 269, nil, 276, 269, nil, 209, 276, 276, 269, nil,
- 276, nil, 269, nil, nil, 276, 256, 256, nil, 276,
- 256, nil, 256, 269, nil, nil, nil, nil, nil, nil,
- 276, nil, nil, nil, nil, 74, 74, nil, 256, nil,
- nil, nil, nil, nil, nil, nil, nil, nil, nil, 256,
- nil, nil, nil, 256, 256, nil, nil, 256, 74, nil,
- 254, 254, 256, 256, nil, nil, 256, nil, 74, 256,
- nil, nil, 74, 74, nil, nil, 74, 256, 75, 75,
- 74, 74, 75, 254, 75, 74, nil, nil, nil, nil,
- nil, nil, nil, 254, nil, nil, 74, 254, 254, nil,
- 75, 254, nil, 248, 248, 254, 254, 248, nil, 248,
- 254, 75, nil, 245, 245, 75, 75, nil, nil, 75,
- nil, 254, nil, nil, 75, 75, nil, nil, 75, 244,
- 244, 75, nil, nil, nil, nil, 248, nil, nil, 75,
- 248, 248, nil, nil, 248, nil, 245, nil, nil, 248,
- 245, 245, nil, 248, 245, nil, 225, 225, nil, 245,
- 225, nil, 244, 245, 248, nil, 244, 244, nil, nil,
- 244, nil, 82, 82, 245, 244, 82, nil, 82, 244,
- nil, nil, 210, 210, nil, nil, 210, nil, 210, 225,
- 244, nil, nil, 225, 225, nil, nil, 225, nil, nil,
- nil, nil, 225, nil, 210, 82, 225, nil, nil, 82,
- 82, nil, nil, 82, nil, 210, nil, 225, 82, 210,
- 210, nil, 82, 210, nil, nil, nil, nil, 210, 210,
- 213, 213, 210, 82, 213, 210, 213, 284, 284, 284,
- 284, 284, 284, 210, 284, 284, nil, nil, nil, 102,
- 102, 284, 213, 102, 102, 102, 230, 230, nil, nil,
- 230, nil, 230, 213, nil, nil, nil, 213, 213, nil,
- nil, 213, nil, nil, nil, nil, 213, 213, 214, 214,
- 213, nil, 102, 213, nil, nil, 102, 102, nil, 230,
- 102, 213, nil, 230, 230, 102, nil, 230, nil, 102,
- nil, nil, 230, 228, 228, nil, 230, 228, nil, 228,
- 102, 214, nil, nil, nil, 214, 214, 230, nil, 214,
- nil, 94, 94, nil, 214, 94, nil, 94, 214, nil,
- nil, nil, nil, nil, nil, nil, 228, nil, nil, 214,
- 228, 228, nil, 94, 228, nil, nil, nil, nil, 228,
- nil, 97, 97, 228, 94, 97, nil, 97, 94, 94,
- nil, nil, 94, nil, 228, nil, nil, 94, 94, nil,
- nil, 94, nil, 97, 94, nil, nil, 206, 206, nil,
- nil, 206, 94, 206, 97, nil, nil, nil, 97, 97,
- nil, nil, 97, nil, nil, nil, nil, 97, 97, 206,
- nil, 97, nil, nil, 97, nil, nil, nil, nil, nil,
- 206, nil, 97, nil, 206, 206, 111, nil, 206, nil,
- nil, nil, nil, 206, 206, 111, 111, 206, nil, nil,
- 206, nil, nil, nil, 111, 111, 111, 111, 206, nil,
- 124, 124, nil, nil, nil, nil, nil, nil, nil, 124,
- 124, 124, 124, nil, nil, nil, nil, nil, 111, 111,
- nil, nil, 111, 111, 111, 111, 111, 111, nil, 111,
- 111, nil, nil, 124, 124, nil, 111, 124, 124, 124,
- 124, 124, 124, nil, 124, 124, 130, 130, nil, nil,
- nil, 124, nil, nil, nil, 130, 130, 130, 130, nil,
- nil, 131, 131, nil, nil, nil, nil, nil, nil, nil,
- 131, 131, 131, 131, nil, nil, nil, nil, nil, 130,
- 130, nil, nil, 130, 130, 130, 130, 130, 130, nil,
- 130, 130, nil, nil, 131, 131, nil, 130, 131, 131,
- 131, 131, 131, 131, nil, 131, 131, 287, 287, nil,
- nil, nil, 131, nil, nil, nil, 287, 287, 287, 287,
- nil, nil, 186, 186, nil, nil, nil, nil, nil, nil,
- 186, 186, 186, 186, 186, nil, nil, nil, nil, nil,
- nil, 287, nil, nil, 287, 287, 287, 287, 287, 287,
- nil, 287, 287, nil, nil, 186, 186, nil, 287, 186,
- 186, 186, 186, 186, 186, nil, 186, 186, 291, 291,
- nil, nil, nil, 186, nil, nil, nil, 291, 291, 291,
- 291, nil, nil, 19, 292, 19, 19, nil, 19, 19,
- nil, 19, 292, 19, nil, 19, nil, 19, nil, nil,
- 19, 19, nil, 289, nil, 291, 291, 291, 291, 291,
- 291, 289, 291, 291, nil, nil, nil, nil, nil, 291,
- 292, 292, 292, 292, 292, 292, nil, 292, 292, nil,
- nil, 237, nil, nil, 292, nil, nil, nil, nil, 289,
- 289, 289, 289, 289, 289, nil, 289, 289, nil, nil,
- 372, nil, 237, 289, 237, 237, nil, 237, 237, nil,
+ 180, 180, 152, 22, 243, 22, 55, 17, 86, 301,
+ 81, 165, 96, 180, 180, 178, 12, 301, 22, 165,
+ 12, 95, 180, 180, 180, 180, 86, 12, 178, 243,
+ 243, 55, 156, 174, 208, 208, 106, 106, 208, 215,
+ 208, 91, 22, 106, 152, 17, 180, 180, 17, 218,
+ 180, 180, 180, 180, 180, 180, 208, 180, 180, 176,
+ 176, 174, 174, 176, 180, 176, 62, 208, 17, 219,
+ 156, 208, 208, 156, 106, 208, 158, 62, 369, 369,
+ 208, 208, 62, 239, 208, 205, 205, 208, 220, 205,
+ 65, 205, 176, 156, 239, 208, 176, 176, 211, 239,
+ 176, 65, 224, 181, 181, 176, 65, 205, 273, 176,
+ 350, 369, 143, 350, 158, 369, 369, 158, 205, 369,
+ 176, 273, 205, 205, 369, 143, 205, 90, 369, 356,
+ 356, 205, 205, 344, 344, 205, 181, 158, 205, 369,
+ 181, 181, 221, 226, 181, 227, 205, 163, 181, 181,
+ 352, 352, 87, 181, 352, 221, 352, 120, 163, 229,
+ 309, 120, 356, 163, 181, 309, 356, 356, 120, 120,
+ 356, 85, 352, 231, 43, 356, 342, 342, 43, 356,
+ 342, 232, 342, 352, 122, 43, 43, 352, 352, 122,
+ 356, 352, 182, 182, 278, 278, 352, 352, 182, 195,
+ 352, 278, 195, 352, 297, 281, 281, 297, 233, 342,
+ 103, 352, 281, 342, 342, 280, 280, 342, 184, 184,
+ 280, 280, 342, 84, 30, 182, 342, 280, 30, 182,
+ 182, 105, 278, 182, 101, 30, 30, 342, 182, 204,
+ 204, 184, 182, 204, 80, 204, 1, 282, 282, 78,
+ 1, 184, 77, 182, 282, 184, 184, 1, 250, 184,
+ 252, 204, 253, 184, 184, 23, 23, 234, 184, 23,
+ 71, 234, 204, 7, 234, 70, 204, 204, 234, 184,
+ 204, 264, 7, 7, 269, 204, 204, 23, 68, 204,
+ 26, 26, 204, 107, 26, 275, 26, 67, 23, 66,
+ 204, 207, 23, 23, 160, 108, 23, 109, 160, 160,
+ 23, 23, 26, 298, 298, 23, 196, 196, 298, 298,
+ 196, 114, 196, 26, 115, 298, 23, 26, 26, 188,
+ 119, 26, 121, 188, 188, 64, 26, 26, 196, 127,
+ 26, 29, 29, 26, 52, 29, 51, 29, 50, 196,
+ 132, 26, 133, 196, 196, 171, 192, 196, 135, 171,
+ 171, 36, 196, 196, 136, 138, 196, 213, 213, 196,
+ 33, 213, 139, 213, 29, 140, 183, 196, 29, 29,
+ 183, 183, 29, 28, 28, 28, 28, 29, 316, 213,
+ 142, 29, 306, 306, 16, 328, 306, 329, 306, 331,
+ 213, 332, 29, 333, 213, 213, 338, 175, 213, 35,
+ 35, 35, 35, 213, 213, 173, 172, 213, 197, 197,
+ 213, 9, 197, 353, 197, 306, 8, 357, 213, 306,
+ 306, 144, 368, 306, 157, 370, 299, 299, 306, 3,
+ 197, 2, 306, 299, 34, 34, 34, 34, 153, 154,
+ nil, 197, nil, 306, nil, 197, 197, nil, nil, 197,
+ 4, 4, 4, 4, 197, 197, 39, 39, 197, 299,
+ 39, 197, 39, 299, 299, nil, nil, 299, nil, 197,
+ nil, nil, 299, nil, nil, nil, 299, nil, 39, nil,
+ nil, nil, 206, 206, nil, nil, 206, 299, 206, 39,
+ nil, nil, nil, 39, 39, nil, nil, 39, nil, nil,
+ nil, nil, 39, 39, 206, nil, 39, nil, nil, 39,
+ nil, nil, 46, 46, nil, 206, 46, 39, 46, 206,
+ 206, nil, nil, 206, nil, nil, nil, nil, 206, 206,
+ nil, nil, 206, nil, 46, 206, nil, nil, 47, 47,
+ nil, nil, 47, 206, 47, 46, nil, nil, nil, 46,
+ 46, nil, nil, 46, nil, nil, 270, 270, 46, 46,
+ 47, nil, 46, 48, 48, 46, nil, 48, nil, 48,
+ nil, 47, nil, 46, nil, 47, 47, 49, 49, 47,
+ nil, 49, nil, nil, 47, 47, nil, nil, 47, 270,
+ nil, 47, nil, 270, 270, nil, 48, 270, nil, 47,
+ 48, 48, 270, nil, 48, nil, 270, nil, nil, 48,
+ 49, nil, nil, 48, 49, 49, nil, 270, 49, nil,
+ nil, nil, nil, 49, 48, 203, 203, 49, nil, 203,
+ nil, 203, 294, 294, 294, 294, 294, 294, 49, 294,
+ 294, nil, 284, 284, 284, 284, 294, 203, nil, 284,
+ 284, 209, 209, nil, nil, 209, 284, 209, 203, nil,
+ nil, nil, 203, 203, nil, nil, 203, nil, nil, nil,
+ nil, 203, 203, 209, nil, 203, nil, nil, 203, nil,
+ nil, 210, 210, nil, 209, 210, 203, 210, 209, 209,
+ nil, nil, 209, nil, nil, nil, nil, 209, 209, nil,
+ nil, 209, nil, 210, 209, nil, nil, nil, nil, nil,
+ nil, nil, 209, nil, 210, nil, nil, nil, 210, 210,
+ 102, 102, 210, nil, 102, 102, 102, 210, 210, nil,
+ nil, 210, nil, nil, 210, nil, nil, nil, nil, 63,
+ 63, nil, 210, 63, nil, 63, 202, 202, nil, nil,
+ 202, nil, 202, 102, nil, nil, nil, 102, 102, nil,
+ nil, 102, nil, nil, nil, nil, 102, nil, 202, nil,
+ 102, nil, 63, nil, nil, nil, 63, 63, nil, 202,
+ 63, 102, nil, 202, 202, 63, nil, 202, nil, 63,
+ nil, nil, 202, 202, nil, nil, 202, 100, 100, 202,
+ 63, 100, nil, 100, nil, nil, nil, 202, nil, nil,
+ nil, nil, nil, nil, nil, nil, 277, 277, nil, 100,
+ 277, nil, 277, 198, 198, nil, nil, 198, nil, 198,
+ 100, nil, nil, nil, 100, 100, nil, nil, 100, nil,
+ nil, nil, nil, 100, 100, 198, nil, 100, nil, 277,
+ 100, nil, nil, 277, 277, nil, 198, 277, 100, nil,
+ 198, 198, 277, nil, 198, nil, 277, nil, nil, 198,
+ 198, nil, nil, 198, 256, 256, 198, 277, 256, nil,
+ 256, nil, nil, nil, 198, nil, nil, nil, nil, nil,
+ nil, nil, nil, 254, 254, nil, 256, nil, nil, 74,
+ 74, nil, nil, nil, nil, nil, nil, 256, nil, nil,
+ nil, 256, 256, nil, nil, 256, 254, nil, nil, nil,
+ 256, 256, 74, nil, 256, nil, 254, 256, nil, nil,
+ 254, 254, 74, nil, 254, 256, 74, 74, 254, 254,
+ 74, nil, nil, 254, 74, 74, 75, 75, nil, 74,
+ 75, nil, 75, nil, 254, nil, 286, 286, 286, 286,
+ 74, nil, nil, 286, 286, 248, 248, nil, 75, 248,
+ 286, 248, 245, 245, nil, nil, nil, nil, nil, 75,
+ nil, nil, nil, 75, 75, nil, nil, 75, nil, nil,
+ 244, 244, 75, 75, nil, nil, 75, nil, 248, 75,
+ nil, nil, 248, 248, nil, 245, 248, 75, nil, 245,
+ 245, 248, nil, 245, nil, 248, nil, nil, 245, nil,
+ nil, nil, 245, 244, nil, nil, 248, 244, 244, nil,
+ nil, 244, nil, 245, nil, nil, 244, 97, 97, nil,
+ 244, 97, nil, 97, nil, nil, nil, nil, nil, nil,
+ nil, 244, nil, nil, nil, nil, 82, 82, nil, 97,
+ 82, nil, 82, 199, 199, nil, nil, 199, nil, 199,
+ 97, nil, nil, nil, 97, 97, nil, nil, 97, nil,
+ nil, nil, nil, 97, 97, 214, 214, 97, nil, 82,
+ 97, nil, nil, 82, 82, nil, 199, 82, 97, nil,
+ 199, 199, 82, nil, 199, nil, 82, nil, nil, 199,
+ 230, 230, nil, 199, 230, nil, 230, 82, 214, nil,
+ nil, nil, 214, 214, 199, nil, 214, nil, 200, 200,
+ nil, 214, 200, nil, 200, 214, nil, nil, nil, nil,
+ nil, nil, nil, 230, nil, nil, 214, 230, 230, nil,
+ 200, 230, nil, 228, 228, nil, 230, 228, nil, 228,
+ 230, 200, nil, 225, 225, 200, 200, 225, nil, 200,
+ nil, 230, nil, nil, 200, 200, nil, nil, 200, nil,
+ nil, 200, nil, nil, nil, nil, 228, nil, nil, 200,
+ 228, 228, nil, nil, 228, nil, 225, nil, nil, 228,
+ 225, 225, nil, 228, 225, nil, 201, 201, nil, 225,
+ 201, nil, 201, 225, 228, nil, nil, nil, nil, nil,
+ nil, nil, nil, nil, 225, 308, 308, nil, 201, 308,
+ nil, 308, 94, 94, nil, nil, 94, nil, 94, 201,
+ nil, nil, nil, 201, 201, nil, nil, 201, nil, nil,
+ nil, nil, 201, 201, 94, nil, 201, nil, 308, 201,
+ nil, nil, 308, 308, nil, 94, 308, 201, nil, 94,
+ 94, 308, nil, 94, nil, 308, nil, nil, 94, 94,
+ 111, nil, 94, nil, nil, 94, 308, nil, nil, 111,
+ 111, nil, nil, 94, nil, nil, nil, nil, 111, 111,
+ 111, 111, nil, nil, 186, 186, nil, nil, nil, nil,
+ nil, nil, 186, 186, 186, 186, 186, nil, nil, nil,
+ nil, nil, 111, 111, nil, nil, 111, 111, 111, 111,
+ 111, 111, nil, 111, 111, nil, nil, 186, 186, nil,
+ 111, 186, 186, 186, 186, 186, 186, nil, 186, 186,
+ 288, 288, nil, nil, nil, 186, nil, nil, nil, 288,
+ 288, 288, 288, nil, nil, 131, 131, nil, nil, nil,
+ nil, nil, nil, nil, 131, 131, 131, 131, nil, nil,
+ nil, nil, nil, nil, 288, nil, nil, 288, 288, 288,
+ 288, 288, 288, nil, 288, 288, nil, nil, 131, 131,
+ nil, 288, 131, 131, 131, 131, 131, 131, nil, 131,
+ 131, 130, 130, nil, nil, nil, 131, nil, nil, nil,
+ 130, 130, 130, 130, nil, nil, 292, 292, nil, nil,
+ nil, nil, nil, nil, nil, 292, 292, 292, 292, nil,
+ nil, nil, nil, nil, 130, 130, nil, nil, 130, 130,
+ 130, 130, 130, 130, nil, 130, 130, nil, nil, nil,
+ nil, nil, 130, 292, 292, 292, 292, 292, 292, nil,
+ 292, 292, 124, 124, nil, nil, nil, 292, nil, nil,
+ nil, 124, 124, 124, 124, nil, nil, nil, 293, nil,
+ 285, 285, 285, 285, 285, 285, 293, 285, 285, nil,
+ nil, nil, nil, nil, 285, 124, 124, 289, nil, 124,
+ 124, 124, 124, 124, 124, 289, 124, 124, nil, nil,
+ nil, nil, 287, 124, 293, 293, 293, 293, 293, 293,
+ 287, 293, 293, nil, nil, nil, nil, nil, 293, nil,
+ nil, 290, nil, 289, 289, 289, 289, 289, 289, 290,
+ 289, 289, nil, nil, nil, nil, nil, 289, 287, 287,
+ 287, 287, 287, 287, nil, 287, 287, nil, nil, 381,
+ nil, nil, 287, nil, nil, nil, nil, 290, 290, 290,
+ 290, 290, 290, nil, 290, 290, nil, nil, 212, nil,
+ 381, 290, 381, 381, nil, 381, 381, nil, 381, nil,
+ 381, nil, 381, nil, 381, nil, nil, 381, 381, 212,
+ 217, 212, 212, nil, 212, 212, nil, 212, nil, 212,
+ nil, 212, nil, 212, nil, nil, 212, 212, nil, 379,
+ nil, 217, nil, 217, 217, nil, 217, 217, nil, 217,
+ nil, 217, nil, 217, nil, 217, nil, nil, 217, 217,
+ 379, 237, 379, 379, nil, 379, 379, nil, 379, nil,
+ 379, nil, 379, nil, 379, nil, nil, 379, 379, nil,
+ 375, nil, 237, nil, 237, 237, nil, 237, 237, nil,
237, nil, 237, nil, 237, nil, 237, nil, nil, 237,
- 237, 372, 378, 372, 372, nil, 372, 372, nil, 372,
- nil, 372, nil, 372, nil, 372, nil, nil, 372, 372,
- nil, 212, nil, 378, nil, 378, 378, nil, 378, 378,
- nil, 378, nil, 378, nil, 378, nil, 378, nil, nil,
- 378, 378, 212, 323, 212, 212, nil, 212, 212, nil,
- 212, nil, 212, nil, 212, nil, 212, nil, nil, 212,
- 212, nil, 374, nil, 323, nil, 323, 323, nil, 323,
- 323, nil, 323, nil, 323, nil, 323, nil, 323, nil,
- nil, 323, 323, 374, 380, 374, 374, nil, 374, 374,
- nil, 374, nil, 374, nil, 374, nil, 374, nil, nil,
- 374, 374, nil, 303, nil, 380, nil, 380, 380, nil,
- 380, 380, nil, 380, nil, 380, nil, 380, nil, 380,
- nil, nil, 380, 380, 303, 319, 303, 303, nil, 303,
- 303, nil, 303, nil, 303, nil, 303, nil, 303, nil,
- nil, 303, 303, nil, 362, nil, 319, nil, 319, 319,
- nil, 319, 319, nil, 319, nil, 319, nil, 319, nil,
- 319, nil, nil, 319, 319, 362, 217, 362, 362, nil,
- 362, 362, nil, 362, nil, 362, nil, 362, nil, 362,
- nil, nil, 362, 362, nil, 295, nil, 217, nil, 217,
- 217, nil, 217, 217, nil, 217, nil, 217, nil, 217,
- nil, 217, nil, nil, 217, 217, 295, nil, 295, 295,
- nil, 295, 295, nil, 295, nil, 295, nil, 295, nil,
- 295, nil, nil, 295, 295, 0, nil, 0, 0, nil,
- 0, 0, nil, 0, nil, 0, nil, 0, nil, 0,
- nil, nil, 0, 0 ]
+ 237, 375, 373, 375, 375, nil, 375, 375, nil, 375,
+ nil, 375, nil, 375, nil, 375, nil, nil, 375, 375,
+ nil, 363, nil, 373, nil, 373, 373, nil, 373, 373,
+ nil, 373, nil, 373, nil, 373, nil, 373, nil, nil,
+ 373, 373, 363, 296, 363, 363, nil, 363, 363, nil,
+ 363, nil, 363, nil, 363, nil, 363, nil, nil, 363,
+ 363, nil, 304, nil, 296, nil, 296, 296, nil, 296,
+ 296, nil, 296, nil, 296, nil, 296, nil, 296, nil,
+ nil, 296, 296, 304, 324, 304, 304, nil, 304, 304,
+ nil, 304, nil, 304, nil, 304, nil, 304, nil, nil,
+ 304, 304, nil, 320, nil, 324, nil, 324, 324, nil,
+ 324, 324, nil, 324, nil, 324, nil, 324, nil, 324,
+ nil, nil, 324, 324, 320, nil, 320, 320, nil, 320,
+ 320, nil, 320, nil, 320, nil, 320, nil, 320, nil,
+ nil, 320, 320, 19, nil, 19, 19, nil, 19, 19,
+ nil, 19, nil, 19, nil, 19, nil, 19, nil, nil,
+ 19, 19, 0, nil, 0, 0, nil, 0, 0, nil,
+ 0, nil, 0, nil, 0, nil, 0, nil, nil, 0,
+ 0 ]
racc_action_pointer = [
- 1795, 163, 443, 413, 433, nil, nil, 3, 434, 420,
- nil, nil, 142, nil, nil, nil, 398, 26, nil, 1483,
- nil, nil, 80, 271, nil, nil, 297, nil, 367, 348,
- 166, nil, nil, 375, 315, 277, 337, nil, nil, 501,
- nil, nil, nil, 221, nil, nil, 557, 583, 608, 622,
- 315, 329, 348, nil, nil, 4, nil, nil, nil, nil,
- nil, nil, 97, 780, 298, -9, 309, 302, 275, nil,
- nil, 286, nil, nil, 923, 966, nil, 279, 269, nil,
- 6, 248, 1060, nil, 239, 245, -3, 177, nil, nil,
- 149, 137, nil, nil, 1209, 10, nil, 1239, nil, nil,
- 755, 121, 1137, 225, nil, 233, 3, 299, 301, 304,
- nil, 1298, nil, nil, 322, 325, nil, nil, nil, 323,
- 205, 331, 144, nil, 1313, nil, nil, 351, nil, nil,
- 1359, 1374, 352, 344, nil, nil, 328, nil, 350, 364,
- 361, nil, 362, 79, 374, nil, nil, nil, nil, nil,
- nil, nil, -9, 408, 386, nil, 2, 452, 30, nil,
- 251, nil, nil, 84, nil, 50, nil, nil, nil, nil,
- nil, 174, 439, 436, -14, 381, 647, nil, 114, nil,
- -4, 57, 75, 197, 172, nil, 1435, nil, 225, nil,
- nil, nil, 363, nil, nil, 213, 215, 241, 323, 401,
- 453, 527, 32, 673, 699, 729, 1265, 265, 806, 832,
- 1070, 249, 1612, 1118, 1166, 270, nil, 1757, 24, 24,
- 91, 121, nil, nil, 142, 1044, 126, 161, 1191, 147,
- 1144, 198, 233, 238, 273, nil, nil, 1552, nil, 39,
- nil, nil, nil, 66, 1017, 1001, nil, nil, 991, nil,
- 270, nil, 273, 279, 948, nil, 904, nil, nil, nil,
- nil, nil, nil, 451, nil, nil, nil, nil, 283, 850,
- nil, nil, -5, nil, 308, nil, 857, 8, nil, 226,
- 198, 67, nil, 466, 1073, 86, 172, 1420, 411, 1515,
- nil, 1481, 1496, 456, nil, 1776, -4, 356, 443, nil,
- 145, nil, nil, 1694, nil, 387, nil, 362, 129, nil,
- nil, nil, nil, nil, nil, 380, nil, nil, nil, 1716,
- nil, nil, nil, 1634, nil, nil, nil, 376, 383, nil,
- 385, 392, 393, nil, nil, nil, nil, 410, nil, nil,
- nil, 153, nil, 183, nil, nil, nil, nil, nil, 51,
- nil, 128, 430, nil, nil, 110, 435, nil, nil, nil,
- nil, nil, 1735, nil, nil, nil, nil, 439, 59, 445,
- nil, nil, 1571, nil, 1653, nil, nil, nil, 1593, nil,
- 1675, nil, nil, nil ]
+ 1832, 210, 426, 395, 396, nil, nil, 267, 418, 413,
+ nil, nil, -20, nil, nil, nil, 394, 5, nil, 1813,
+ nil, nil, -3, 263, nil, nil, 288, nil, 319, 339,
+ 188, nil, nil, 368, 380, 345, 337, nil, nil, 464,
+ nil, nil, nil, 138, nil, nil, 520, 546, 571, 585,
+ 308, 322, 344, nil, nil, -6, nil, nil, nil, nil,
+ nil, nil, 42, 747, 295, 66, 291, 274, 265, nil,
+ 269, 264, nil, nil, 907, 954, nil, 240, 243, nil,
+ 221, -13, 1064, nil, 200, 165, 2, 129, nil, nil,
+ 104, 18, nil, nil, 1240, -2, 6, 1045, nil, nil,
+ 805, 211, 728, 187, nil, 208, 34, 270, 282, 284,
+ nil, 1282, nil, nil, 313, 316, nil, nil, nil, 318,
+ 121, 324, 149, nil, 1465, nil, nil, 333, nil, nil,
+ 1404, 1358, 343, 329, nil, 352, 323, nil, 342, 360,
+ 352, nil, 367, 101, 411, nil, nil, nil, nil, nil,
+ nil, nil, -9, 436, 412, nil, 30, 426, 74, nil,
+ 258, nil, nil, 123, nil, -7, nil, nil, nil, nil,
+ nil, 348, 404, 404, 11, 367, 57, nil, 3, nil,
+ -4, 101, 190, 369, 216, nil, 1297, nil, 322, nil,
+ nil, nil, 345, nil, nil, 190, 314, 416, 831, 1071,
+ 1136, 1214, 754, 633, 237, 83, 490, 238, 32, 659,
+ 689, 35, 1589, 365, 1093, 37, nil, 1611, 34, 44,
+ 73, 130, nil, nil, 93, 1171, 103, 136, 1161, 119,
+ 1118, 133, 172, 200, 231, nil, nil, 1652, nil, 59,
+ nil, nil, nil, -21, 998, 980, nil, nil, 973, nil,
+ 249, nil, 248, 255, 901, nil, 882, nil, nil, nil,
+ nil, nil, nil, nil, 270, nil, nil, nil, nil, 260,
+ 564, nil, nil, 96, nil, 288, nil, 824, 192, nil,
+ 159, 144, 186, nil, 598, 1446, 912, 1514, 1343, 1499,
+ 1533, nil, 1419, 1480, 588, nil, 1734, 173, 257, 434,
+ nil, -3, nil, nil, 1753, nil, 390, nil, 1233, 125,
+ nil, nil, nil, nil, nil, nil, 376, nil, nil, nil,
+ 1794, nil, nil, nil, 1775, nil, nil, nil, 372, 374,
+ nil, 376, 378, 380, nil, nil, nil, nil, 397, nil,
+ nil, nil, 174, nil, 122, nil, nil, nil, nil, nil,
+ 79, nil, 148, 415, nil, nil, 127, 419, nil, nil,
+ nil, nil, nil, 1712, nil, nil, nil, nil, 423, 76,
+ 426, nil, nil, 1693, nil, 1671, nil, nil, nil, 1630,
+ nil, 1570, nil, nil, nil ]
racc_action_default = [
- -196, -233, -233, -50, -233, -8, -9, -233, -233, -22,
- -10, -187, -188, -11, -185, -12, -233, -233, -13, -1,
- -14, -2, -233, -186, -15, -3, -233, -16, -5, -233,
- -233, -17, -6, -233, -18, -7, -196, -188, -186, -233,
- -51, -26, -27, -233, -24, -25, -233, -233, -233, -85,
- -92, -196, -233, -195, -193, -196, -189, -191, -192, -221,
- -194, -4, -196, -233, -85, -196, -53, -231, -42, -174,
- -43, -213, -117, -33, -233, -233, -44, -31, -74, -32,
- -233, -36, -233, -122, -37, -233, -73, -38, -172, -72,
- -39, -40, -173, -41, -233, -103, -111, -233, -132, -112,
- -233, -104, -233, -108, -110, -105, -233, -114, -106, -113,
- -109, -233, -125, -107, -233, -233, -49, -175, -176, -178,
- -233, -233, -197, -198, -83, -19, -22, -186, -21, -23,
- -82, -84, -233, -75, -86, -81, -70, -74, -76, -219,
- -79, -68, -77, -73, -233, -171, -170, -80, -78, -90,
- -91, -93, -233, -219, -196, 384, -233, -233, -233, -207,
- -233, -57, -213, -196, -59, -233, -66, -65, -56, -73,
- -95, -233, -219, -233, -233, -92, -233, -30, -233, -118,
- -233, -233, -233, -233, -233, -142, -233, -149, -233, -216,
- -229, -225, -233, -228, -224, -233, -233, -233, -233, -233,
- -233, -233, -233, -233, -233, -233, -233, -233, -233, -233,
- -233, -233, -233, -233, -233, -233, -20, -233, -206, -233,
- -204, -233, -201, -230, -233, -71, -220, -233, -233, -85,
- -233, -220, -233, -233, -233, -209, -190, -233, -208, -233,
- -54, -62, -61, -233, -233, -233, -217, -218, -233, -124,
- -233, -55, -219, -233, -233, -28, -233, -120, -119, -35,
- -34, -168, -166, -233, -169, -160, -167, -161, -73, -233,
- -123, -116, -233, -152, -218, -214, -233, -233, -222, -137,
- -139, -138, -133, -140, -144, -141, -146, -151, -148, -145,
- -134, -150, -147, -143, -135, -233, -128, -136, -233, -154,
- -233, -158, -177, -233, -180, -233, -199, -233, -233, -200,
- -45, -69, -87, -46, -88, -219, -89, -94, -48, -233,
- -211, -210, -212, -233, -184, -58, -60, -97, -98, -63,
- -102, -99, -100, -101, -64, -96, -47, -233, -232, -29,
- -121, -233, -163, -219, -115, -215, -227, -226, -223, -128,
- -127, -233, -233, -155, -153, -233, -233, -179, -205, -203,
- -202, -67, -233, -182, -183, -52, -165, -218, -233, -233,
- -126, -129, -233, -159, -233, -181, -164, -162, -233, -131,
- -233, -157, -130, -156 ]
+ -197, -234, -234, -50, -234, -8, -9, -234, -234, -22,
+ -10, -188, -189, -11, -186, -12, -234, -234, -13, -1,
+ -14, -2, -234, -187, -15, -3, -234, -16, -5, -234,
+ -234, -17, -6, -234, -18, -7, -197, -189, -187, -234,
+ -51, -26, -27, -234, -24, -25, -234, -234, -234, -85,
+ -92, -197, -234, -196, -194, -197, -190, -192, -193, -222,
+ -195, -4, -197, -234, -85, -197, -53, -232, -42, -175,
+ -43, -214, -117, -33, -234, -234, -44, -31, -74, -32,
+ -234, -36, -234, -122, -37, -234, -73, -38, -172, -72,
+ -39, -40, -174, -41, -234, -103, -111, -234, -132, -112,
+ -234, -104, -234, -108, -110, -105, -234, -114, -106, -113,
+ -109, -234, -125, -107, -234, -234, -49, -176, -177, -179,
+ -234, -234, -198, -199, -83, -19, -22, -187, -21, -23,
+ -82, -84, -234, -75, -86, -81, -70, -74, -76, -220,
+ -79, -68, -77, -73, -234, -171, -170, -80, -78, -90,
+ -91, -93, -234, -220, -197, 385, -234, -234, -234, -208,
+ -234, -57, -214, -197, -59, -234, -66, -65, -56, -73,
+ -95, -234, -220, -234, -234, -92, -234, -30, -234, -118,
+ -234, -234, -234, -234, -234, -142, -234, -149, -234, -217,
+ -230, -226, -234, -229, -225, -234, -234, -234, -234, -234,
+ -234, -234, -234, -234, -234, -234, -234, -234, -234, -234,
+ -234, -234, -234, -234, -234, -234, -20, -234, -207, -234,
+ -205, -234, -202, -231, -234, -71, -221, -234, -234, -85,
+ -234, -221, -234, -234, -234, -210, -191, -234, -209, -234,
+ -54, -62, -61, -234, -234, -234, -218, -219, -234, -124,
+ -234, -55, -220, -234, -234, -28, -234, -120, -119, -35,
+ -34, -173, -168, -166, -234, -169, -160, -167, -161, -73,
+ -234, -123, -116, -234, -152, -219, -215, -234, -234, -223,
+ -137, -139, -138, -133, -140, -144, -141, -146, -151, -148,
+ -145, -134, -150, -147, -143, -135, -234, -128, -136, -234,
+ -154, -234, -158, -178, -234, -181, -234, -200, -234, -234,
+ -201, -45, -69, -87, -46, -88, -220, -89, -94, -48,
+ -234, -212, -211, -213, -234, -185, -58, -60, -97, -98,
+ -63, -102, -99, -100, -101, -64, -96, -47, -234, -233,
+ -29, -121, -234, -163, -220, -115, -216, -228, -227, -224,
+ -128, -127, -234, -234, -155, -153, -234, -234, -180, -206,
+ -204, -203, -67, -234, -183, -184, -52, -165, -219, -234,
+ -234, -126, -129, -234, -159, -234, -182, -164, -162, -234,
+ -131, -234, -157, -130, -156 ]
racc_goto_table = [
- 22, 9, 68, 112, 53, 118, 61, 36, 91, 222,
- 19, 267, 70, 93, 2, 227, 139, 191, 51, 22,
- 9, 179, 77, 56, 73, 149, 21, 141, 133, 232,
- 115, 172, 153, 2, 146, 263, 125, 116, 135, 148,
- 147, 299, 129, 22, 126, 260, 160, 350, 250, 174,
- 128, 171, 43, 68, 121, 329, 334, 298, 368, 91,
- 258, 265, 123, 70, 93, 317, 343, 301, 136, 154,
- 183, 119, 224, 178, 233, 73, 55, 123, 157, 66,
- 238, 159, 120, 219, 221, 190, 325, 321, 195, 16,
- 188, nil, nil, nil, nil, nil, nil, nil, 342, nil,
- 370, nil, nil, nil, nil, nil, nil, nil, nil, nil,
- nil, nil, nil, 216, nil, nil, nil, nil, 260, 129,
- 22, 126, 263, nil, nil, 353, nil, 128, 337, nil,
- nil, nil, nil, nil, nil, nil, nil, nil, nil, 81,
- nil, nil, nil, 53, nil, 53, nil, 243, nil, nil,
- 149, 301, nil, nil, nil, nil, nil, 252, nil, nil,
- 68, 261, 236, 68, nil, 138, 91, 146, nil, 91,
- 70, 93, nil, 70, 93, nil, nil, nil, 166, nil,
- 235, 166, 259, 272, nil, 73, nil, 302, 347, nil,
- 81, 361, nil, 261, 290, 360, 315, 376, 294, 146,
- nil, 312, 340, 311, 133, nil, 149, nil, 373, nil,
- 146, nil, 22, 9, 135, 148, 147, 22, 9, 369,
- nil, 263, 295, 327, 327, nil, 2, 303, nil, 146,
- 146, 2, nil, 68, 333, 333, nil, 22, 9, 91,
- 320, 88, nil, 70, 93, nil, nil, 323, 261, nil,
- nil, 2, nil, nil, 146, 259, 190, nil, nil, nil,
- nil, nil, nil, nil, nil, nil, nil, 88, nil, nil,
- nil, nil, nil, nil, nil, 87, nil, 261, nil, 166,
- nil, nil, 61, 146, nil, nil, nil, nil, nil, nil,
- 61, nil, 88, nil, nil, 22, 9, 81, 262, nil,
- 81, 142, nil, 22, 9, nil, nil, nil, nil, 2,
- 61, nil, nil, nil, nil, nil, nil, 2, nil, 22,
- 9, nil, nil, 22, 9, nil, 87, nil, 371, 362,
- 262, nil, nil, 2, 261, nil, nil, 2, nil, nil,
- 146, 138, nil, nil, nil, nil, nil, 261, nil, 61,
- nil, nil, nil, 146, nil, 166, nil, nil, nil, nil,
- 328, 328, 22, 9, 114, 61, nil, 61, nil, 84,
- 81, nil, 22, 9, 22, 9, 2, 90, 22, 9,
- 22, 9, 378, 132, 380, 262, 2, nil, 2, nil,
- nil, nil, 2, nil, 2, 140, nil, nil, 170, 88,
- 88, nil, 88, 145, nil, nil, nil, nil, 167, nil,
- nil, 167, nil, nil, 262, nil, nil, 170, nil, nil,
- 84, nil, nil, nil, nil, nil, nil, nil, 90, nil,
- nil, nil, 88, 87, 266, nil, 87, 170, nil, nil,
- nil, nil, nil, 88, nil, nil, nil, nil, nil, nil,
- nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
- nil, nil, 88, 88, nil, nil, 266, nil, nil, nil,
- nil, 262, 88, nil, nil, nil, nil, 142, nil, nil,
- nil, nil, nil, nil, 262, nil, nil, 88, nil, nil,
- nil, nil, nil, nil, nil, nil, 331, 331, nil, nil,
- nil, nil, nil, nil, nil, nil, 87, nil, nil, 167,
- nil, 253, nil, nil, nil, nil, 88, nil, nil, nil,
- nil, 266, nil, nil, nil, nil, nil, 84, 264, nil,
- 84, nil, nil, nil, 282, 90, 145, nil, 90, nil,
- nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
- 266, nil, nil, nil, nil, nil, nil, nil, nil, nil,
- 264, nil, nil, 314, nil, 316, nil, 124, 145, nil,
- nil, 140, nil, 88, 130, 131, nil, nil, nil, 145,
- nil, nil, nil, 335, nil, 167, 88, nil, nil, nil,
- 330, 330, nil, nil, nil, nil, nil, nil, 332, 332,
- 84, nil, nil, 180, nil, nil, nil, 266, 90, nil,
- nil, 346, nil, nil, nil, 264, nil, nil, nil, nil,
- 266, nil, 185, 145, nil, 186, nil, nil, 187, nil,
- nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
- 358, nil, 359, nil, 264, nil, nil, nil, nil, nil,
- nil, nil, 145, nil, nil, nil, nil, nil, nil, nil,
+ 22, 9, 68, 112, 222, 264, 61, 36, 53, 179,
+ 268, 141, 70, 19, 2, 77, 191, 118, 51, 22,
+ 9, 139, 116, 21, 73, 91, 56, 147, 133, 149,
+ 115, 227, 153, 2, 300, 128, 172, 302, 135, 160,
+ 125, 129, 174, 22, 126, 232, 351, 43, 171, 299,
+ 260, 146, 369, 68, 121, 330, 335, 258, 266, 123,
+ 318, 344, 136, 70, 250, 119, 178, 183, 224, 154,
+ 233, 55, 157, 66, 123, 73, 91, 120, 159, 238,
+ 219, 221, 326, 322, 195, 190, 16, 188, nil, nil,
+ nil, nil, nil, 264, nil, nil, nil, nil, 343, 371,
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
- nil, nil, nil, nil, nil, nil, 366, nil, nil, nil,
+ nil, nil, 128, nil, nil, 88, nil, 216, 129, 354,
+ 22, 126, 302, 260, nil, nil, nil, nil, nil, nil,
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
+ 243, 88, nil, nil, 338, nil, nil, 53, nil, 53,
+ nil, nil, nil, nil, 149, nil, nil, 252, nil, nil,
+ 68, 262, nil, 68, nil, 236, 88, nil, nil, nil,
+ 70, nil, nil, 70, nil, nil, 273, 235, nil, 374,
+ nil, nil, 259, 91, 146, 73, 91, 312, 348, nil,
+ 341, 361, 264, 262, 87, nil, 261, 377, 291, 303,
+ nil, 316, 295, 147, 133, 313, nil, nil, 362, nil,
+ 149, nil, 22, 9, 135, nil, 146, 22, 9, nil,
+ 142, nil, nil, 328, 328, 296, 2, 146, 261, nil,
+ 304, 2, nil, 68, nil, nil, 370, 22, 9, nil,
+ 321, nil, nil, 70, nil, 87, 146, 146, nil, 262,
+ 324, 2, nil, nil, nil, 259, 91, 190, 261, 261,
+ nil, 81, nil, nil, nil, nil, nil, nil, nil, nil,
+ nil, nil, 146, 88, 88, nil, 88, nil, 262, nil,
+ nil, nil, nil, 61, 261, nil, nil, 138, 84, nil,
+ nil, 61, nil, nil, nil, nil, 22, 9, nil, nil,
+ 166, 146, nil, 166, 22, 9, 88, nil, nil, nil,
+ 2, 61, 81, 261, 140, nil, nil, 88, 2, nil,
+ 22, 9, nil, nil, 22, 9, nil, 167, nil, 372,
+ 167, nil, nil, 363, 2, 262, 88, 88, 2, 84,
+ nil, 90, nil, nil, nil, nil, 88, nil, 262, nil,
+ 61, nil, 87, 267, nil, 87, nil, nil, 146, nil,
+ nil, nil, 88, 22, 9, nil, 61, 145, 61, nil,
+ 261, 146, nil, 22, 9, 22, 9, 2, 114, 22,
+ 9, 22, 9, 261, 93, 267, 379, 2, 381, 2,
+ nil, 88, 90, 2, nil, 2, 142, 132, nil, nil,
+ nil, 166, nil, nil, nil, nil, nil, nil, nil, nil,
+ 148, nil, 170, nil, nil, 332, 332, nil, nil, 81,
+ 263, nil, 81, nil, nil, 87, nil, nil, 167, nil,
+ nil, 170, nil, nil, nil, 93, nil, nil, nil, nil,
+ nil, 267, nil, nil, nil, nil, 84, 265, 88, 84,
+ nil, 170, 263, nil, nil, nil, nil, nil, nil, nil,
+ nil, 88, nil, 138, nil, nil, nil, nil, nil, nil,
+ 267, nil, nil, nil, nil, nil, nil, 166, 124, 265,
+ nil, nil, 329, 329, nil, 130, 131, nil, nil, nil,
+ 140, nil, 81, nil, nil, nil, nil, nil, nil, 90,
+ 145, nil, 90, nil, 167, nil, nil, nil, 263, 331,
+ 331, nil, nil, nil, 180, nil, nil, nil, nil, 84,
+ nil, nil, nil, nil, nil, 253, nil, 267, nil, nil,
+ nil, nil, 145, 185, nil, 265, 186, 263, nil, 187,
+ 267, nil, 93, 145, nil, 93, nil, nil, 283, nil,
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
- nil, 264, nil, nil, nil, nil, nil, nil, nil, 145,
- nil, nil, nil, nil, 264, nil, nil, nil, nil, nil,
- nil, nil, 145, nil, 279, 280, 281, nil, 283, 284,
- 285, 286, 287, 288, 289, nil, 291, 292, 293, nil,
- nil, 297, nil, nil, nil, nil, nil, nil, nil, nil,
+ nil, nil, 333, 333, 265, nil, nil, nil, nil, nil,
+ nil, nil, 90, nil, nil, nil, nil, 315, nil, 317,
+ nil, nil, nil, nil, nil, nil, 148, nil, 145, nil,
+ nil, nil, nil, nil, 263, nil, nil, 336, nil, nil,
+ nil, nil, nil, nil, nil, 334, 334, 263, nil, nil,
+ nil, nil, nil, nil, nil, 93, nil, 145, nil, nil,
+ nil, 265, nil, nil, nil, nil, 347, nil, nil, nil,
+ nil, nil, nil, nil, 265, 280, 281, 282, nil, 284,
+ 285, 286, 287, 288, 289, 290, nil, 292, 293, 294,
+ nil, nil, 298, nil, nil, 359, nil, 360, 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, nil, 180 ]
+ nil, nil, nil, nil, 145, nil, nil, nil, nil, nil,
+ nil, nil, nil, nil, nil, nil, nil, 145, nil, nil,
+ nil, 367, nil, nil, nil, 180 ]
racc_goto_check = [
- 37, 21, 30, 62, 64, 72, 4, 32, 28, 82,
- 2, 70, 31, 29, 52, 36, 35, 85, 32, 37,
- 21, 60, 22, 78, 21, 53, 3, 47, 30, 36,
- 37, 35, 38, 52, 28, 68, 19, 5, 31, 29,
- 50, 66, 7, 37, 21, 23, 41, 63, 36, 41,
- 5, 57, 20, 30, 74, 46, 46, 65, 58, 28,
- 61, 69, 3, 31, 29, 56, 71, 68, 33, 74,
- 57, 73, 34, 22, 75, 21, 76, 3, 77, 40,
- 79, 3, 20, 80, 81, 30, 42, 83, 84, 1,
- 57, nil, nil, nil, nil, nil, nil, nil, 70, nil,
- 63, nil, nil, nil, nil, nil, nil, nil, nil, nil,
- nil, nil, nil, 19, nil, nil, nil, nil, 23, 7,
- 37, 21, 68, nil, nil, 66, nil, 5, 36, nil,
- nil, nil, nil, nil, nil, nil, nil, nil, nil, 24,
- nil, nil, nil, 64, nil, 64, nil, 41, nil, nil,
- 53, 68, nil, nil, nil, nil, nil, 38, nil, nil,
- 30, 30, 78, 30, nil, 24, 28, 28, nil, 28,
- 31, 29, nil, 31, 29, nil, nil, nil, 24, nil,
- 3, 24, 21, 22, nil, 21, nil, 72, 85, nil,
- 24, 36, nil, 30, 64, 82, 35, 70, 64, 28,
- nil, 53, 60, 47, 30, nil, 53, nil, 68, nil,
- 28, nil, 37, 21, 31, 29, 50, 37, 21, 36,
- nil, 68, 2, 30, 30, nil, 52, 2, nil, 28,
- 28, 52, nil, 30, 29, 29, nil, 37, 21, 28,
- 32, 49, nil, 31, 29, nil, nil, 2, 30, nil,
- nil, 52, nil, nil, 28, 21, 30, nil, nil, nil,
- nil, nil, nil, nil, nil, nil, nil, 49, nil, nil,
- nil, nil, nil, nil, nil, 26, nil, 30, nil, 24,
- nil, nil, 4, 28, nil, nil, nil, nil, nil, nil,
- 4, nil, 49, nil, nil, 37, 21, 24, 24, nil,
- 24, 26, nil, 37, 21, nil, nil, nil, nil, 52,
- 4, nil, nil, nil, nil, nil, nil, 52, nil, 37,
- 21, nil, nil, 37, 21, nil, 26, nil, 62, 2,
- 24, nil, nil, 52, 30, nil, nil, 52, nil, nil,
- 28, 24, nil, nil, nil, nil, nil, 30, nil, 4,
- nil, nil, nil, 28, nil, 24, nil, nil, nil, nil,
- 24, 24, 37, 21, 54, 4, nil, 4, nil, 25,
- 24, nil, 37, 21, 37, 21, 52, 27, 37, 21,
- 37, 21, 2, 54, 2, 24, 52, nil, 52, nil,
- nil, nil, 52, nil, 52, 25, nil, nil, 54, 49,
- 49, nil, 49, 27, nil, nil, nil, nil, 25, nil,
- nil, 25, nil, nil, 24, nil, nil, 54, nil, nil,
- 25, nil, nil, nil, nil, nil, nil, nil, 27, nil,
- nil, nil, 49, 26, 26, nil, 26, 54, nil, nil,
- nil, nil, nil, 49, nil, nil, nil, nil, nil, nil,
- nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
- nil, nil, 49, 49, nil, nil, 26, nil, nil, nil,
- nil, 24, 49, nil, nil, nil, nil, 26, nil, nil,
- nil, nil, nil, nil, 24, nil, nil, 49, nil, nil,
- nil, nil, nil, nil, nil, nil, 26, 26, nil, nil,
- nil, nil, nil, nil, nil, nil, 26, nil, nil, 25,
- nil, 54, nil, nil, nil, nil, 49, nil, nil, nil,
- nil, 26, nil, nil, nil, nil, nil, 25, 25, nil,
- 25, nil, nil, nil, 54, 27, 27, nil, 27, nil,
- nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
- 26, nil, nil, nil, nil, nil, nil, nil, nil, nil,
- 25, nil, nil, 54, nil, 54, nil, 51, 27, nil,
- nil, 25, nil, 49, 51, 51, nil, nil, nil, 27,
- nil, nil, nil, 54, nil, 25, 49, nil, nil, nil,
- 25, 25, nil, nil, nil, nil, nil, nil, 27, 27,
- 25, nil, nil, 51, nil, nil, nil, 26, 27, nil,
- nil, 54, nil, nil, nil, 25, nil, nil, nil, nil,
- 26, nil, 51, 27, nil, 51, nil, nil, 51, nil,
- nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
- 54, nil, 54, nil, 25, nil, nil, nil, nil, nil,
- nil, nil, 27, nil, nil, nil, nil, nil, nil, nil,
+ 37, 21, 30, 62, 82, 68, 4, 32, 64, 60,
+ 70, 47, 31, 2, 52, 22, 85, 72, 32, 37,
+ 21, 35, 5, 3, 21, 28, 78, 50, 30, 53,
+ 37, 36, 38, 52, 66, 5, 35, 68, 31, 41,
+ 19, 7, 41, 37, 21, 36, 63, 20, 57, 65,
+ 23, 28, 58, 30, 74, 46, 46, 61, 69, 3,
+ 56, 71, 33, 31, 36, 73, 22, 57, 34, 74,
+ 75, 76, 77, 40, 3, 21, 28, 20, 3, 79,
+ 80, 81, 42, 83, 84, 30, 1, 57, nil, nil,
+ nil, nil, nil, 68, nil, nil, nil, nil, 70, 63,
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
- nil, nil, nil, nil, nil, nil, 54, nil, nil, nil,
+ nil, nil, 5, nil, nil, 49, nil, 19, 7, 66,
+ 37, 21, 68, 23, nil, nil, nil, nil, nil, nil,
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
+ 41, 49, nil, nil, 36, nil, nil, 64, nil, 64,
+ nil, nil, nil, nil, 53, nil, nil, 38, nil, nil,
+ 30, 30, nil, 30, nil, 78, 49, nil, nil, nil,
+ 31, nil, nil, 31, nil, nil, 22, 3, nil, 68,
+ nil, nil, 21, 28, 28, 21, 28, 47, 85, nil,
+ 60, 82, 68, 30, 26, nil, 52, 70, 64, 72,
+ nil, 35, 64, 50, 30, 53, nil, nil, 36, nil,
+ 53, nil, 37, 21, 31, nil, 28, 37, 21, nil,
+ 26, nil, nil, 30, 30, 2, 52, 28, 52, nil,
+ 2, 52, nil, 30, nil, nil, 36, 37, 21, nil,
+ 32, nil, nil, 31, nil, 26, 28, 28, nil, 30,
+ 2, 52, nil, nil, nil, 21, 28, 30, 52, 52,
+ nil, 24, nil, nil, nil, nil, nil, nil, nil, nil,
+ nil, nil, 28, 49, 49, nil, 49, nil, 30, nil,
+ nil, nil, nil, 4, 52, nil, nil, 24, 25, nil,
+ nil, 4, nil, nil, nil, nil, 37, 21, nil, nil,
+ 24, 28, nil, 24, 37, 21, 49, nil, nil, nil,
+ 52, 4, 24, 52, 25, nil, nil, 49, 52, nil,
+ 37, 21, nil, nil, 37, 21, nil, 25, nil, 62,
+ 25, nil, nil, 2, 52, 30, 49, 49, 52, 25,
+ nil, 27, nil, nil, nil, nil, 49, nil, 30, nil,
+ 4, nil, 26, 26, nil, 26, nil, nil, 28, nil,
+ nil, nil, 49, 37, 21, nil, 4, 27, 4, nil,
+ 52, 28, nil, 37, 21, 37, 21, 52, 54, 37,
+ 21, 37, 21, 52, 29, 26, 2, 52, 2, 52,
+ nil, 49, 27, 52, nil, 52, 26, 54, nil, nil,
+ nil, 24, nil, nil, nil, nil, nil, nil, nil, nil,
+ 29, nil, 54, nil, nil, 26, 26, nil, nil, 24,
+ 24, nil, 24, nil, nil, 26, nil, nil, 25, nil,
+ nil, 54, nil, nil, nil, 29, nil, nil, nil, nil,
+ nil, 26, nil, nil, nil, nil, 25, 25, 49, 25,
+ nil, 54, 24, nil, nil, nil, nil, nil, nil, nil,
+ nil, 49, nil, 24, nil, nil, nil, nil, nil, nil,
+ 26, nil, nil, nil, nil, nil, nil, 24, 51, 25,
+ nil, nil, 24, 24, nil, 51, 51, nil, nil, nil,
+ 25, nil, 24, nil, nil, nil, nil, nil, nil, 27,
+ 27, nil, 27, nil, 25, nil, nil, nil, 24, 25,
+ 25, nil, nil, nil, 51, nil, nil, nil, nil, 25,
+ nil, nil, nil, nil, nil, 54, nil, 26, nil, nil,
+ nil, nil, 27, 51, nil, 25, 51, 24, nil, 51,
+ 26, nil, 29, 27, nil, 29, nil, nil, 54, nil,
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
- nil, 25, nil, nil, nil, nil, nil, nil, nil, 27,
- nil, nil, nil, nil, 25, nil, nil, nil, nil, nil,
- nil, nil, 27, nil, 51, 51, 51, nil, 51, 51,
- 51, 51, 51, 51, 51, nil, 51, 51, 51, nil,
- nil, 51, nil, nil, nil, nil, nil, nil, nil, nil,
+ nil, nil, 27, 27, 25, nil, nil, nil, nil, nil,
+ nil, nil, 27, nil, nil, nil, nil, 54, nil, 54,
+ nil, nil, nil, nil, nil, nil, 29, nil, 27, nil,
+ nil, nil, nil, nil, 24, nil, nil, 54, nil, nil,
+ nil, nil, nil, nil, nil, 29, 29, 24, nil, nil,
+ nil, nil, nil, nil, nil, 29, nil, 27, nil, nil,
+ nil, 25, nil, nil, nil, nil, 54, nil, nil, nil,
+ nil, nil, nil, nil, 25, 51, 51, 51, nil, 51,
+ 51, 51, 51, 51, 51, 51, nil, 51, 51, 51,
+ nil, nil, 51, nil, nil, 54, nil, 54, 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, nil, 51 ]
+ nil, nil, nil, nil, 27, nil, nil, nil, nil, nil,
+ nil, nil, nil, nil, nil, nil, nil, 27, nil, nil,
+ nil, 54, nil, nil, nil, 51 ]
racc_goto_pointer = [
- nil, 89, 10, 26, -13, 7, nil, -1, nil, nil,
- nil, nil, nil, nil, nil, nil, nil, nil, nil, -7,
- 48, 1, -1, -136, 116, 346, 252, 354, -15, -10,
- -21, -11, 6, 19, -64, -33, -124, 0, -18, nil,
- 57, -16, -153, nil, nil, nil, -189, -22, nil, 218,
- -9, 528, 14, -25, 335, nil, -166, -12, -285, nil,
- -54, -120, -23, -249, -13, -157, -173, nil, -147, -121,
- -171, -203, -28, 38, 18, -80, 59, 23, 6, -78,
- -39, -38, -113, -147, -18, -89, nil ]
+ nil, 86, 13, 23, -13, -8, nil, -2, nil, nil,
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, -3,
+ 43, 1, -8, -131, 238, 265, 171, 318, 2, 361,
+ -21, -11, 6, 13, -68, -28, -108, 0, -18, nil,
+ 51, -23, -157, nil, nil, nil, -189, -38, nil, 92,
+ -22, 439, 14, -21, 349, nil, -171, -15, -292, nil,
+ -66, -123, -23, -251, -9, -165, -180, nil, -177, -124,
+ -172, -209, -16, 32, 18, -84, 54, 17, 9, -79,
+ -42, -41, -118, -151, -22, -90, nil ]
racc_goto_default = [
nil, nil, nil, 168, 25, 28, 32, 35, 5, 6,
@@ -916,1687 +661,2028 @@ racc_goto_default = [
95, 96, 8, nil, nil, nil, nil, 85, nil, 30,
nil, nil, 161, 239, 164, 165, nil, nil, 144, 107,
110, 111, 67, 134, 98, 150, 151, nil, 248, 104,
- nil, nil, nil, nil, 69, nil, nil, 300, 80, nil,
+ nil, nil, nil, nil, 69, nil, nil, 301, 80, nil,
nil, nil, nil, nil, nil, nil, nil, nil, nil, 57,
nil, nil, nil, nil, nil, nil, 192 ]
-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_1,
+ 1, 70, :_reduce_none,
+ 1, 71, :_reduce_none,
+ 2, 71, :_reduce_4,
+ 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, 87, :_reduce_19,
+ 3, 87, :_reduce_20,
+ 1, 88, :_reduce_none,
+ 1, 88, :_reduce_none,
+ 1, 88, :_reduce_none,
+ 1, 89, :_reduce_none,
+ 1, 89, :_reduce_none,
+ 1, 89, :_reduce_none,
+ 1, 89, :_reduce_none,
+ 4, 81, :_reduce_28,
+ 5, 81, :_reduce_29,
+ 3, 81, :_reduce_30,
+ 2, 81, :_reduce_31,
+ 1, 91, :_reduce_none,
+ 1, 91, :_reduce_none,
+ 3, 91, :_reduce_34,
+ 3, 91, :_reduce_35,
+ 1, 92, :_reduce_none,
+ 1, 92, :_reduce_none,
+ 1, 92, :_reduce_none,
+ 1, 92, :_reduce_none,
+ 1, 92, :_reduce_none,
+ 1, 92, :_reduce_none,
+ 1, 92, :_reduce_none,
+ 1, 92, :_reduce_none,
+ 1, 92, :_reduce_44,
+ 5, 74, :_reduce_45,
+ 5, 74, :_reduce_46,
+ 5, 74, :_reduce_47,
+ 5, 85, :_reduce_48,
+ 2, 75, :_reduce_49,
+ 1, 108, :_reduce_50,
+ 2, 108, :_reduce_51,
+ 6, 76, :_reduce_52,
+ 2, 76, :_reduce_53,
+ 3, 109, :_reduce_54,
+ 3, 109, :_reduce_55,
+ 1, 110, :_reduce_none,
+ 1, 110, :_reduce_none,
+ 3, 110, :_reduce_58,
+ 1, 111, :_reduce_none,
+ 3, 111, :_reduce_60,
+ 1, 112, :_reduce_61,
+ 1, 112, :_reduce_62,
+ 3, 113, :_reduce_63,
+ 3, 113, :_reduce_64,
+ 1, 114, :_reduce_none,
+ 1, 114, :_reduce_none,
+ 4, 116, :_reduce_67,
+ 1, 102, :_reduce_none,
+ 3, 102, :_reduce_69,
+ 0, 103, :_reduce_none,
+ 1, 103, :_reduce_none,
+ 1, 118, :_reduce_72,
+ 1, 93, :_reduce_73,
+ 1, 95, :_reduce_74,
+ 1, 117, :_reduce_none,
+ 1, 117, :_reduce_none,
+ 1, 117, :_reduce_none,
+ 1, 117, :_reduce_none,
+ 1, 117, :_reduce_none,
+ 1, 117, :_reduce_none,
+ 1, 117, :_reduce_none,
+ 3, 77, :_reduce_82,
+ 3, 77, :_reduce_83,
+ 3, 86, :_reduce_84,
+ 0, 104, :_reduce_85,
+ 1, 104, :_reduce_86,
+ 3, 104, :_reduce_87,
+ 3, 122, :_reduce_88,
+ 3, 124, :_reduce_89,
+ 1, 125, :_reduce_none,
+ 1, 125, :_reduce_none,
+ 0, 107, :_reduce_92,
+ 1, 107, :_reduce_93,
+ 3, 107, :_reduce_94,
+ 1, 126, :_reduce_none,
+ 3, 126, :_reduce_96,
+ 1, 115, :_reduce_none,
+ 1, 115, :_reduce_none,
+ 1, 115, :_reduce_none,
+ 1, 115, :_reduce_none,
+ 1, 115, :_reduce_none,
+ 1, 115, :_reduce_none,
+ 1, 123, :_reduce_none,
+ 1, 123, :_reduce_none,
+ 1, 123, :_reduce_none,
+ 1, 123, :_reduce_none,
+ 1, 123, :_reduce_none,
+ 1, 123, :_reduce_none,
+ 1, 123, :_reduce_none,
+ 1, 123, :_reduce_none,
+ 1, 123, :_reduce_none,
+ 1, 123, :_reduce_none,
+ 1, 123, :_reduce_none,
+ 1, 123, :_reduce_none,
+ 4, 97, :_reduce_115,
+ 3, 97, :_reduce_116,
+ 1, 99, :_reduce_117,
+ 2, 99, :_reduce_118,
+ 2, 129, :_reduce_119,
+ 1, 130, :_reduce_120,
+ 2, 130, :_reduce_121,
+ 1, 96, :_reduce_122,
+ 4, 90, :_reduce_123,
+ 4, 90, :_reduce_124,
+ 2, 79, :_reduce_125,
+ 5, 131, :_reduce_126,
+ 4, 131, :_reduce_127,
+ 0, 132, :_reduce_none,
+ 2, 132, :_reduce_129,
+ 4, 132, :_reduce_130,
+ 3, 132, :_reduce_131,
+ 1, 120, :_reduce_none,
+ 3, 120, :_reduce_133,
+ 3, 120, :_reduce_134,
+ 3, 120, :_reduce_135,
+ 3, 120, :_reduce_136,
+ 3, 120, :_reduce_137,
+ 3, 120, :_reduce_138,
+ 3, 120, :_reduce_139,
+ 3, 120, :_reduce_140,
+ 3, 120, :_reduce_141,
+ 2, 120, :_reduce_142,
+ 3, 120, :_reduce_143,
+ 3, 120, :_reduce_144,
+ 3, 120, :_reduce_145,
+ 3, 120, :_reduce_146,
+ 3, 120, :_reduce_147,
+ 3, 120, :_reduce_148,
+ 2, 120, :_reduce_149,
+ 3, 120, :_reduce_150,
+ 3, 120, :_reduce_151,
+ 3, 120, :_reduce_152,
+ 5, 78, :_reduce_153,
+ 1, 134, :_reduce_none,
+ 2, 134, :_reduce_155,
+ 5, 135, :_reduce_156,
+ 4, 135, :_reduce_157,
+ 1, 136, :_reduce_none,
+ 3, 136, :_reduce_159,
+ 3, 98, :_reduce_160,
+ 1, 138, :_reduce_none,
+ 4, 138, :_reduce_162,
+ 1, 140, :_reduce_none,
+ 3, 140, :_reduce_164,
+ 3, 139, :_reduce_165,
+ 1, 137, :_reduce_none,
+ 1, 137, :_reduce_none,
+ 1, 137, :_reduce_none,
+ 1, 137, :_reduce_none,
+ 1, 137, :_reduce_none,
+ 1, 137, :_reduce_none,
+ 1, 137, :_reduce_none,
+ 1, 137, :_reduce_none,
+ 1, 137, :_reduce_174,
+ 1, 137, :_reduce_none,
+ 1, 141, :_reduce_176,
+ 1, 142, :_reduce_none,
+ 3, 142, :_reduce_178,
+ 2, 80, :_reduce_179,
+ 6, 82, :_reduce_180,
+ 5, 82, :_reduce_181,
+ 7, 83, :_reduce_182,
+ 6, 83, :_reduce_183,
+ 6, 84, :_reduce_184,
+ 5, 84, :_reduce_185,
+ 1, 106, :_reduce_186,
+ 1, 101, :_reduce_187,
+ 1, 101, :_reduce_188,
+ 1, 101, :_reduce_189,
+ 1, 145, :_reduce_none,
+ 3, 145, :_reduce_191,
+ 1, 147, :_reduce_192,
+ 1, 148, :_reduce_193,
+ 1, 148, :_reduce_194,
+ 1, 148, :_reduce_195,
+ 1, 148, :_reduce_none,
+ 0, 72, :_reduce_197,
+ 0, 149, :_reduce_198,
+ 1, 143, :_reduce_none,
+ 3, 143, :_reduce_200,
+ 3, 143, :_reduce_201,
+ 1, 150, :_reduce_none,
+ 3, 150, :_reduce_203,
+ 3, 151, :_reduce_204,
+ 1, 151, :_reduce_205,
+ 3, 151, :_reduce_206,
+ 1, 151, :_reduce_207,
+ 1, 146, :_reduce_none,
+ 2, 146, :_reduce_209,
+ 1, 144, :_reduce_none,
+ 2, 144, :_reduce_211,
+ 1, 152, :_reduce_none,
+ 1, 152, :_reduce_none,
+ 1, 94, :_reduce_214,
+ 3, 119, :_reduce_215,
+ 4, 119, :_reduce_216,
+ 2, 119, :_reduce_217,
+ 1, 127, :_reduce_none,
+ 1, 127, :_reduce_none,
+ 0, 105, :_reduce_none,
+ 1, 105, :_reduce_221,
+ 1, 133, :_reduce_222,
+ 3, 128, :_reduce_223,
+ 4, 128, :_reduce_224,
+ 2, 128, :_reduce_225,
+ 1, 153, :_reduce_none,
+ 3, 153, :_reduce_227,
+ 3, 154, :_reduce_228,
+ 1, 155, :_reduce_229,
+ 1, 155, :_reduce_230,
+ 4, 121, :_reduce_231,
+ 1, 100, :_reduce_none,
+ 4, 100, :_reduce_233 ]
+
+racc_reduce_n = 234
+
+racc_shift_n = 385
-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',
-'nil',
-'statement',
-'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",
+ "nil",
+ "statement",
+ "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 #####
-
- # reduce 0 omitted
-
-module_eval <<'.,.,', 'grammar.ra', 46
- def _reduce_1( val, _values, result )
- if val[0]
- # Make sure we always return an array.
- if val[0].is_a?(AST::ASTArray)
- if val[0].children.empty?
- result = nil
- else
- result = val[0]
- end
- else
- result = aryfy(val[0])
- end
- else
+##### State transition tables end #####
+
+# reduce 0 omitted
+
+module_eval(<<'.,.,', 'grammar.ra', 31)
+ def _reduce_1(val, _values, result)
+ if val[0]
+ # Make sure we always return an array.
+ if val[0].is_a?(AST::ASTArray)
+ if val[0].children.empty?
result = nil
+ else
+ result = val[0]
+ end
+ else
+ result = aryfy(val[0])
end
- result
+ else
+ result = nil
+ end
+
+ result
end
.,.,
- # reduce 2 omitted
+# reduce 2 omitted
- # reduce 3 omitted
+# reduce 3 omitted
-module_eval <<'.,.,', 'grammar.ra', 62
- def _reduce_4( val, _values, result )
- if val[0] and val[1]
- if val[0].instance_of?(AST::ASTArray)
- val[0].push(val[1])
- result = val[0]
- else
- result = ast AST::ASTArray, :children => [val[0],val[1]]
- end
- elsif obj = (val[0] || val[1])
- result = obj
- else result = nil
+module_eval(<<'.,.,', 'grammar.ra', 50)
+ def _reduce_4(val, _values, result)
+ if val[0] and val[1]
+ if val[0].instance_of?(AST::ASTArray)
+ val[0].push(val[1])
+ result = val[0]
+ else
+ result = ast AST::ASTArray, :children => [val[0],val[1]]
end
- result
+ elsif obj = (val[0] || val[1])
+ result = obj
+ else result = nil
+ end
+
+ result
end
.,.,
- # reduce 5 omitted
+# reduce 5 omitted
+
+# 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
+module_eval(<<'.,.,', 'grammar.ra', 80)
+ def _reduce_19(val, _values, result)
+ result = AST::Relationship.new(val[0], val[2], val[1][:value], ast_context)
-module_eval <<'.,.,', 'grammar.ra', 82
- def _reduce_19( val, _values, result )
- result = AST::Relationship.new(val[0], val[2], val[1][:value], ast_context)
- result
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 85
- def _reduce_20( val, _values, result )
- result = AST::Relationship.new(val[0], val[2], val[1][:value], ast_context)
- result
+module_eval(<<'.,.,', 'grammar.ra', 83)
+ def _reduce_20(val, _values, result)
+ result = AST::Relationship.new(val[0], val[2], val[1][:value], ast_context)
+
+ result
end
.,.,
- # reduce 21 omitted
+# reduce 21 omitted
- # 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
-module_eval <<'.,.,', 'grammar.ra', 98
- def _reduce_28( val, _values, result )
- args = aryfy(val[2])
- result = ast AST::Function,
- :name => val[0][:value],
- :line => val[0][:line],
- :arguments => args,
- :ftype => :statement
- result
+module_eval(<<'.,.,', 'grammar.ra', 91)
+ def _reduce_28(val, _values, result)
+ args = aryfy(val[2])
+ result = ast AST::Function,
+ :name => val[0][:value],
+ :line => val[0][:line],
+ :arguments => args,
+ :ftype => :statement
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 106
- def _reduce_29( val, _values, result )
- args = aryfy(val[2])
- result = ast AST::Function,
- :name => val[0][:value],
- :line => val[0][:line],
- :arguments => args,
- :ftype => :statement
- result
+module_eval(<<'.,.,', 'grammar.ra', 99)
+ def _reduce_29(val, _values, result)
+ args = aryfy(val[2])
+ result = ast AST::Function,
+ :name => val[0][:value],
+ :line => val[0][:line],
+ :arguments => args,
+ :ftype => :statement
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 112
- def _reduce_30( val, _values, result )
- result = ast AST::Function,
- :name => val[0][:value],
- :line => val[0][:line],
- :arguments => AST::ASTArray.new({}),
- :ftype => :statement
- result
+module_eval(<<'.,.,', 'grammar.ra', 106)
+ def _reduce_30(val, _values, result)
+ result = ast AST::Function,
+ :name => val[0][:value],
+ :line => val[0][:line],
+ :arguments => AST::ASTArray.new({}),
+ :ftype => :statement
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 120
- def _reduce_31( val, _values, result )
- args = aryfy(val[1])
+module_eval(<<'.,.,', 'grammar.ra', 113)
+ def _reduce_31(val, _values, result)
+ args = aryfy(val[1])
result = ast AST::Function,
- :name => val[0][:value],
- :line => val[0][:line],
- :arguments => args,
- :ftype => :statement
- result
+ :name => val[0][:value],
+ :line => val[0][:line],
+ :arguments => args,
+ :ftype => :statement
+
+ result
end
.,.,
- # reduce 32 omitted
+# reduce 32 omitted
- # reduce 33 omitted
+# reduce 33 omitted
-module_eval <<'.,.,', 'grammar.ra', 128
- def _reduce_34( val, _values, result )
- result = aryfy(val[0], val[2])
+module_eval(<<'.,.,', 'grammar.ra', 124)
+ def _reduce_34(val, _values, result)
+ result = aryfy(val[0], val[2])
result.line = @lexer.line
result.file = @lexer.file
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 137
- def _reduce_35( val, _values, result )
- unless val[0].is_a?(AST::ASTArray)
- val[0] = aryfy(val[0])
- end
+module_eval(<<'.,.,', 'grammar.ra', 129)
+ def _reduce_35(val, _values, result)
+ unless val[0].is_a?(AST::ASTArray)
+ val[0] = aryfy(val[0])
+ end
- val[0].push(val[2])
+ val[0].push(val[2])
- result = val[0]
- result
+ result = val[0]
+
+ result
end
.,.,
- # reduce 36 omitted
+# reduce 36 omitted
- # 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
-module_eval <<'.,.,', 'grammar.ra', 151
- def _reduce_44( val, _values, result )
- result = ast AST::Name, :value => val[0][:value]
- result
+module_eval(<<'.,.,', 'grammar.ra', 149)
+ def _reduce_44(val, _values, result)
+ result = ast AST::Name, :value => val[0][:value]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 173
- def _reduce_45( val, _values, result )
- @lexer.commentpop
- array = val[2]
- if array.instance_of?(AST::ResourceInstance)
- array = [array]
- end
- result = ast AST::ASTArray
+module_eval(<<'.,.,', 'grammar.ra', 153)
+ def _reduce_45(val, _values, result)
+ @lexer.commentpop
+ array = val[2]
+ array = [array] if array.instance_of?(AST::ResourceInstance)
+ result = ast AST::ASTArray
+
+ # this iterates across each specified resourceinstance
+ array.each { |instance|
+ raise Puppet::Dev, "Got something that isn't an instance" unless instance.instance_of?(AST::ResourceInstance)
+ # now, i need to somehow differentiate between those things with
+ # arrays in their names, and normal things
- # this iterates across each specified resourceinstance
- array.each { |instance|
- unless instance.instance_of?(AST::ResourceInstance)
- raise Puppet::Dev, "Got something that isn't an instance"
- end
- # now, i need to somehow differentiate between those things with
- # arrays in their names, and normal things
- result.push ast(AST::Resource,
- :type => val[0],
- :title => instance[0],
- :parameters => instance[1])
- }
- result
+ result.push ast(
+ AST::Resource,
+ :type => val[0],
+ :title => instance[0],
+
+ :parameters => instance[1])
+ }
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 176
- def _reduce_46( val, _values, result )
- # This is a deprecated syntax.
- error "All resource specifications require names"
- result
+module_eval(<<'.,.,', 'grammar.ra', 172)
+ def _reduce_46(val, _values, result)
+ # This is a deprecated syntax.
+ error "All resource specifications require names"
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 180
- def _reduce_47( val, _values, result )
- # a defaults setting for a type
- @lexer.commentpop
- result = ast(AST::ResourceDefaults, :type => val[0], :parameters => val[2])
- result
+module_eval(<<'.,.,', 'grammar.ra', 175)
+ def _reduce_47(val, _values, result)
+ # a defaults setting for a type
+ @lexer.commentpop
+ result = ast(AST::ResourceDefaults, :type => val[0], :parameters => val[2])
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 186
- def _reduce_48( val, _values, result )
- @lexer.commentpop
- result = ast AST::ResourceOverride, :object => val[0], :parameters => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 182)
+ def _reduce_48(val, _values, result)
+ @lexer.commentpop
+ result = ast AST::ResourceOverride, :object => val[0], :parameters => val[2]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 213
- def _reduce_49( val, _values, result )
- type = val[0]
+module_eval(<<'.,.,', 'grammar.ra', 189)
+ def _reduce_49(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")
- end
+ if (type == :exported and ! Puppet[:storeconfigs]) and ! Puppet[:parseonly]
+ Puppet.warning addcontext("You cannot collect without storeconfigs being set")
+ end
- if val[1].is_a? AST::ResourceDefaults
- error "Defaults are not virtualizable"
- end
+ error "Defaults are not virtualizable" if val[1].is_a? AST::ResourceDefaults
- method = type.to_s + "="
+ method = type.to_s + "="
- # Just mark our resources as exported and pass them through.
- if val[1].instance_of?(AST::ASTArray)
- val[1].each do |obj|
- obj.send(method, true)
- end
- else
- val[1].send(method, true)
+ # Just mark our resources as exported and pass them through.
+ if val[1].instance_of?(AST::ASTArray)
+ val[1].each do |obj|
+ obj.send(method, true)
end
+ else
+ val[1].send(method, true)
+ end
- result = val[1]
- result
+ result = val[1]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 214
- def _reduce_50( val, _values, result )
- result = :virtual
- result
+module_eval(<<'.,.,', 'grammar.ra', 211)
+ def _reduce_50(val, _values, result)
+ result = :virtual
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 215
- def _reduce_51( val, _values, result )
- result = :exported
- result
+module_eval(<<'.,.,', 'grammar.ra', 212)
+ def _reduce_51(val, _values, result)
+ result = :exported
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 240
- def _reduce_52( val, _values, result )
- @lexer.commentpop
- if val[0] =~ /^[a-z]/
- Puppet.warning addcontext("Collection names must now be capitalized")
- end
- type = val[0].downcase
- args = {:type => type}
+module_eval(<<'.,.,', 'grammar.ra', 217)
+ def _reduce_52(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}
- if val[1].is_a?(AST::CollExpr)
- args[:query] = val[1]
- args[:query].type = type
- args[:form] = args[:query].form
- else
- args[:form] = val[1]
- end
- if args[:form] == :exported and ! Puppet[:storeconfigs] and ! Puppet[:parseonly]
- Puppet.warning addcontext("You cannot collect exported resources without storeconfigs being set; the collection will be ignored")
- end
- args[:override] = val[3]
- result = ast AST::Collection, args
- result
+ if val[1].is_a?(AST::CollExpr)
+ args[:query] = val[1]
+ args[:query].type = type
+ args[:form] = args[:query].form
+ else
+ args[:form] = val[1]
+ end
+ if args[:form] == :exported and ! Puppet[:storeconfigs] and ! Puppet[:parseonly]
+ Puppet.warning addcontext("You cannot collect exported resources without storeconfigs being set; the collection will be ignored")
+ end
+ args[:override] = val[3]
+ result = ast AST::Collection, args
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 259
- def _reduce_53( val, _values, result )
- if val[0] =~ /^[a-z]/
- Puppet.warning addcontext("Collection names must now be capitalized")
- end
- type = val[0].downcase
- args = {:type => type }
+module_eval(<<'.,.,', 'grammar.ra', 236)
+ def _reduce_53(val, _values, result)
+ if val[0] =~ /^[a-z]/
+ Puppet.warning addcontext("Collection names must now be capitalized")
+ end
+ type = val[0].downcase
+ args = {:type => type }
- if val[1].is_a?(AST::CollExpr)
- args[:query] = val[1]
- args[:query].type = type
- args[:form] = args[:query].form
- else
- args[:form] = val[1]
- end
- if args[:form] == :exported and ! Puppet[:storeconfigs] and ! Puppet[:parseonly]
- Puppet.warning addcontext("You cannot collect exported resources without storeconfigs being set; the collection will be ignored")
- end
- result = ast AST::Collection, args
- result
+ if val[1].is_a?(AST::CollExpr)
+ args[:query] = val[1]
+ args[:query].type = type
+ args[:form] = args[:query].form
+ else
+ args[:form] = val[1]
+ end
+ if args[:form] == :exported and ! Puppet[:storeconfigs] and ! Puppet[:parseonly]
+ Puppet.warning addcontext("You cannot collect exported resources without storeconfigs being set; the collection will be ignored")
+ end
+ result = ast AST::Collection, args
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 269
- def _reduce_54( val, _values, result )
- if val[1]
- result = val[1]
- result.form = :virtual
- else
- result = :virtual
- end
- result
+module_eval(<<'.,.,', 'grammar.ra', 257)
+ def _reduce_54(val, _values, result)
+ if val[1]
+ result = val[1]
+ result.form = :virtual
+ else
+ result = :virtual
+ end
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 277
- def _reduce_55( val, _values, result )
- if val[1]
- result = val[1]
- result.form = :exported
- else
- result = :exported
- end
- result
+module_eval(<<'.,.,', 'grammar.ra', 265)
+ def _reduce_55(val, _values, result)
+ if val[1]
+ result = val[1]
+ result.form = :exported
+ else
+ result = :exported
+ end
+
+ result
end
.,.,
- # reduce 56 omitted
+# reduce 56 omitted
- # reduce 57 omitted
+# reduce 57 omitted
-module_eval <<'.,.,', 'grammar.ra', 285
- def _reduce_58( val, _values, result )
- result = ast AST::CollExpr, :test1 => val[0], :oper => val[1], :test2 => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 278)
+ def _reduce_58(val, _values, result)
+ result = ast AST::CollExpr, :test1 => val[0], :oper => val[1], :test2 => val[2]
+
+ result
end
.,.,
- # reduce 59 omitted
+# reduce 59 omitted
-module_eval <<'.,.,', 'grammar.ra', 291
- def _reduce_60( val, _values, result )
- result = val[1]
+module_eval(<<'.,.,', 'grammar.ra', 283)
+ def _reduce_60(val, _values, result)
+ result = val[1]
result.parens = true
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 292
- def _reduce_61( val, _values, result )
- result=val[0][:value]
- result
+module_eval(<<'.,.,', 'grammar.ra', 287)
+ def _reduce_61(val, _values, result)
+ result=val[0][:value]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 293
- def _reduce_62( val, _values, result )
- result=val[0][:value]
- result
+module_eval(<<'.,.,', 'grammar.ra', 288)
+ def _reduce_62(val, _values, result)
+ result=val[0][:value]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 300
- def _reduce_63( 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
+module_eval(<<'.,.,', 'grammar.ra', 291)
+ def _reduce_63(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
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 305
- def _reduce_64( val, _values, result )
- result = ast AST::CollExpr, :test1 => val[0], :oper => val[1][:value], :test2 => val[2]
+module_eval(<<'.,.,', 'grammar.ra', 296)
+ 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
.,.,
- # reduce 65 omitted
+# reduce 65 omitted
- # reduce 66 omitted
+# reduce 66 omitted
-module_eval <<'.,.,', 'grammar.ra', 312
- def _reduce_67( val, _values, result )
- result = ast AST::ResourceInstance, :children => [val[0],val[2]]
- result
+module_eval(<<'.,.,', 'grammar.ra', 305)
+ def _reduce_67(val, _values, result)
+ result = ast AST::ResourceInstance, :children => [val[0],val[2]]
+
+ result
end
.,.,
- # reduce 68 omitted
+# reduce 68 omitted
-module_eval <<'.,.,', 'grammar.ra', 322
- def _reduce_69( val, _values, result )
- if val[0].instance_of?(AST::ResourceInstance)
- result = ast AST::ASTArray, :children => [val[0],val[2]]
- else
- val[0].push val[2]
- result = val[0]
- end
- result
+module_eval(<<'.,.,', 'grammar.ra', 310)
+ def _reduce_69(val, _values, result)
+ if val[0].instance_of?(AST::ResourceInstance)
+ result = ast AST::ASTArray, :children => [val[0],val[2]]
+ else
+ val[0].push val[2]
+ result = val[0]
+ end
+
+ result
end
.,.,
- # reduce 70 omitted
+# reduce 70 omitted
+
+# reduce 71 omitted
- # reduce 71 omitted
+module_eval(<<'.,.,', 'grammar.ra', 322)
+ def _reduce_72(val, _values, result)
+ result = ast AST::Undef, :value => :undef
-module_eval <<'.,.,', 'grammar.ra', 329
- def _reduce_72( val, _values, result )
- result = ast AST::Undef, :value => :undef
- result
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 333
- def _reduce_73( val, _values, result )
- result = ast AST::Name, :value => val[0][:value], :line => val[0][:line]
- result
+module_eval(<<'.,.,', 'grammar.ra', 326)
+ def _reduce_73(val, _values, result)
+ result = ast AST::Name, :value => val[0][:value], :line => val[0][:line]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 337
- def _reduce_74( val, _values, result )
- result = ast AST::Type, :value => val[0][:value], :line => val[0][:line]
- result
+module_eval(<<'.,.,', 'grammar.ra', 330)
+ def _reduce_74(val, _values, result)
+ result = ast AST::Type, :value => val[0][:value], :line => val[0][:line]
+
+ result
end
.,.,
- # reduce 75 omitted
+# reduce 75 omitted
- # 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
-module_eval <<'.,.,', 'grammar.ra', 354
- def _reduce_82( val, _values, result )
- if val[0][:value] =~ /::/
- raise Puppet::ParseError, "Cannot assign to variables in other namespaces"
- end
- # 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
+module_eval(<<'.,.,', 'grammar.ra', 342)
+ def _reduce_82(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
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 357
- def _reduce_83( val, _values, result )
- result = ast AST::VarDef, :name => val[0], :value => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 348)
+ def _reduce_83(val, _values, result)
+ result = ast AST::VarDef, :name => val[0], :value => val[2]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 362
- def _reduce_84( 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
+module_eval(<<'.,.,', 'grammar.ra', 352)
+ def _reduce_84(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
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 367
- def _reduce_85( val, _values, result )
- result = ast AST::ASTArray
- result
+module_eval(<<'.,.,', 'grammar.ra', 358)
+ def _reduce_85(val, _values, result)
+ result = ast AST::ASTArray
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 367
- def _reduce_86( val, _values, result )
- result = val[0]
- result
+module_eval(<<'.,.,', 'grammar.ra', 360)
+ def _reduce_86(val, _values, result)
+ result = val[0]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 376
- def _reduce_87( 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
+module_eval(<<'.,.,', 'grammar.ra', 362)
+ def _reduce_87(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
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 380
- def _reduce_88( val, _values, result )
- result = ast AST::ResourceParam, :param => val[0][:value], :line => val[0][:line], :value => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 371)
+ def _reduce_88(val, _values, result)
+ result = ast AST::ResourceParam, :param => val[0][:value], :line => val[0][:line], :value => val[2]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 385
- def _reduce_89( val, _values, result )
- result = ast AST::ResourceParam, :param => val[0][:value], :line => val[0][:line], :value => val[2],
- :add => true
- result
+module_eval(<<'.,.,', 'grammar.ra', 375)
+ def _reduce_89(val, _values, result)
+ result = ast AST::ResourceParam, :param => val[0][:value], :line => val[0][:line], :value => val[2],
+ :add => true
+
+ result
end
.,.,
- # reduce 90 omitted
+# reduce 90 omitted
+
+# reduce 91 omitted
- # reduce 91 omitted
+module_eval(<<'.,.,', 'grammar.ra', 384)
+ def _reduce_92(val, _values, result)
+ result = ast AST::ASTArray
-module_eval <<'.,.,', 'grammar.ra', 393
- def _reduce_92( val, _values, result )
- result = ast AST::ASTArray
- result
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 393
- def _reduce_93( val, _values, result )
- result = val[0]
- result
+module_eval(<<'.,.,', 'grammar.ra', 386)
+ def _reduce_93(val, _values, result)
+ result = val[0]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 402
- def _reduce_94( 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
+module_eval(<<'.,.,', 'grammar.ra', 388)
+ def _reduce_94(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
end
.,.,
- # reduce 95 omitted
+# reduce 95 omitted
-module_eval <<'.,.,', 'grammar.ra', 411
- def _reduce_96( val, _values, result )
- if val[0].instance_of?(AST::ASTArray)
- result = val[0].push(val[2])
- else
- result = ast AST::ASTArray, :children => [val[0],val[2]]
- end
- result
+module_eval(<<'.,.,', 'grammar.ra', 398)
+ def _reduce_96(val, _values, result)
+ if val[0].instance_of?(AST::ASTArray)
+ result = val[0].push(val[2])
+ else
+ result = ast AST::ASTArray, :children => [val[0],val[2]]
+ end
+
+ result
end
.,.,
- # reduce 97 omitted
+# reduce 97 omitted
- # 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
-module_eval <<'.,.,', 'grammar.ra', 440
- def _reduce_115( val, _values, result )
- args = aryfy(val[2])
- result = ast AST::Function,
- :name => val[0][:value], :line => val[0][:line],
- :arguments => args,
- :ftype => :rvalue
- result
+module_eval(<<'.,.,', 'grammar.ra', 427)
+ def _reduce_115(val, _values, result)
+ args = aryfy(val[2])
+ result = ast AST::Function,
+ :name => val[0][:value], :line => val[0][:line],
+ :arguments => args,
+ :ftype => :rvalue
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 445
- def _reduce_116( val, _values, result )
- result = ast AST::Function,
- :name => val[0][:value], :line => val[0][:line],
- :arguments => AST::ASTArray.new({}),
- :ftype => :rvalue
- result
+module_eval(<<'.,.,', 'grammar.ra', 433)
+ def _reduce_116(val, _values, result)
+ result = ast AST::Function,
+ :name => val[0][:value], :line => val[0][:line],
+ :arguments => AST::ASTArray.new({}),
+ :ftype => :rvalue
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 446
- def _reduce_117( val, _values, result )
- result = ast AST::String, :value => val[0][:value], :line => val[0][:line]
- result
+module_eval(<<'.,.,', 'grammar.ra', 439)
+ def _reduce_117(val, _values, result)
+ result = ast AST::String, :value => val[0][:value], :line => val[0][:line]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 447
- def _reduce_118( val, _values, result )
- result = ast AST::Concat, :value => [ast(AST::String,val[0])]+val[1], :line => val[0][:line]
- result
+module_eval(<<'.,.,', 'grammar.ra', 440)
+ def _reduce_118(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', 449
- def _reduce_119( val, _values, result )
- result = [val[0]] + val[1]
- result
+module_eval(<<'.,.,', 'grammar.ra', 442)
+ def _reduce_119(val, _values, result)
+ result = [val[0]] + val[1]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 451
- def _reduce_120( val, _values, result )
- result = [ast(AST::String,val[0])]
- result
+module_eval(<<'.,.,', 'grammar.ra', 444)
+ def _reduce_120(val, _values, result)
+ result = [ast(AST::String,val[0])]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 452
- def _reduce_121( val, _values, result )
- result = [ast(AST::String,val[0])] + val[1]
- result
+module_eval(<<'.,.,', 'grammar.ra', 445)
+ def _reduce_121(val, _values, result)
+ result = [ast(AST::String,val[0])] + val[1]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 457
- def _reduce_122( val, _values, result )
- result = ast AST::Boolean, :value => val[0][:value], :line => val[0][:line]
- result
+module_eval(<<'.,.,', 'grammar.ra', 448)
+ def _reduce_122(val, _values, result)
+ result = ast AST::Boolean, :value => val[0][:value], :line => val[0][:line]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 462
- def _reduce_123( 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
+module_eval(<<'.,.,', 'grammar.ra', 452)
+ def _reduce_123(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
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 464
- def _reduce_124( val, _values, result )
- result = ast AST::ResourceReference, :type => val[0], :title => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 455)
+ def _reduce_124(val, _values, result)
+ result = ast AST::ResourceReference, :type => val[0], :title => val[2]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 468
- def _reduce_125( val, _values, result )
- result = val[1]
- result
+module_eval(<<'.,.,', 'grammar.ra', 459)
+ def _reduce_125(val, _values, result)
+ result = val[1]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 482
- def _reduce_126( val, _values, result )
- @lexer.commentpop
- args = {
- :test => val[0],
- :statements => val[2]
- }
+module_eval(<<'.,.,', 'grammar.ra', 463)
+ def _reduce_126(val, _values, result)
+ @lexer.commentpop
+ args = {
+ :test => val[0],
+ :statements => val[2]
+ }
- if val[4]
- args[:else] = val[4]
- end
+ args[:else] = val[4] if val[4]
+
+ result = ast AST::IfStatement, args
- result = ast AST::IfStatement, args
- result
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 495
- def _reduce_127( val, _values, result )
- @lexer.commentpop
+module_eval(<<'.,.,', 'grammar.ra', 474)
+ def _reduce_127(val, _values, result)
+ @lexer.commentpop
args = {
- :test => val[0],
- :statements => ast(AST::Nop)
- }
+ :test => val[0],
+ :statements => ast(AST::Nop)
+ }
- if val[3]
- args[:else] = val[3]
- end
+ args[:else] = val[3] if val[3]
+
+ result = ast AST::IfStatement, args
- result = ast AST::IfStatement, args
- result
+ result
end
.,.,
- # reduce 128 omitted
+# reduce 128 omitted
+
+module_eval(<<'.,.,', 'grammar.ra', 487)
+ def _reduce_129(val, _values, result)
+ result = ast AST::Else, :statements => val[1]
-module_eval <<'.,.,', 'grammar.ra', 501
- def _reduce_129( val, _values, result )
- #@lexer.commentpop
- result = ast AST::Else, :statements => val[1]
- result
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 505
- def _reduce_130( val, _values, result )
- @lexer.commentpop
+module_eval(<<'.,.,', 'grammar.ra', 490)
+ def _reduce_130(val, _values, result)
+ @lexer.commentpop
result = ast AST::Else, :statements => val[2]
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 509
- def _reduce_131( val, _values, result )
- @lexer.commentpop
+module_eval(<<'.,.,', 'grammar.ra', 494)
+ def _reduce_131(val, _values, result)
+ @lexer.commentpop
result = ast AST::Else, :statements => ast(AST::Nop)
- result
+
+ result
end
.,.,
- # reduce 132 omitted
+# reduce 132 omitted
-module_eval <<'.,.,', 'grammar.ra', 526
- def _reduce_133( val, _values, result )
- result = ast AST::InOperator, :lval => val[0], :rval => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 512)
+ def _reduce_133(val, _values, result)
+ result = ast AST::InOperator, :lval => val[0], :rval => val[2]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 529
- def _reduce_134( val, _values, result )
- result = ast AST::MatchOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 515)
+ def _reduce_134(val, _values, result)
+ result = ast AST::MatchOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 532
- 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', 518)
+ 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', 535
- def _reduce_136( val, _values, result )
- result = ast AST::ArithmeticOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 521)
+ def _reduce_136(val, _values, result)
+ result = ast AST::ArithmeticOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 538
- 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', 524)
+ 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', 541
- 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', 527)
+ 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', 544
- 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', 530)
+ 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', 547
- 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', 533)
+ 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', 550
- 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', 536)
+ 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', 553
- def _reduce_142( val, _values, result )
- result = ast AST::Minus, :value => val[1]
- result
+module_eval(<<'.,.,', 'grammar.ra', 539)
+ def _reduce_142(val, _values, result)
+ result = ast AST::Minus, :value => val[1]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 556
- def _reduce_143( val, _values, result )
- result = ast AST::ComparisonOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 542)
+ def _reduce_143(val, _values, result)
+ result = ast AST::ComparisonOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 559
- 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', 545)
+ 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', 562
- 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', 548)
+ 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', 565
- 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', 551)
+ 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', 568
- 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', 554)
+ 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', 571
- 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', 557)
+ 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', 574
- def _reduce_149( val, _values, result )
- result = ast AST::Not, :value => val[1]
- result
+module_eval(<<'.,.,', 'grammar.ra', 560)
+ def _reduce_149(val, _values, result)
+ result = ast AST::Not, :value => val[1]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 577
- def _reduce_150( val, _values, result )
- result = ast AST::BooleanOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 563)
+ def _reduce_150(val, _values, result)
+ result = ast AST::BooleanOperator, :operator => val[1][:value], :lval => val[0], :rval => val[2]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 580
- 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', 566)
+ 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', 583
- def _reduce_152( val, _values, result )
- result = val[1]
- result
+module_eval(<<'.,.,', 'grammar.ra', 569)
+ def _reduce_152(val, _values, result)
+ result = val[1]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 592
- def _reduce_153( val, _values, result )
- @lexer.commentpop
- options = val[3]
- unless options.instance_of?(AST::ASTArray)
- options = ast AST::ASTArray, :children => [val[3]]
- end
- result = ast AST::CaseStatement, :test => val[1], :options => options
- result
+module_eval(<<'.,.,', 'grammar.ra', 573)
+ def _reduce_153(val, _values, result)
+ @lexer.commentpop
+ options = val[3]
+ options = ast AST::ASTArray, :children => [val[3]] unless options.instance_of?(AST::ASTArray)
+ result = ast AST::CaseStatement, :test => val[1], :options => options
+
+ result
end
.,.,
- # reduce 154 omitted
+# reduce 154 omitted
-module_eval <<'.,.,', 'grammar.ra', 602
- def _reduce_155( val, _values, result )
- if val[0].instance_of?(AST::ASTArray)
- val[0].push val[1]
- result = val[0]
- else
- result = ast AST::ASTArray, :children => [val[0], val[1]]
- end
- result
+module_eval(<<'.,.,', 'grammar.ra', 581)
+ def _reduce_155(val, _values, result)
+ if val[0].instance_of?(AST::ASTArray)
+ val[0].push val[1]
+ result = val[0]
+ else
+ result = ast AST::ASTArray, :children => [val[0], val[1]]
+ end
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 607
- def _reduce_156( val, _values, result )
- @lexer.commentpop
- result = ast AST::CaseOpt, :value => val[0], :statements => val[3]
- result
+module_eval(<<'.,.,', 'grammar.ra', 590)
+ def _reduce_156(val, _values, result)
+ @lexer.commentpop
+ result = ast AST::CaseOpt, :value => val[0], :statements => val[3]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 613
- def _reduce_157( val, _values, result )
- @lexer.commentpop
- result = ast(AST::CaseOpt,
- :value => val[0],
- :statements => ast(AST::ASTArray)
- )
- result
+module_eval(<<'.,.,', 'grammar.ra', 593)
+ def _reduce_157(val, _values, result)
+ @lexer.commentpop
+
+ result = ast(
+ AST::CaseOpt,
+ :value => val[0],
+
+ :statements => ast(AST::ASTArray)
+ )
+
+ result
end
.,.,
- # reduce 158 omitted
+# reduce 158 omitted
-module_eval <<'.,.,', 'grammar.ra', 623
- def _reduce_159( 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
+module_eval(<<'.,.,', 'grammar.ra', 605)
+ def _reduce_159(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
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 627
- def _reduce_160( val, _values, result )
- result = ast AST::Selector, :param => val[0], :values => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 614)
+ def _reduce_160(val, _values, result)
+ result = ast AST::Selector, :param => val[0], :values => val[2]
+
+ result
end
.,.,
- # reduce 161 omitted
+# reduce 161 omitted
-module_eval <<'.,.,', 'grammar.ra', 633
- def _reduce_162( val, _values, result )
- @lexer.commentpop
+module_eval(<<'.,.,', 'grammar.ra', 619)
+ def _reduce_162(val, _values, result)
+ @lexer.commentpop
result = val[1]
- result
+
+ result
end
.,.,
- # reduce 163 omitted
+# reduce 163 omitted
-module_eval <<'.,.,', 'grammar.ra', 643
- def _reduce_164( 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
+module_eval(<<'.,.,', 'grammar.ra', 625)
+ def _reduce_164(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
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 647
- def _reduce_165( val, _values, result )
- result = ast AST::ResourceParam, :param => val[0], :value => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 634)
+ def _reduce_165(val, _values, result)
+ result = ast AST::ResourceParam, :param => val[0], :value => val[2]
+
+ result
end
.,.,
- # reduce 166 omitted
+# reduce 166 omitted
+
+# 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
-module_eval <<'.,.,', 'grammar.ra', 658
- def _reduce_173( val, _values, result )
- result = ast AST::Default, :value => val[0][:value], :line => val[0][:line]
- result
+module_eval(<<'.,.,', 'grammar.ra', 646)
+ def _reduce_174(val, _values, result)
+ result = ast AST::Default, :value => val[0][:value], :line => val[0][:line]
+
+ result
end
.,.,
- # reduce 174 omitted
+# reduce 175 omitted
-module_eval <<'.,.,', 'grammar.ra', 661
- def _reduce_175( val, _values, result )
- result = [val[0][:value]]
- result
+module_eval(<<'.,.,', 'grammar.ra', 651)
+ def _reduce_176(val, _values, result)
+ result = [val[0][:value]]
+ result
end
.,.,
- # reduce 176 omitted
+# reduce 177 omitted
-module_eval <<'.,.,', 'grammar.ra', 663
- def _reduce_177( val, _values, result )
- result = val[0] += val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 653)
+ def _reduce_178(val, _values, result)
+ result = val[0] += val[2]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 672
- def _reduce_178( val, _values, result )
- val[1].each do |file|
- import(file)
- end
+module_eval(<<'.,.,', 'grammar.ra', 656)
+ def _reduce_179(val, _values, result)
+ val[1].each do |file|
+ import(file)
+ end
+
+ result = AST::ASTArray.new(:children => [])
- result = AST::ASTArray.new(:children => [])
- result
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 683
- def _reduce_179( val, _values, result )
- @lexer.commentpop
- newdefine classname(val[1]), :arguments => val[2], :code => val[4], :line => val[0][:line]
- @lexer.indefine = false
- result = nil
+module_eval(<<'.,.,', 'grammar.ra', 666)
+ def _reduce_180(val, _values, result)
+ @lexer.commentpop
+ newdefine classname(val[1]), :arguments => val[2], :code => val[4], :line => val[0][:line]
+ @lexer.indefine = false
+ result = nil
#} | DEFINE NAME argumentlist parent LBRACE RBRACE {
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 688
- def _reduce_180( val, _values, result )
- @lexer.commentpop
- newdefine classname(val[1]), :arguments => val[2], :line => val[0][:line]
- @lexer.indefine = false
- result = nil
- result
+module_eval(<<'.,.,', 'grammar.ra', 673)
+ def _reduce_181(val, _values, result)
+ @lexer.commentpop
+ newdefine classname(val[1]), :arguments => val[2], :line => val[0][:line]
+ @lexer.indefine = false
+ result = nil
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 697
- def _reduce_181( val, _values, result )
- @lexer.commentpop
- # Our class gets defined in the parent namespace, not our own.
- @lexer.namepop
- newclass classname(val[1]), :arguments => val[2], :parent => val[3], :code => val[5], :line => val[0][:line]
- result = nil
- result
+module_eval(<<'.,.,', 'grammar.ra', 681)
+ def _reduce_182(val, _values, result)
+ @lexer.commentpop
+ # Our class gets defined in the parent namespace, not our own.
+ @lexer.namepop
+ newclass classname(val[1]), :arguments => val[2], :parent => val[3], :code => val[5], :line => val[0][:line]
+ result = nil
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 703
- def _reduce_182( val, _values, result )
- @lexer.commentpop
- # Our class gets defined in the parent namespace, not our own.
- @lexer.namepop
- newclass classname(val[1]), :arguments => val[2], :parent => val[3], :line => val[0][:line]
- result = nil
- result
+module_eval(<<'.,.,', 'grammar.ra', 687)
+ def _reduce_183(val, _values, result)
+ @lexer.commentpop
+ # Our class gets defined in the parent namespace, not our own.
+ @lexer.namepop
+ newclass classname(val[1]), :arguments => val[2], :parent => val[3], :line => val[0][:line]
+ result = nil
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 709
- def _reduce_183( val, _values, result )
- @lexer.commentpop
- newnode val[1], :parent => val[2], :code => val[4], :line => val[0][:line]
- result = nil
- result
+module_eval(<<'.,.,', 'grammar.ra', 695)
+ def _reduce_184(val, _values, result)
+ @lexer.commentpop
+ newnode val[1], :parent => val[2], :code => val[4], :line => val[0][:line]
+ result = nil
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 713
- def _reduce_184( val, _values, result )
- @lexer.commentpop
- newnode val[1], :parent => val[2], :line => val[0][:line]
- result = nil
- result
+module_eval(<<'.,.,', 'grammar.ra', 699)
+ def _reduce_185(val, _values, result)
+ @lexer.commentpop
+ newnode val[1], :parent => val[2], :line => val[0][:line]
+ result = nil
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 714
- def _reduce_185( val, _values, result )
- result = val[0][:value]
- result
+module_eval(<<'.,.,', 'grammar.ra', 704)
+ def _reduce_186(val, _values, result)
+ result = val[0][:value]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 716
- def _reduce_186( val, _values, result )
- result = val[0][:value]
- result
+module_eval(<<'.,.,', 'grammar.ra', 706)
+ def _reduce_187(val, _values, result)
+ result = val[0][:value]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 717
- def _reduce_187( val, _values, result )
- result = val[0][:value]
- result
+module_eval(<<'.,.,', 'grammar.ra', 707)
+ def _reduce_188(val, _values, result)
+ result = val[0][:value]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 718
- def _reduce_188( val, _values, result )
- result = "class"
- result
+module_eval(<<'.,.,', 'grammar.ra', 708)
+ def _reduce_189(val, _values, result)
+ result = "class"
+ result
end
.,.,
- # reduce 189 omitted
+# reduce 190 omitted
-module_eval <<'.,.,', 'grammar.ra', 728
- def _reduce_190( val, _values, result )
- result = val[0]
+module_eval(<<'.,.,', 'grammar.ra', 714)
+ def _reduce_191(val, _values, result)
+ result = val[0]
result = [result] unless result.is_a?(Array)
result << val[2]
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 732
- def _reduce_191( val, _values, result )
- result = ast AST::HostName, :value => val[0]
- result
+module_eval(<<'.,.,', 'grammar.ra', 720)
+ def _reduce_192(val, _values, result)
+ result = ast AST::HostName, :value => val[0]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 733
- def _reduce_192( val, _values, result )
- result = val[0][:value]
- result
+module_eval(<<'.,.,', 'grammar.ra', 723)
+ def _reduce_193(val, _values, result)
+ result = val[0][:value]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 734
- def _reduce_193( val, _values, result )
- result = val[0][:value]
- result
+module_eval(<<'.,.,', 'grammar.ra', 724)
+ def _reduce_194(val, _values, result)
+ result = val[0][:value]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 735
- def _reduce_194( val, _values, result )
- result = val[0][:value]
- result
+module_eval(<<'.,.,', 'grammar.ra', 725)
+ def _reduce_195(val, _values, result)
+ result = val[0][:value]
+ result
end
.,.,
- # reduce 195 omitted
+# reduce 196 omitted
-module_eval <<'.,.,', 'grammar.ra', 741
- def _reduce_196( val, _values, result )
- result = nil
- result
+module_eval(<<'.,.,', 'grammar.ra', 729)
+ def _reduce_197(val, _values, result)
+ result = nil
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 745
- def _reduce_197( val, _values, result )
- result = ast AST::ASTArray, :children => []
- result
+module_eval(<<'.,.,', 'grammar.ra', 733)
+ def _reduce_198(val, _values, result)
+ result = ast AST::ASTArray, :children => []
+
+ result
end
.,.,
- # reduce 198 omitted
+# reduce 199 omitted
-module_eval <<'.,.,', 'grammar.ra', 750
- def _reduce_199( val, _values, result )
- result = nil
- result
+module_eval(<<'.,.,', 'grammar.ra', 738)
+ def _reduce_200(val, _values, result)
+ result = nil
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 754
- def _reduce_200( val, _values, result )
- result = val[1]
+module_eval(<<'.,.,', 'grammar.ra', 741)
+ def _reduce_201(val, _values, result)
+ result = val[1]
result = [result] unless result[0].is_a?(Array)
- result
+
+ result
end
.,.,
- # reduce 201 omitted
+# reduce 202 omitted
-module_eval <<'.,.,', 'grammar.ra', 761
- def _reduce_202( val, _values, result )
- result = val[0]
+module_eval(<<'.,.,', 'grammar.ra', 747)
+ def _reduce_203(val, _values, result)
+ result = val[0]
result = [result] unless result[0].is_a?(Array)
result << val[2]
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 766
- def _reduce_203( val, _values, result )
- Puppet.warning addcontext("Deprecation notice: must now include '$' in prototype")
- result = [val[0][:value], val[2]]
- result
+module_eval(<<'.,.,', 'grammar.ra', 753)
+ def _reduce_204(val, _values, result)
+ Puppet.warning addcontext("Deprecation notice: must now include '$' in prototype")
+ result = [val[0][:value], val[2]]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 770
- def _reduce_204( val, _values, result )
- Puppet.warning addcontext("Deprecation notice: must now include '$' in prototype")
+module_eval(<<'.,.,', 'grammar.ra', 757)
+ def _reduce_205(val, _values, result)
+ Puppet.warning addcontext("Deprecation notice: must now include '$' in prototype")
result = [val[0][:value]]
- result
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 772
- def _reduce_205( val, _values, result )
- result = [val[0][:value], val[2]]
- result
+module_eval(<<'.,.,', 'grammar.ra', 760)
+ def _reduce_206(val, _values, result)
+ result = [val[0][:value], val[2]]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 774
- def _reduce_206( val, _values, result )
- result = [val[0][:value]]
- result
+module_eval(<<'.,.,', 'grammar.ra', 762)
+ def _reduce_207(val, _values, result)
+ result = [val[0][:value]]
+
+ result
end
.,.,
- # reduce 207 omitted
+# reduce 208 omitted
-module_eval <<'.,.,', 'grammar.ra', 779
- def _reduce_208( val, _values, result )
- result = val[1]
- result
+module_eval(<<'.,.,', 'grammar.ra', 767)
+ def _reduce_209(val, _values, result)
+ result = val[1]
+
+ result
end
.,.,
- # reduce 209 omitted
+# reduce 210 omitted
-module_eval <<'.,.,', 'grammar.ra', 784
- def _reduce_210( val, _values, result )
- result = val[1]
- result
+module_eval(<<'.,.,', 'grammar.ra', 772)
+ def _reduce_211(val, _values, result)
+ result = val[1]
+
+ result
end
.,.,
- # reduce 211 omitted
+# reduce 212 omitted
- # reduce 212 omitted
+# reduce 213 omitted
-module_eval <<'.,.,', 'grammar.ra', 790
- def _reduce_213( val, _values, result )
- result = ast AST::Variable, :value => val[0][:value], :line => val[0][:line]
- result
+module_eval(<<'.,.,', 'grammar.ra', 778)
+ def _reduce_214(val, _values, result)
+ result = ast AST::Variable, :value => val[0][:value], :line => val[0][:line]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 798
- def _reduce_214( val, _values, result )
- if val[1].instance_of?(AST::ASTArray)
- result = val[1]
- else
- result = ast AST::ASTArray, :children => [val[1]]
- end
- result
+module_eval(<<'.,.,', 'grammar.ra', 782)
+ def _reduce_215(val, _values, result)
+ if val[1].instance_of?(AST::ASTArray)
+ result = val[1]
+ else
+ result = ast AST::ASTArray, :children => [val[1]]
+ end
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 805
- def _reduce_215( val, _values, result )
- if val[1].instance_of?(AST::ASTArray)
- result = val[1]
- else
- result = ast AST::ASTArray, :children => [val[1]]
- end
- result
+module_eval(<<'.,.,', 'grammar.ra', 789)
+ def _reduce_216(val, _values, result)
+ if val[1].instance_of?(AST::ASTArray)
+ result = val[1]
+ else
+ result = ast AST::ASTArray, :children => [val[1]]
+ end
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 807
- def _reduce_216( val, _values, result )
- result = ast AST::ASTArray
- result
+module_eval(<<'.,.,', 'grammar.ra', 795)
+ def _reduce_217(val, _values, result)
+ result = ast AST::ASTArray
+
+ result
end
.,.,
- # reduce 217 omitted
+# reduce 218 omitted
- # reduce 218 omitted
+# reduce 219 omitted
- # reduce 219 omitted
+# reduce 220 omitted
-module_eval <<'.,.,', 'grammar.ra', 812
- def _reduce_220( val, _values, result )
- result = nil
- result
+module_eval(<<'.,.,', 'grammar.ra', 802)
+ def _reduce_221(val, _values, result)
+ result = nil
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 817
- def _reduce_221( val, _values, result )
- result = ast AST::Regex, :value => val[0][:value]
- result
+module_eval(<<'.,.,', 'grammar.ra', 805)
+ def _reduce_222(val, _values, result)
+ result = ast AST::Regex, :value => val[0][:value]
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 825
- def _reduce_222( val, _values, result )
- if val[1].instance_of?(AST::ASTHash)
- result = val[1]
- else
- result = ast AST::ASTHash, { :value => val[1] }
- end
- result
+module_eval(<<'.,.,', 'grammar.ra', 809)
+ def _reduce_223(val, _values, result)
+ if val[1].instance_of?(AST::ASTHash)
+ result = val[1]
+ else
+ result = ast AST::ASTHash, { :value => val[1] }
end
-.,.,
-module_eval <<'.,.,', 'grammar.ra', 832
- def _reduce_223( 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', 834
- def _reduce_224( val, _values, result )
- result = ast AST::ASTHash
- result
+module_eval(<<'.,.,', 'grammar.ra', 816)
+ 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
end
.,.,
- # reduce 225 omitted
+module_eval(<<'.,.,', 'grammar.ra', 822)
+ def _reduce_225(val, _values, result)
+ result = ast AST::ASTHash
-module_eval <<'.,.,', 'grammar.ra', 844
- def _reduce_226( 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', 848
- def _reduce_227( val, _values, result )
- result = ast AST::ASTHash, { :value => { val[0] => val[2] } }
- result
+# reduce 226 omitted
+
+module_eval(<<'.,.,', 'grammar.ra', 827)
+ def _reduce_227(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
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 849
- def _reduce_228( val, _values, result )
- result = val[0][:value]
- result
+module_eval(<<'.,.,', 'grammar.ra', 836)
+ def _reduce_228(val, _values, result)
+ result = ast AST::ASTHash, { :value => { val[0] => val[2] } }
+
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 850
- def _reduce_229( val, _values, result )
- result = val[0]
- result
+module_eval(<<'.,.,', 'grammar.ra', 839)
+ def _reduce_229(val, _values, result)
+ result = val[0][:value]
+ result
end
.,.,
-module_eval <<'.,.,', 'grammar.ra', 855
- def _reduce_230( val, _values, result )
- result = ast AST::HashOrArrayAccess, :variable => val[0][:value], :key => val[2]
- result
+module_eval(<<'.,.,', 'grammar.ra', 840)
+ def _reduce_230(val, _values, result)
+ result = val[0]
+ result
end
.,.,
- # reduce 231 omitted
+module_eval(<<'.,.,', 'grammar.ra', 843)
+ def _reduce_231(val, _values, result)
+ result = ast AST::HashOrArrayAccess, :variable => val[0][:value], :key => val[2]
-module_eval <<'.,.,', 'grammar.ra', 860
- def _reduce_232( val, _values, result )
- result = ast AST::HashOrArrayAccess, :variable => val[0], :key => val[2]
- result
+ result
end
.,.,
- def _reduce_none( val, _values, result )
- result
- end
+# reduce 232 omitted
- end # class Parser
+module_eval(<<'.,.,', 'grammar.ra', 848)
+ def _reduce_233(val, _values, result)
+ result = ast AST::HashOrArrayAccess, :variable => val[0], :key => val[2]
- end # module Parser
+ result
+ end
+.,.,
+
+def _reduce_none(val, _values, result)
+ val[0]
+end
-end # module Puppet
+ end # class Parser
+ end # module Parser
+ end # module Puppet
diff --git a/lib/puppet/parser/parser_support.rb b/lib/puppet/parser/parser_support.rb
index 7bbebb124..7a0aa2601 100644
--- a/lib/puppet/parser/parser_support.rb
+++ b/lib/puppet/parser/parser_support.rb
@@ -135,19 +135,19 @@ class Puppet::Parser::Parser
# Create a new class, or merge with an existing class.
def newclass(name, options = {})
- known_resource_types.add Puppet::Resource::Type.new(:hostclass, name, ast_context(true).merge(options))
+ known_resource_types.add Puppet::Resource::Type.new(:hostclass, name, ast_context(true, options[:line]).merge(options))
end
# Create a new definition.
def newdefine(name, options = {})
- known_resource_types.add Puppet::Resource::Type.new(:definition, name, ast_context(true).merge(options))
+ known_resource_types.add Puppet::Resource::Type.new(:definition, name, ast_context(true, options[:line]).merge(options))
end
# Create a new node. Nodes are special, because they're stored in a global
# table, not according to namespaces.
def newnode(names, options = {})
names = [names] unless names.instance_of?(Array)
- context = ast_context(true)
+ context = ast_context(true, options[:line])
names.collect do |name|
known_resource_types.add(Puppet::Resource::Type.new(:node, name, context.merge(options)))
end
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 354ddb16d..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+/)[2] == 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/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/type.rb b/lib/puppet/type.rb
index f70a3ec0b..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?
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..5ed2b104c 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'
diff --git a/lib/puppet/type/file.rb b/lib/puppet/type/file.rb
index cbb51bbed..e1a4ecbb9 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 6aa173f6c..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.
@@ -201,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/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 da9a70bdf..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
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 1757931f8..6f04bddd8 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 408d6f5dd..471619c98 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
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 4aff0a8cb..7f74d266a 100644
--- a/lib/puppet/util/command_line.rb
+++ b/lib/puppet/util/command_line.rb
@@ -85,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/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/monkey_patches.rb b/lib/puppet/util/monkey_patches.rb
index 6b5af8350..16384855a 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,3 +51,21 @@ if RUBY_VERSION == '1.8.7'
end
end
+class Object
+ # 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
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 f9becede1..ea7439ad7 100644
--- a/lib/puppet/util/rdoc/parser.rb
+++ b/lib/puppet/util/rdoc/parser.rb
@@ -41,8 +41,10 @@ class Parser
@parser.file = @input_file_name
@ast = @parser.parse
end
- scan_top_level(@top_level)
+ else
+ @ast = env.known_resource_types
end
+ scan_top_level(@top_level)
@top_level
end
@@ -157,8 +159,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
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/spec/integration/parser/parser_spec.rb b/spec/integration/parser/parser_spec.rb
index 7b85bcacb..20d87c228 100755
--- a/spec/integration/parser/parser_spec.rb
+++ b/spec/integration/parser/parser_spec.rb
@@ -109,5 +109,12 @@ describe Puppet::Parser::Parser do
it "should correctly set the arrow type of a relationship" do
"Notify[foo] <~ Notify[bar]".should parse_with { |rel| rel.arrow == "<~" }
end
+
+ it "should be able to parse deep hash access" do
+ %q{
+ $hash = { 'a' => { 'b' => { 'c' => 'it works' } } }
+ $out = $hash['a']['b']['c']
+ }.should parse_with { |v| v.value.is_a?(Puppet::Parser::AST::ASTHash) }
+ end
end
end
diff --git a/spec/integration/provider/mount_spec.rb b/spec/integration/provider/mount_spec.rb
new file mode 100644
index 000000000..d6f25fe1d
--- /dev/null
+++ b/spec/integration/provider/mount_spec.rb
@@ -0,0 +1,151 @@
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+require 'puppet/file_bucket/dipper'
+
+describe "mount provider (integration)" do
+ include PuppetSpec::Files
+
+ def create_fake_fstab(initially_contains_entry)
+ File.open(@fake_fstab, 'w') do |f|
+ if initially_contains_entry
+ f.puts("/dev/disk1s1\t/Volumes/foo_disk\tmsdos\tlocal\t0\t0")
+ end
+ end
+ end
+
+ before :each do
+ @fake_fstab = tmpfile('fstab')
+ @current_options = "local"
+ @current_device = "/dev/disk1s1"
+ Puppet::Type.type(:mount).defaultprovider.stubs(:default_target).returns(@fake_fstab)
+ Facter.stubs(:value).with(:operatingsystem).returns('Darwin')
+ Puppet::Util::ExecutionStub.set do |command, options|
+ case command[0]
+ when %r{/s?bin/mount}
+ if command.length == 1
+ if @mounted
+ "#{@current_device} on /Volumes/foo_disk (msdos, #{@current_options})\n"
+ else
+ ''
+ end
+ else
+ command.length.should == 4
+ command[1].should == '-o'
+ command[3].should == '/Volumes/foo_disk'
+ @mounted.should == false # verify that we don't try to call "mount" redundantly
+ @current_options = command[2]
+ @current_device = check_fstab(true)
+ @mounted = true
+ ''
+ end
+ when %r{/s?bin/umount}
+ command.length.should == 2
+ command[1].should == '/Volumes/foo_disk'
+ @mounted.should == true # "umount" doesn't work when device not mounted (see #6632)
+ @mounted = false
+ ''
+ else
+ fail "Unexpected command #{command.inspect} executed"
+ end
+ end
+ end
+
+ after :each do
+ Puppet::Type::Mount::ProviderParsed.clear # Work around bug #6628
+ end
+
+ def check_fstab(expected_to_be_present)
+ # Verify that the fake fstab has the expected data in it
+ fstab_contents = File.read(@fake_fstab).lines.map(&:chomp).reject { |x| x =~ /^#|^$/ }
+ if expected_to_be_present
+ fstab_contents.length().should == 1
+ device, rest_of_line = fstab_contents[0].split(/\t/,2)
+ rest_of_line.should == "/Volumes/foo_disk\tmsdos\t#{@desired_options}\t0\t0"
+ device
+ else
+ fstab_contents.length().should == 0
+ nil
+ end
+ end
+
+ def run_in_catalog(settings)
+ resource = Puppet::Type.type(:mount).new(settings.merge(:name => "/Volumes/foo_disk",
+ :device => "/dev/disk1s1", :fstype => "msdos"))
+ Puppet::FileBucket::Dipper.any_instance.stubs(:backup) # Don't backup to the filebucket
+ resource.expects(:err).never
+ catalog = Puppet::Resource::Catalog.new
+ catalog.host_config = false # Stop Puppet from doing a bunch of magic
+ catalog.add_resource resource
+ catalog.apply
+ end
+
+ [false, true].each do |initial_state|
+ describe "When initially #{initial_state ? 'mounted' : 'unmounted'}" do
+ before :each do
+ @mounted = initial_state
+ end
+
+ [false, true].each do |initial_fstab_entry|
+ describe "When there is #{initial_fstab_entry ? 'an' : 'no'} initial fstab entry" do
+ before :each do
+ create_fake_fstab(initial_fstab_entry)
+ end
+
+ [:defined, :present, :mounted, :unmounted, :absent].each do |ensure_setting|
+ expected_final_state = case ensure_setting
+ when :mounted
+ true
+ when :unmounted, :absent
+ false
+ when :defined, :present
+ initial_state
+ else
+ fail "Unknown ensure_setting #{ensure_setting}"
+ end
+ expected_fstab_data = (ensure_setting != :absent)
+ describe "When setting ensure => #{ensure_setting}" do
+ ["local", "journaled"].each do |options_setting|
+ describe "When setting options => #{options_setting}" do
+ it "should leave the system in the #{expected_final_state ? 'mounted' : 'unmounted'} state, #{expected_fstab_data ? 'with' : 'without'} data in /etc/fstab" do
+ @desired_options = options_setting
+ run_in_catalog(:ensure=>ensure_setting, :options => options_setting)
+ @mounted.should == expected_final_state
+ if expected_fstab_data
+ check_fstab(expected_fstab_data).should == "/dev/disk1s1"
+ else
+ check_fstab(expected_fstab_data).should == nil
+ end
+ if @mounted
+ if ![:defined, :present].include?(ensure_setting)
+ @current_options.should == @desired_options
+ elsif initial_fstab_entry
+ @current_options.should == @desired_options
+ else
+ @current_options.should == 'local' #Workaround for #6645
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+
+ describe "When the wrong device is mounted" do
+ it "should remount the correct device" do
+ pending "Due to bug 6309"
+ @mounted = true
+ @current_device = "/dev/disk2s2"
+ create_fake_fstab(true)
+ @desired_options = "local"
+ run_in_catalog(:ensure=>:mounted, :options=>'local')
+ @current_device.should=="/dev/disk1s1"
+ @mounted.should==true
+ @current_options.should=='local'
+ check_fstab(true).should == "/dev/disk1s1"
+ end
+ end
+end
diff --git a/spec/integration/type/file_spec.rb b/spec/integration/type/file_spec.rb
index 4b91e5ef9..31f4adee6 100755
--- a/spec/integration/type/file_spec.rb
+++ b/spec/integration/type/file_spec.rb
@@ -173,7 +173,12 @@ describe Puppet::Type.type(:file) do
it "should be able to recurse over a nonexistent file" do
@path = tmpfile("file_integration_tests")
- @file = Puppet::Type::File.new(:name => @path, :mode => 0644, :recurse => true, :backup => false)
+ @file = Puppet::Type::File.new(
+ :name => @path,
+ :mode => 0644,
+ :recurse => true,
+ :backup => false
+ )
@catalog = Puppet::Resource::Catalog.new
@catalog.add_resource @file
@@ -186,7 +191,12 @@ describe Puppet::Type.type(:file) do
build_path(@path)
- @file = Puppet::Type::File.new(:name => @path, :mode => 0644, :recurse => true, :backup => false)
+ @file = Puppet::Type::File.new(
+ :name => @path,
+ :mode => 0644,
+ :recurse => true,
+ :backup => false
+ )
@catalog = Puppet::Resource::Catalog.new
@catalog.add_resource @file
@@ -393,10 +403,8 @@ describe Puppet::Type.type(:file) do
dest = tmpfile("files_with_content")
- file = Puppet::Type.type(:file).new(
-
- :name => dest,
-
+ file = Puppet::Type.type(:file).new(
+ :name => dest,
:content => "this is some content, yo"
)
@@ -411,11 +419,9 @@ describe Puppet::Type.type(:file) do
dest = tmpfile("files_with_content")
- file = Puppet::Type.type(:file).new(
-
- :name => dest,
- :ensure => "file",
-
+ file = Puppet::Type.type(:file).new(
+ :name => dest,
+ :ensure => "file",
:content => "this is some content, yo"
)
@@ -433,12 +439,10 @@ describe Puppet::Type.type(:file) do
File.open(dest, "w") { |f| f.puts "boo" }
- file = Puppet::Type.type(:file).new(
-
- :name => dest,
+ file = Puppet::Type.type(:file).new(
+ :name => dest,
:ensure => :absent,
:source => source,
-
:backup => false
)
@@ -465,24 +469,23 @@ describe Puppet::Type.type(:file) do
File.open(@purgee, "w") { |f| f.puts "footest" }
- @lfobj = Puppet::Type.newfile(
-
- :title => "localfile",
- :path => @localfile,
+ @lfobj = Puppet::Type.newfile(
+ :title => "localfile",
+ :path => @localfile,
:content => "rahtest\n",
- :ensure => :file,
-
- :backup => false
+ :ensure => :file,
+ :backup => false
)
- @destobj = Puppet::Type.newfile(
- :title => "destdir", :path => @destdir,
- :source => @sourcedir,
- :backup => false,
- :purge => true,
-
- :recurse => true)
+ @destobj = Puppet::Type.newfile(
+ :title => "destdir",
+ :path => @destdir,
+ :source => @sourcedir,
+ :backup => false,
+ :purge => true,
+ :recurse => true
+ )
@catalog = Puppet::Resource::Catalog.new
@catalog.add_resource @lfobj, @destobj
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index ed4e826c9..ae4edb2d9 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -34,6 +34,7 @@ RSpec.configure do |config|
Puppet.settings.clear
Puppet::Node::Environment.clear
Puppet::Util::Storage.clear
+ Puppet::Util::ExecutionStub.reset
if defined?($tmpfiles)
$tmpfiles.each do |file|
@@ -64,6 +65,7 @@ RSpec.configure do |config|
# these globals are set by Application
$puppet_application_mode = nil
$puppet_application_name = nil
+ Signal.stubs(:trap)
# Set the confdir and vardir to gibberish so that tests
# have to be correctly mocked.
diff --git a/spec/unit/application/agent_spec.rb b/spec/unit/application/agent_spec.rb
index ff504eedf..8f498d4ba 100755
--- a/spec/unit/application/agent_spec.rb
+++ b/spec/unit/application/agent_spec.rb
@@ -50,12 +50,8 @@ describe Puppet::Application::Agent do
end
describe "in preinit" do
- before :each do
- @puppetd.stubs(:trap)
- end
-
it "should catch INT" do
- @puppetd.expects(:trap).with { |arg,block| arg == :INT }
+ Signal.expects(:trap).with { |arg,block| arg == :INT }
@puppetd.preinit
end
@@ -530,11 +526,11 @@ describe Puppet::Application::Agent do
@puppetd.onetime
end
- it "should always exit with 0 if --noop" do
+ it "should exit with the report's computer exit status, even if --noop is set." do
Puppet.stubs(:[]).with(:noop).returns(true)
report = stub 'report', :exit_status => 666
@agent.stubs(:run).returns(report)
- @puppetd.expects(:exit).with(0)
+ @puppetd.expects(:exit).with(666)
@puppetd.onetime
end
diff --git a/spec/unit/application/apply_spec.rb b/spec/unit/application/apply_spec.rb
index 4e1744206..d4f39abe0 100755
--- a/spec/unit/application/apply_spec.rb
+++ b/spec/unit/application/apply_spec.rb
@@ -52,7 +52,6 @@ describe Puppet::Application::Apply do
before :each do
Puppet::Log.stubs(:newdestination)
- Puppet.stubs(:trap)
Puppet::Log.stubs(:level=)
Puppet.stubs(:parse_config)
Puppet::FileBucket::Dipper.stubs(:new)
@@ -78,7 +77,7 @@ describe Puppet::Application::Apply do
end
it "should set INT trap" do
- @apply.expects(:trap).with(:INT)
+ Signal.expects(:trap).with(:INT)
@apply.setup
end
@@ -167,6 +166,13 @@ describe Puppet::Application::Apply do
@apply.expects(:exit).with(1)
@apply.parseonly
end
+
+ it "should exit with exit code 1 if error, even if --noop is set" do
+ Puppet[:noop] = true
+ @collection.stubs(:perform_initial_import).raises(Puppet::ParseError)
+ @apply.expects(:exit).with(1)
+ @apply.parseonly
+ end
end
describe "the main command" do
@@ -328,6 +334,15 @@ describe Puppet::Application::Apply do
@apply.main
end
+ it "should exit with report's computed exit status, even if --noop is set" do
+ Puppet.stubs(:[]).with(:noop).returns(true)
+ @apply.options.stubs(:[]).with(:detailed_exitcodes).returns(true)
+ Puppet::Transaction::Report.any_instance.stubs(:exit_status).returns(666)
+ @apply.expects(:exit).with(666)
+
+ @apply.main
+ end
+
it "should always exit with 0 if option is disabled" do
Puppet.stubs(:[]).with(:noop).returns(false)
@apply.options.stubs(:[]).with(:detailed_exitcodes).returns(false)
diff --git a/spec/unit/application/cert_spec.rb b/spec/unit/application/cert_spec.rb
index 4663fc938..b3257916b 100755
--- a/spec/unit/application/cert_spec.rb
+++ b/spec/unit/application/cert_spec.rb
@@ -51,7 +51,7 @@ describe Puppet::Application::Cert do
it "should set cert_mode to :destroy for --clean" do
@cert_app.handle_clean(0)
- @cert_app.cert_mode.should == :destroy
+ @cert_app.subcommand.should == :destroy
end
it "should set all to true for --all" do
@@ -68,7 +68,7 @@ describe Puppet::Application::Cert do
it "should set cert_mode to #{method} with option --#{method}" do
@cert_app.send("handle_#{method}".to_sym, nil)
- @cert_app.cert_mode.should == method
+ @cert_app.subcommand.should == method
end
end
@@ -114,19 +114,19 @@ describe Puppet::Application::Cert do
end
it "should set the ca_location to :local if the cert_mode is generate" do
- @cert_app.find_mode('--generate')
+ @cert_app.subcommand = 'generate'
Puppet::SSL::Host.expects(:ca_location=).with(:local)
@cert_app.setup
end
it "should set the ca_location to :local if the cert_mode is destroy" do
- @cert_app.find_mode('--destroy')
+ @cert_app.subcommand = 'destroy'
Puppet::SSL::Host.expects(:ca_location=).with(:local)
@cert_app.setup
end
it "should set the ca_location to :only if the cert_mode is print" do
- @cert_app.find_mode('--print')
+ @cert_app.subcommand = 'print'
Puppet::SSL::Host.expects(:ca_location=).with(:only)
@cert_app.setup
end
@@ -171,24 +171,64 @@ describe Puppet::Application::Cert do
@cert_app.main
end
- it "should delegate to ca.apply with current set cert_mode" do
- @cert_app.cert_mode = "currentmode"
+ it "should revoke cert if cert_mode is clean" do
+ @cert_app.subcommand = :destroy
@cert_app.command_line.stubs(:args).returns(["host"])
- @ca.expects(:apply).with { |cert_mode,to| cert_mode == "currentmode" }
+ @ca.expects(:apply).with { |cert_mode,to| cert_mode == :revoke }
+ @ca.expects(:apply).with { |cert_mode,to| cert_mode == :destroy }
@cert_app.main
end
+ end
- it "should revoke cert if cert_mode is clean" do
- @cert_app.cert_mode = :destroy
- @cert_app.command_line.stubs(:args).returns(["host"])
+ describe "when identifying subcommands" do
+ before :each do
+ @cert_app.all = false
+ @ca = stub_everything 'ca'
+ @cert_app.ca = @ca
+ end
- @ca.expects(:apply).with { |cert_mode,to| cert_mode == :revoke }
- @ca.expects(:apply).with { |cert_mode,to| cert_mode == :destroy }
+ it "should not fail when no command is given" do
+ # Make the help method silent for testing; this is a bit nasty, but we
+ # can't identify a cleaner method. Help welcome. --daniel 2011-02-22
+ Puppet.features.stubs(:usage?).returns(false)
+ @cert_app.stubs(:puts)
- @cert_app.main
+ @cert_app.command_line.stubs(:args).returns([])
+ expect { @cert_app.parse_options }.should raise_error SystemExit
end
+ %w{list revoke generate sign print verify fingerprint}.each do |cmd|
+ short = cmd[0,1]
+ [cmd, "--#{cmd}", "-#{short}"].each do |option|
+ # In our command line '-v' was eaten by 'verbose', so we can't consume
+ # it here; this is a special case from our otherwise standard
+ # processing. --daniel 2011-02-22
+ next if option == "-v"
+
+ it "should recognise '#{option}'" do
+ args = [option, "fun.example.com"]
+
+ @cert_app.command_line.stubs(:args).returns(args)
+ @cert_app.parse_options
+ @cert_app.subcommand.should == cmd.to_sym
+
+ args.should == ["fun.example.com"]
+ end
+ end
+ end
+
+ %w{clean --clean -c}.each do |ugly|
+ it "should recognise the '#{ugly}' option as destroy" do
+ args = [ugly, "fun.example.com"]
+
+ @cert_app.command_line.stubs(:args).returns(args)
+ @cert_app.parse_options
+ @cert_app.subcommand.should == :destroy
+
+ args.should == ["fun.example.com"]
+ end
+ end
end
end
diff --git a/spec/unit/application/filebucket_spec.rb b/spec/unit/application/filebucket_spec.rb
index e6272f179..95135c7eb 100644
--- a/spec/unit/application/filebucket_spec.rb
+++ b/spec/unit/application/filebucket_spec.rb
@@ -56,7 +56,7 @@ describe Puppet::Application::Filebucket do
end
it "should trap INT" do
- @filebucket.expects(:trap).with(:INT)
+ Signal.expects(:trap).with(:INT)
@filebucket.setup
end
diff --git a/spec/unit/application/queue_spec.rb b/spec/unit/application/queue_spec.rb
index bd0d53ab1..f8ebbd0b4 100755
--- a/spec/unit/application/queue_spec.rb
+++ b/spec/unit/application/queue_spec.rb
@@ -29,12 +29,8 @@ describe Puppet::Application::Queue do
end
describe "in preinit" do
- before :each do
- @queue.stubs(:trap)
- end
-
it "should catch INT" do
- @queue.expects(:trap).with { |arg,block| arg == :INT }
+ Signal.expects(:trap).with { |arg,block| arg == :INT }
@queue.preinit
end
diff --git a/spec/unit/configurer/downloader_spec.rb b/spec/unit/configurer/downloader_spec.rb
index c57f39fb5..4080263e7 100755
--- a/spec/unit/configurer/downloader_spec.rb
+++ b/spec/unit/configurer/downloader_spec.rb
@@ -5,6 +5,8 @@ require File.dirname(__FILE__) + '/../../spec_helper'
require 'puppet/configurer/downloader'
describe Puppet::Configurer::Downloader do
+ require 'puppet_spec/files'
+ include PuppetSpec::Files
it "should require a name" do
lambda { Puppet::Configurer::Downloader.new }.should raise_error(ArgumentError)
end
@@ -96,25 +98,35 @@ describe Puppet::Configurer::Downloader do
describe "when creating the catalog to do the downloading" do
before do
- @dler = Puppet::Configurer::Downloader.new("foo", "path", "source")
+ @dler = Puppet::Configurer::Downloader.new("foo", "/download/path", "source")
end
it "should create a catalog and add the file to it" do
- file = mock 'file'
- catalog = mock 'catalog'
-
- @dler.expects(:file).returns file
-
- Puppet::Resource::Catalog.expects(:new).returns catalog
- catalog.expects(:add_resource).with(file)
+ catalog = @dler.catalog
+ catalog.resources.size.should == 1
+ catalog.resources.first.class.should == Puppet::Type::File
+ catalog.resources.first.name.should == "/download/path"
+ end
- @dler.catalog.should equal(catalog)
+ it "should specify that it is not managing a host catalog" do
+ @dler.catalog.host_config.should == false
end
+
end
describe "when downloading" do
before do
- @dler = Puppet::Configurer::Downloader.new("foo", "path", "source")
+ @dl_name = tmpfile("downloadpath")
+ source_name = tmpfile("source")
+ File.open(source_name, 'w') {|f| f.write('hola mundo') }
+ @dler = Puppet::Configurer::Downloader.new("foo", @dl_name, source_name)
+ end
+
+ it "should not skip downloaded resources when filtering on tags" do
+ Puppet[:tags] = 'maytag'
+ @dler.evaluate
+
+ File.exists?(@dl_name).should be_true
end
it "should log that it is downloading" do
diff --git a/spec/unit/daemon_spec.rb b/spec/unit/daemon_spec.rb
index e24db7881..39592b7c9 100755
--- a/spec/unit/daemon_spec.rb
+++ b/spec/unit/daemon_spec.rb
@@ -29,13 +29,9 @@ describe Puppet::Daemon do
end
describe "when setting signal traps" do
- before do
- @daemon.stubs(:trap)
- end
-
{:INT => :stop, :TERM => :stop, :HUP => :restart, :USR1 => :reload, :USR2 => :reopen_logs}.each do |signal, method|
it "should log and call #{method} when it receives #{signal}" do
- @daemon.expects(:trap).with(signal).yields
+ Signal.expects(:trap).with(signal).yields
Puppet.expects(:notice)
diff --git a/spec/unit/indirector/facts/inventory_active_record_spec.rb b/spec/unit/indirector/facts/inventory_active_record_spec.rb
new file mode 100644
index 000000000..9558abde2
--- /dev/null
+++ b/spec/unit/indirector/facts/inventory_active_record_spec.rb
@@ -0,0 +1,163 @@
+#!/usr/bin/env ruby
+
+require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'sqlite3' rescue nil
+require 'tempfile'
+require 'puppet/rails'
+
+describe "Puppet::Node::Facts::InventoryActiveRecord", :if => (Puppet.features.rails? and defined? SQLite3) do
+ let(:terminus) { Puppet::Node::Facts::InventoryActiveRecord.new }
+
+ before :all do
+ require 'puppet/indirector/facts/inventory_active_record'
+ @dbfile = Tempfile.new("testdb")
+ @dbfile.close
+ end
+
+ after :all do
+ Puppet::Node::Facts.indirection.reset_terminus_class
+ @dbfile.unlink
+ end
+
+ before :each do
+ Puppet::Node::Facts.terminus_class = :inventory_active_record
+ Puppet[:dbadapter] = 'sqlite3'
+ Puppet[:dblocation] = @dbfile.path
+ Puppet[:railslog] = "/dev/null"
+ Puppet::Rails.init
+ end
+
+ after :each do
+ Puppet::Rails.teardown
+ end
+
+ describe "#save" do
+ it "should use an existing node if possible" do
+ node = Puppet::Rails::InventoryNode.new(:name => "foo", :timestamp => Time.now)
+ node.save
+ Puppet::Node::Facts.new("foo", "uptime_days" => "60", "kernel" => "Darwin").save
+
+ Puppet::Rails::InventoryNode.count.should == 1
+ Puppet::Rails::InventoryNode.first.should == node
+ end
+
+ it "should create a new node if one can't be found" do
+ # This test isn't valid if there are nodes to begin with
+ Puppet::Rails::InventoryNode.count.should == 0
+
+ Puppet::Node::Facts.new("foo", "uptime_days" => "60", "kernel" => "Darwin").save
+
+ Puppet::Rails::InventoryNode.count.should == 1
+ Puppet::Rails::InventoryNode.first.name.should == "foo"
+ end
+
+ it "should save the facts" do
+ Puppet::Node::Facts.new("foo", "uptime_days" => "60", "kernel" => "Darwin").save
+
+ Puppet::Rails::InventoryFact.all.map{|f| [f.name,f.value]}.should =~ [["uptime_days","60"],["kernel","Darwin"]]
+ end
+
+ it "should remove the previous facts for an existing node" do
+ Puppet::Node::Facts.new("foo", "uptime_days" => "30", "kernel" => "Darwin").save
+ bar_facts = Puppet::Node::Facts.new("bar", "uptime_days" => "35", "kernel" => "Linux")
+ foo_facts = Puppet::Node::Facts.new("foo", "uptime_days" => "60", "is_virtual" => "false")
+ bar_facts.save
+ foo_facts.save
+
+ Puppet::Node::Facts.find("bar").should == bar_facts
+ Puppet::Node::Facts.find("foo").should == foo_facts
+ Puppet::Rails::InventoryFact.all.map{|f| [f.name,f.value]}.should_not include(["uptime_days", "30"], ["kernel", "Darwin"])
+ end
+ end
+
+ describe "#find" do
+ before do
+ @foo_facts = Puppet::Node::Facts.new("foo", "uptime_days" => "60", "kernel" => "Darwin")
+ @bar_facts = Puppet::Node::Facts.new("bar", "uptime_days" => "30", "kernel" => "Linux")
+ @foo_facts.save
+ @bar_facts.save
+ end
+
+ it "should identify facts by node name" do
+ Puppet::Node::Facts.find("foo").should == @foo_facts
+ end
+
+ it "should return nil if no node instance can be found" do
+ Puppet::Node::Facts.find("non-existent node").should == nil
+ end
+ end
+
+ describe "#search" do
+ def search_request(conditions)
+ Puppet::Indirector::Request.new(:facts, :search, nil, conditions)
+ end
+
+ before :each do
+ @now = Time.now
+ @foo = Puppet::Node::Facts.new("foo", "fact1" => "value1", "fact2" => "value2", "uptime_days" => "30")
+ @bar = Puppet::Node::Facts.new("bar", "fact1" => "value1", "uptime_days" => "60")
+ @baz = Puppet::Node::Facts.new("baz", "fact1" => "value2", "fact2" => "value1", "uptime_days" => "90")
+ @bat = Puppet::Node::Facts.new("bat")
+ @foo.timestamp = @now - 3600*1
+ @bar.timestamp = @now - 3600*3
+ @baz.timestamp = @now - 3600*5
+ @bat.timestamp = @now - 3600*7
+ @foo.save
+ @bar.save
+ @baz.save
+ @bat.save
+ end
+
+ it "should return node names that match 'equal' constraints" do
+ request = search_request('facts.fact1.eq' => 'value1',
+ 'facts.fact2.eq' => 'value2')
+ terminus.search(request).should == ["foo"]
+ end
+
+ it "should return node names that match 'not equal' constraints" do
+ request = search_request('facts.fact1.ne' => 'value2')
+ terminus.search(request).should == ["bar","foo"]
+ end
+
+ it "should return node names that match strict inequality constraints" do
+ request = search_request('facts.uptime_days.gt' => '20',
+ 'facts.uptime_days.lt' => '70')
+ terminus.search(request).should == ["bar","foo"]
+ end
+
+ it "should return node names that match non-strict inequality constraints" do
+ request = search_request('facts.uptime_days.ge' => '30',
+ 'facts.uptime_days.le' => '60')
+ terminus.search(request).should == ["bar","foo"]
+ end
+
+ it "should return node names whose facts are within a given timeframe" do
+ request = search_request('meta.timestamp.ge' => @now - 3600*5,
+ 'meta.timestamp.le' => @now - 3600*1)
+ terminus.search(request).should == ["bar","baz","foo"]
+ end
+
+ it "should return node names whose facts are from a specific time" do
+ request = search_request('meta.timestamp.eq' => @now - 3600*3)
+ terminus.search(request).should == ["bar"]
+ end
+
+ it "should return node names whose facts are not from a specific time" do
+ request = search_request('meta.timestamp.ne' => @now - 3600*1)
+ terminus.search(request).should == ["bar","bat","baz"]
+ end
+
+ it "should perform strict searches on nodes by timestamp" do
+ request = search_request('meta.timestamp.gt' => @now - 3600*5,
+ 'meta.timestamp.lt' => @now - 3600*1)
+ terminus.search(request).should == ["bar"]
+ end
+
+ it "should search nodes based on both facts and timestamp values" do
+ request = search_request('facts.uptime_days.gt' => '45',
+ 'meta.timestamp.lt' => @now - 3600*4)
+ terminus.search(request).should == ["baz"]
+ end
+ end
+end
+
diff --git a/spec/unit/indirector/facts/yaml_spec.rb b/spec/unit/indirector/facts/yaml_spec.rb
index e7bac3471..c625c8ee3 100755
--- a/spec/unit/indirector/facts/yaml_spec.rb
+++ b/spec/unit/indirector/facts/yaml_spec.rb
@@ -10,9 +10,9 @@ describe Puppet::Node::Facts::Yaml do
Puppet::Node::Facts::Yaml.superclass.should equal(Puppet::Indirector::Yaml)
end
-
it "should have documentation" do
Puppet::Node::Facts::Yaml.doc.should_not be_nil
+ Puppet::Node::Facts::Yaml.doc.should_not be_empty
end
it "should be registered with the facts indirection" do
@@ -20,7 +20,221 @@ describe Puppet::Node::Facts::Yaml do
Puppet::Node::Facts::Yaml.indirection.should equal(indirection)
end
- it "should have its name set to :facts" do
+ it "should have its name set to :yaml" do
Puppet::Node::Facts::Yaml.name.should == :yaml
end
+
+ describe "#search" do
+ def assert_search_matches(matching, nonmatching, query)
+ request = Puppet::Indirector::Request.new(:inventory, :search, nil, query)
+
+ Dir.stubs(:glob).returns(matching.keys + nonmatching.keys)
+ [matching, nonmatching].each do |examples|
+ examples.each do |key, value|
+ YAML.stubs(:load_file).with(key).returns value
+ end
+ end
+ Puppet::Node::Facts::Yaml.new.search(request).should =~ matching.values.map {|facts| facts.name}
+ end
+
+ it "should return node names that match the search query options" do
+ assert_search_matches({
+ '/path/to/matching.yaml' => Puppet::Node::Facts.new("matchingnode", "architecture" => "i386", 'processor_count' => '4'),
+ '/path/to/matching1.yaml' => Puppet::Node::Facts.new("matchingnode1", "architecture" => "i386", 'processor_count' => '4', 'randomfact' => 'foo')
+ },
+ {
+ "/path/to/nonmatching.yaml" => Puppet::Node::Facts.new("nonmatchingnode", "architecture" => "powerpc", 'processor_count' => '4'),
+ "/path/to/nonmatching1.yaml" => Puppet::Node::Facts.new("nonmatchingnode1", "architecture" => "powerpc", 'processor_count' => '5'),
+ "/path/to/nonmatching2.yaml" => Puppet::Node::Facts.new("nonmatchingnode2", "architecture" => "i386", 'processor_count' => '5'),
+ "/path/to/nonmatching3.yaml" => Puppet::Node::Facts.new("nonmatchingnode3", 'processor_count' => '4'),
+ },
+ {'facts.architecture' => 'i386', 'facts.processor_count' => '4'}
+ )
+ end
+
+ it "should return empty array when no nodes match the search query options" do
+ assert_search_matches({}, {
+ "/path/to/nonmatching.yaml" => Puppet::Node::Facts.new("nonmatchingnode", "architecture" => "powerpc", 'processor_count' => '10'),
+ "/path/to/nonmatching1.yaml" => Puppet::Node::Facts.new("nonmatchingnode1", "architecture" => "powerpc", 'processor_count' => '5'),
+ "/path/to/nonmatching2.yaml" => Puppet::Node::Facts.new("nonmatchingnode2", "architecture" => "i386", 'processor_count' => '5'),
+ "/path/to/nonmatching3.yaml" => Puppet::Node::Facts.new("nonmatchingnode3", 'processor_count' => '4'),
+ },
+ {'facts.processor_count.lt' => '4', 'facts.processor_count.gt' => '4'}
+ )
+ end
+
+
+ it "should return node names that match the search query options with the greater than operator" do
+ assert_search_matches({
+ '/path/to/matching.yaml' => Puppet::Node::Facts.new("matchingnode", "architecture" => "i386", 'processor_count' => '5'),
+ '/path/to/matching1.yaml' => Puppet::Node::Facts.new("matchingnode1", "architecture" => "powerpc", 'processor_count' => '10', 'randomfact' => 'foo')
+ },
+ {
+ "/path/to/nonmatching.yaml" => Puppet::Node::Facts.new("nonmatchingnode", "architecture" => "powerpc", 'processor_count' => '4'),
+ "/path/to/nonmatching2.yaml" => Puppet::Node::Facts.new("nonmatchingnode2", "architecture" => "i386", 'processor_count' => '3'),
+ "/path/to/nonmatching3.yaml" => Puppet::Node::Facts.new("nonmatchingnode3" ),
+ },
+ {'facts.processor_count.gt' => '4'}
+ )
+ end
+
+ it "should return node names that match the search query options with the less than operator" do
+ assert_search_matches({
+ '/path/to/matching.yaml' => Puppet::Node::Facts.new("matchingnode", "architecture" => "i386", 'processor_count' => '5'),
+ '/path/to/matching1.yaml' => Puppet::Node::Facts.new("matchingnode1", "architecture" => "powerpc", 'processor_count' => '30', 'randomfact' => 'foo')
+ },
+ {
+ "/path/to/nonmatching.yaml" => Puppet::Node::Facts.new("nonmatchingnode", "architecture" => "powerpc", 'processor_count' => '50' ),
+ "/path/to/nonmatching2.yaml" => Puppet::Node::Facts.new("nonmatchingnode2", "architecture" => "i386", 'processor_count' => '100'),
+ "/path/to/nonmatching3.yaml" => Puppet::Node::Facts.new("nonmatchingnode3" ),
+ },
+ {'facts.processor_count.lt' => '50'}
+ )
+ end
+
+ it "should return node names that match the search query options with the less than or equal to operator" do
+ assert_search_matches({
+ '/path/to/matching.yaml' => Puppet::Node::Facts.new("matchingnode", "architecture" => "i386", 'processor_count' => '5'),
+ '/path/to/matching1.yaml' => Puppet::Node::Facts.new("matchingnode1", "architecture" => "powerpc", 'processor_count' => '50', 'randomfact' => 'foo')
+ },
+ {
+ "/path/to/nonmatching.yaml" => Puppet::Node::Facts.new("nonmatchingnode", "architecture" => "powerpc", 'processor_count' => '100' ),
+ "/path/to/nonmatching2.yaml" => Puppet::Node::Facts.new("nonmatchingnode2", "architecture" => "i386", 'processor_count' => '5000'),
+ "/path/to/nonmatching3.yaml" => Puppet::Node::Facts.new("nonmatchingnode3" ),
+ },
+ {'facts.processor_count.le' => '50'}
+ )
+ end
+
+ it "should return node names that match the search query options with the greater than or equal to operator" do
+ assert_search_matches({
+ '/path/to/matching.yaml' => Puppet::Node::Facts.new("matchingnode", "architecture" => "i386", 'processor_count' => '100'),
+ '/path/to/matching1.yaml' => Puppet::Node::Facts.new("matchingnode1", "architecture" => "powerpc", 'processor_count' => '50', 'randomfact' => 'foo')
+ },
+ {
+ "/path/to/nonmatching.yaml" => Puppet::Node::Facts.new("nonmatchingnode", "architecture" => "powerpc", 'processor_count' => '40'),
+ "/path/to/nonmatching2.yaml" => Puppet::Node::Facts.new("nonmatchingnode2", "architecture" => "i386", 'processor_count' => '9' ),
+ "/path/to/nonmatching3.yaml" => Puppet::Node::Facts.new("nonmatchingnode3" ),
+ },
+ {'facts.processor_count.ge' => '50'}
+ )
+ end
+
+ it "should return node names that match the search query options with the not equal operator" do
+ assert_search_matches({
+ '/path/to/matching.yaml' => Puppet::Node::Facts.new("matchingnode", "architecture" => 'arm' ),
+ '/path/to/matching1.yaml' => Puppet::Node::Facts.new("matchingnode1", "architecture" => 'powerpc', 'randomfact' => 'foo')
+ },
+ {
+ "/path/to/nonmatching.yaml" => Puppet::Node::Facts.new("nonmatchingnode", "architecture" => "i386" ),
+ "/path/to/nonmatching2.yaml" => Puppet::Node::Facts.new("nonmatchingnode2", "architecture" => "i386", 'processor_count' => '9' ),
+ "/path/to/nonmatching3.yaml" => Puppet::Node::Facts.new("nonmatchingnode3" ),
+ },
+ {'facts.architecture.ne' => 'i386'}
+ )
+ end
+
+ def apply_timestamp(facts, timestamp)
+ facts.timestamp = timestamp
+ facts
+ end
+
+ it "should be able to query based on meta.timestamp.gt" do
+ assert_search_matches({
+ '/path/to/2010-11-01.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-11-01", {}), Time.parse("2010-11-01")),
+ '/path/to/2010-11-10.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-11-10", {}), Time.parse("2010-11-10")),
+ },
+ {
+ '/path/to/2010-10-01.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-01", {}), Time.parse("2010-10-01")),
+ '/path/to/2010-10-10.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-10", {}), Time.parse("2010-10-10")),
+ '/path/to/2010-10-15.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-15", {}), Time.parse("2010-10-15")),
+ },
+ {'meta.timestamp.gt' => '2010-10-15'}
+ )
+ end
+
+ it "should be able to query based on meta.timestamp.le" do
+ assert_search_matches({
+ '/path/to/2010-10-01.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-01", {}), Time.parse("2010-10-01")),
+ '/path/to/2010-10-10.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-10", {}), Time.parse("2010-10-10")),
+ '/path/to/2010-10-15.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-15", {}), Time.parse("2010-10-15")),
+ },
+ {
+ '/path/to/2010-11-01.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-11-01", {}), Time.parse("2010-11-01")),
+ '/path/to/2010-11-10.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-11-10", {}), Time.parse("2010-11-10")),
+ },
+ {'meta.timestamp.le' => '2010-10-15'}
+ )
+ end
+
+ it "should be able to query based on meta.timestamp.lt" do
+ assert_search_matches({
+ '/path/to/2010-10-01.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-01", {}), Time.parse("2010-10-01")),
+ '/path/to/2010-10-10.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-10", {}), Time.parse("2010-10-10")),
+ },
+ {
+ '/path/to/2010-11-01.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-11-01", {}), Time.parse("2010-11-01")),
+ '/path/to/2010-11-10.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-11-10", {}), Time.parse("2010-11-10")),
+ '/path/to/2010-10-15.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-15", {}), Time.parse("2010-10-15")),
+ },
+ {'meta.timestamp.lt' => '2010-10-15'}
+ )
+ end
+
+ it "should be able to query based on meta.timestamp.ge" do
+ assert_search_matches({
+ '/path/to/2010-11-01.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-11-01", {}), Time.parse("2010-11-01")),
+ '/path/to/2010-11-10.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-11-10", {}), Time.parse("2010-11-10")),
+ '/path/to/2010-10-15.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-15", {}), Time.parse("2010-10-15")),
+ },
+ {
+ '/path/to/2010-10-01.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-01", {}), Time.parse("2010-10-01")),
+ '/path/to/2010-10-10.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-10", {}), Time.parse("2010-10-10")),
+ },
+ {'meta.timestamp.ge' => '2010-10-15'}
+ )
+ end
+
+ it "should be able to query based on meta.timestamp.eq" do
+ assert_search_matches({
+ '/path/to/2010-10-15.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-15", {}), Time.parse("2010-10-15")),
+ },
+ {
+ '/path/to/2010-11-01.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-11-01", {}), Time.parse("2010-11-01")),
+ '/path/to/2010-11-10.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-11-10", {}), Time.parse("2010-11-10")),
+ '/path/to/2010-10-01.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-01", {}), Time.parse("2010-10-01")),
+ '/path/to/2010-10-10.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-10", {}), Time.parse("2010-10-10")),
+ },
+ {'meta.timestamp.eq' => '2010-10-15'}
+ )
+ end
+
+ it "should be able to query based on meta.timestamp" do
+ assert_search_matches({
+ '/path/to/2010-10-15.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-15", {}), Time.parse("2010-10-15")),
+ },
+ {
+ '/path/to/2010-11-01.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-11-01", {}), Time.parse("2010-11-01")),
+ '/path/to/2010-11-10.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-11-10", {}), Time.parse("2010-11-10")),
+ '/path/to/2010-10-01.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-01", {}), Time.parse("2010-10-01")),
+ '/path/to/2010-10-10.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-10", {}), Time.parse("2010-10-10")),
+ },
+ {'meta.timestamp' => '2010-10-15'}
+ )
+ end
+
+ it "should be able to query based on meta.timestamp.ne" do
+ assert_search_matches({
+ '/path/to/2010-11-01.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-11-01", {}), Time.parse("2010-11-01")),
+ '/path/to/2010-11-10.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-11-10", {}), Time.parse("2010-11-10")),
+ '/path/to/2010-10-01.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-01", {}), Time.parse("2010-10-01")),
+ '/path/to/2010-10-10.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-10", {}), Time.parse("2010-10-10")),
+ },
+ {
+ '/path/to/2010-10-15.yaml' => apply_timestamp(Puppet::Node::Facts.new("2010-10-15", {}), Time.parse("2010-10-15")),
+ },
+ {'meta.timestamp.ne' => '2010-10-15'}
+ )
+ end
+ end
end
diff --git a/spec/unit/indirector/queue_spec.rb b/spec/unit/indirector/queue_spec.rb
index 00463ee0f..bbe00c75f 100755
--- a/spec/unit/indirector/queue_spec.rb
+++ b/spec/unit/indirector/queue_spec.rb
@@ -114,6 +114,9 @@ describe Puppet::Indirector::Queue, :if => Puppet.features.pson? do
@store_class.client.expects(:subscribe).yields("foo")
@store_class.expects(:intern).raises ArgumentError
Puppet.expects(:err)
+
+ @store_class.expects(:puts)
+
@store_class.subscribe {|o| o }
end
end
diff --git a/spec/unit/module_spec.rb b/spec/unit/module_spec.rb
index 37dad7e25..0b4873f5f 100755
--- a/spec/unit/module_spec.rb
+++ b/spec/unit/module_spec.rb
@@ -367,9 +367,9 @@ describe Puppet::Module do
mod.stubs(:path).returns "/a/foo"
FileTest.expects(:exist?).with("/a/foo/plugins").returns true
- mod.expects(:warning)
-
mod.plugin_directory.should == "/a/foo/plugins"
+ @logs.first.message.should == "using the deprecated 'plugins' directory for ruby extensions; please move to 'lib'"
+ @logs.first.level.should == :warning
end
it "should default to 'lib' for the plugins directory" do
diff --git a/spec/unit/network/handler/fileserver_spec.rb b/spec/unit/network/handler/fileserver_spec.rb
index b37d4f551..9d34e9cdd 100644
--- a/spec/unit/network/handler/fileserver_spec.rb
+++ b/spec/unit/network/handler/fileserver_spec.rb
@@ -158,7 +158,7 @@ describe Puppet::Network::Handler::FileServer do
end
it "should not fail for inexistant plugins type" do
- lambda { @mount.list("puppet/parser",true,false) }.should_not raise_error
+ @mount.list("puppet/parser",true,false)
end
end
diff --git a/spec/unit/network/http/api/v1_spec.rb b/spec/unit/network/http/api/v1_spec.rb
index 23a291cf3..9a8780c62 100644
--- a/spec/unit/network/http/api/v1_spec.rb
+++ b/spec/unit/network/http/api/v1_spec.rb
@@ -76,6 +76,34 @@ describe Puppet::Network::HTTP::API::V1 do
@tester.uri2indirection("GET", "/env/foos/bar", {}).method.should == :search
end
+ it "should choose 'find' as the indirection method if the http method is a GET and the indirection name is facts" do
+ @tester.uri2indirection("GET", "/env/facts/bar", {}).method.should == :find
+ end
+
+ it "should choose 'save' as the indirection method if the http method is a PUT and the indirection name is facts" do
+ @tester.uri2indirection("PUT", "/env/facts/bar", {}).method.should == :save
+ end
+
+ it "should choose 'search' as the indirection method if the http method is a GET and the indirection name is inventory" do
+ @tester.uri2indirection("GET", "/env/inventory/search", {}).method.should == :search
+ end
+
+ it "should choose 'search' as the indirection method if the http method is a GET and the indirection name is facts_search" do
+ @tester.uri2indirection("GET", "/env/facts_search/bar", {}).method.should == :search
+ end
+
+ it "should change indirection name to 'facts' if the http method is a GET and the indirection name is facts_search" do
+ @tester.uri2indirection("GET", "/env/facts_search/bar", {}).indirection_name.should == :facts
+ end
+
+ it "should not change indirection name from 'facts' if the http method is a GET and the indirection name is facts" do
+ @tester.uri2indirection("GET", "/env/facts/bar", {}).indirection_name.should == :facts
+ end
+
+ it "should change indirection name to 'status' if the http method is a GET and the indirection name is statuses" do
+ @tester.uri2indirection("GET", "/env/statuses/bar", {}).indirection_name.should == :status
+ end
+
it "should choose 'delete' as the indirection method if the http method is a DELETE and the indirection name is singular" do
@tester.uri2indirection("DELETE", "/env/foo/bar", {}).method.should == :destroy
end
diff --git a/spec/unit/network/http/compression_spec.rb b/spec/unit/network/http/compression_spec.rb
index c5bbbb064..3828ec59c 100644..100755
--- a/spec/unit/network/http/compression_spec.rb
+++ b/spec/unit/network/http/compression_spec.rb
@@ -178,7 +178,7 @@ describe "http compression" do
end
it "should raise the error the second time" do
- @inflater.expects(:inflate).raises(Zlib::DataError.new("not a zlib stream"))
+ @inflater.stubs(:inflate).raises(Zlib::DataError.new("not a zlib stream"))
Zlib::Inflate.expects(:new).with.returns(@inflater)
lambda { @adapter.uncompress("chunk") }.should raise_error
end
diff --git a/spec/unit/network/http/handler_spec.rb b/spec/unit/network/http/handler_spec.rb
index 8464ae68e..68c7b9aa3 100755
--- a/spec/unit/network/http/handler_spec.rb
+++ b/spec/unit/network/http/handler_spec.rb
@@ -344,17 +344,20 @@ describe Puppet::Network::HTTP::Handler do
@handler.do_search(@irequest, @request, @response)
end
- it "should return a 404 when searching returns an empty array" do
- @model_class.stubs(:name).returns "my name"
- @handler.expects(:set_response).with { |response, body, status| status == 404 }
+ it "should return [] when searching returns an empty array" do
+ @handler.expects(:accept_header).with(@request).returns "one,two"
@model_class.stubs(:search).returns([])
+ @model_class.expects(:render_multiple).with(@oneformat, []).returns "[]"
+
+
+ @handler.expects(:set_response).with { |response, data| data == "[]" }
@handler.do_search(@irequest, @request, @response)
end
it "should return a 404 when searching returns nil" do
@model_class.stubs(:name).returns "my name"
@handler.expects(:set_response).with { |response, body, status| status == 404 }
- @model_class.stubs(:search).returns([])
+ @model_class.stubs(:search).returns(nil)
@handler.do_search(@irequest, @request, @response)
end
end
diff --git a/spec/unit/node/facts_spec.rb b/spec/unit/node/facts_spec.rb
index 394db7913..cb2aa3dc7 100755
--- a/spec/unit/node/facts_spec.rb
+++ b/spec/unit/node/facts_spec.rb
@@ -109,5 +109,29 @@ describe Puppet::Node::Facts, "when indirecting" do
facts = Puppet::Node::Facts.new("me", "one" => "two", "three" => "four")
facts.values[:_timestamp].should be_instance_of(Time)
end
+
+ describe "using pson" do
+ before :each do
+ @timestamp = Time.parse("Thu Oct 28 11:16:31 -0700 2010")
+ @expiration = Time.parse("Thu Oct 28 11:21:31 -0700 2010")
+ end
+
+ it "should accept properly formatted pson" do
+ pson = %Q({"name": "foo", "expiration": "#{@expiration}", "timestamp": "#{@timestamp}", "values": {"a": "1", "b": "2", "c": "3"}})
+ format = Puppet::Network::FormatHandler.format('pson')
+ facts = format.intern(Puppet::Node::Facts,pson)
+ facts.name.should == 'foo'
+ facts.expiration.should == @expiration
+ facts.values.should == {'a' => '1', 'b' => '2', 'c' => '3', :_timestamp => @timestamp}
+ end
+
+ it "should generate properly formatted pson" do
+ Time.stubs(:now).returns(@timestamp)
+ facts = Puppet::Node::Facts.new("foo", {'a' => 1, 'b' => 2, 'c' => 3})
+ facts.expiration = @expiration
+ pson = PSON.parse(facts.to_pson)
+ pson.should == {"name"=>"foo", "timestamp"=>@timestamp.to_s, "expiration"=>@expiration.to_s, "values"=>{"a"=>1, "b"=>2, "c"=>3}}
+ end
+ end
end
end
diff --git a/spec/unit/parser/ast/collection_spec.rb b/spec/unit/parser/ast/collection_spec.rb
index 392a2c0f0..cc33075b7 100755
--- a/spec/unit/parser/ast/collection_spec.rb
+++ b/spec/unit/parser/ast/collection_spec.rb
@@ -4,20 +4,21 @@ require File.dirname(__FILE__) + '/../../../spec_helper'
describe Puppet::Parser::AST::Collection do
before :each do
- @scope = stub_everything 'scope'
- @mytype = stub_everything('mytype')
- @scope.stubs(:find_resource_type).returns @mytype
- @compiler = stub_everything 'compile'
- @scope.stubs(:compiler).returns(@compiler)
+ @mytype = Puppet::Resource::Type.new(:definition, "mytype")
+ @environment = Puppet::Node::Environment.new
+ @environment.known_resource_types.add @mytype
+
+ @compiler = Puppet::Parser::Compiler.new(Puppet::Node.new("foonode", :environment => @environment))
+ @scope = Puppet::Parser::Scope.new(:compiler => @compiler)
@overrides = stub_everything 'overrides'
@overrides.stubs(:is_a?).with(Puppet::Parser::AST).returns(true)
-
end
it "should evaluate its query" do
query = mock 'query'
collection = Puppet::Parser::AST::Collection.new :query => query, :form => :virtual
+ collection.type = 'mytype'
query.expects(:safeevaluate).with(@scope)
@@ -26,8 +27,8 @@ describe Puppet::Parser::AST::Collection do
it "should instantiate a Collector for this type" do
collection = Puppet::Parser::AST::Collection.new :form => :virtual, :type => "test"
- @test_type = stub 'type', :name => 'test'
- @scope.expects(:find_resource_type).with('test').returns @test_type
+ @test_type = Puppet::Resource::Type.new(:definition, "test")
+ @environment.known_resource_types.add @test_type
Puppet::Parser::Collector.expects(:new).with(@scope, "test", nil, nil, :virtual)
@@ -35,7 +36,7 @@ describe Puppet::Parser::AST::Collection do
end
it "should tell the compiler about this collector" do
- collection = Puppet::Parser::AST::Collection.new :form => :virtual, :type => "test"
+ collection = Puppet::Parser::AST::Collection.new :form => :virtual, :type => "mytype"
Puppet::Parser::Collector.stubs(:new).returns("whatever")
@compiler.expects(:add_collection).with("whatever")
@@ -45,7 +46,7 @@ describe Puppet::Parser::AST::Collection do
it "should evaluate overriden paramaters" do
collector = stub_everything 'collector'
- collection = Puppet::Parser::AST::Collection.new :form => :virtual, :type => "test", :override => @overrides
+ collection = Puppet::Parser::AST::Collection.new :form => :virtual, :type => "mytype", :override => @overrides
Puppet::Parser::Collector.stubs(:new).returns(collector)
@overrides.expects(:safeevaluate).with(@scope)
@@ -55,7 +56,7 @@ describe Puppet::Parser::AST::Collection do
it "should tell the collector about overrides" do
collector = mock 'collector'
- collection = Puppet::Parser::AST::Collection.new :form => :virtual, :type => "test", :override => @overrides
+ collection = Puppet::Parser::AST::Collection.new :form => :virtual, :type => "mytype", :override => @overrides
Puppet::Parser::Collector.stubs(:new).returns(collector)
collector.expects(:add_override)
@@ -63,5 +64,8 @@ describe Puppet::Parser::AST::Collection do
collection.evaluate(@scope)
end
-
+ it "should fail when evaluating undefined resource types" do
+ collection = Puppet::Parser::AST::Collection.new :form => :virtual, :type => "bogus"
+ lambda { collection.evaluate(@scope) }.should raise_error "Resource type bogus doesn't exist"
+ end
end
diff --git a/spec/unit/parser/lexer_spec.rb b/spec/unit/parser/lexer_spec.rb
index 860326973..4ef242cf5 100755
--- a/spec/unit/parser/lexer_spec.rb
+++ b/spec/unit/parser/lexer_spec.rb
@@ -529,6 +529,22 @@ describe Puppet::Parser::Lexer, "when lexing comments" do
@lexer.fullscan
end
+ it "should add a new comment stack level on LPAREN" do
+ @lexer.string = "("
+
+ @lexer.expects(:commentpush)
+
+ @lexer.fullscan
+ end
+
+ it "should pop the current comment on RPAREN" do
+ @lexer.string = ")"
+
+ @lexer.expects(:commentpop)
+
+ @lexer.fullscan
+ end
+
it "should return the current comments on getcomment" do
@lexer.string = "# comment"
@lexer.fullscan
diff --git a/spec/unit/parser/parser_spec.rb b/spec/unit/parser/parser_spec.rb
index 07e2d220b..2ed279fd9 100755
--- a/spec/unit/parser/parser_spec.rb
+++ b/spec/unit/parser/parser_spec.rb
@@ -76,6 +76,12 @@ describe Puppet::Parser do
end
+ describe "when parsing selector" do
+ it "should support hash access on the left hand side" do
+ lambda { @parser.parse("$h = { 'a' => 'b' } $a = $h['a'] ? { 'b' => 'd', default => undef }") }.should_not raise_error
+ end
+ end
+
describe "when parsing 'if'" do
it "not, it should create the correct ast objects" do
ast::Not.expects(:new).with { |h| h[:value].is_a?(ast::Boolean) }
@@ -253,7 +259,7 @@ describe Puppet::Parser do
before do
@lexer = stub 'lexer', :line => 50, :file => "/foo/bar", :getcomment => "whev"
@parser.stubs(:lexer).returns @lexer
- @class = stub 'class', :use_docs => false
+ @class = Puppet::Resource::Type.new(:hostclass, "myclass", :use_docs => false)
end
it "should return a new instance of the provided class created with the provided options" do
@@ -276,7 +282,7 @@ describe Puppet::Parser do
it "should include docs when the AST class uses them" do
@class.expects(:use_docs).returns true
@class.stubs(:new)
- @parser.expects(:ast_context).with{ |a| a[0] == true }.returns({})
+ @parser.expects(:ast_context).with{ |docs, line| docs == true }.returns({})
@parser.ast(@class, :file => "/bar")
end
@@ -304,6 +310,33 @@ describe Puppet::Parser do
it "should return an array of nodes" do
@parser.newnode(@nodename).should be_instance_of(Array)
end
+
+ it "should initialize the ast context with the correct line number" do
+ @parser.expects(:ast_context).with { |a,b| b == 123 }.returns({})
+ @parser.newnode(@nodename, { :line => 123 })
+ end
+ end
+
+ %w{class define}.each do |entity|
+ describe "when creating a #{entity}" do
+ before :each do
+ @parser.stubs(:ast_context).returns({})
+
+ @name = stub "#{entity}name", :is_a? => false, :value => "foo"
+ end
+
+ it "should create and add the correct resource type" do
+ instance = stub 'instance'
+ Puppet::Resource::Type.expects(:new).returns(instance)
+ @parser.known_resource_types.expects(:add).with(instance)
+ @parser.send("new#{entity}", @name)
+ end
+
+ it "should initialize the ast context with the correct line number" do
+ @parser.expects(:ast_context).with { |a,b| b == 123 }.returns({})
+ @parser.send("new#{entity}", @name, { :line => 123 })
+ end
+ end
end
describe "when retrieving a specific node" do
diff --git a/spec/unit/provider/mount/parsed_spec.rb b/spec/unit/provider/mount/parsed_spec.rb
index 5a1c986b1..cf29bd358 100755
--- a/spec/unit/provider/mount/parsed_spec.rb
+++ b/spec/unit/provider/mount/parsed_spec.rb
@@ -5,15 +5,17 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
+require 'puppet_spec/files'
require 'puppettest/support/utils'
require 'puppettest/fileparsing'
module ParsedMountTesting
include PuppetTest::Support::Utils
include PuppetTest::FileParsing
+ include PuppetSpec::Files
def fake_fstab
- os = Facter['operatingsystem']
+ os = Facter.value(:operatingsystem)
if os == "Solaris"
name = "solaris.fstab"
elsif os == "FreeBSD"
@@ -22,171 +24,254 @@ module ParsedMountTesting
# Catchall for other fstabs
name = "linux.fstab"
end
- oldpath = @provider_class.default_target
fakefile(File::join("data/types/mount", name))
end
- def mkmountargs
- mount = nil
-
- if defined?(@pcount)
- @pcount += 1
+ def fake_mountoutput
+ os = Facter.value(:operatingsystem)
+ if os == "Darwin"
+ name = "darwin.mount"
+ elsif os == "HP-UX"
+ name = "hpux.mount"
+ elsif os == "Solaris"
+ name = "solaris.mount"
+ elsif os == "AIX"
+ name = "aix.mount"
else
- @pcount = 1
- end
- args = {
- :name => "/fspuppet#{@pcount}",
- :device => "/dev/dsk#{@pcount}",
- }
-
- @provider_class.fields(:parsed).each do |field|
- args[field] = "fake#{field}#{@pcount}" unless args.include? field
+ # Catchall for other fstabs
+ name = "linux.mount"
end
-
- args
+ fakefile(File::join("data/providers/mount/parsed", name))
end
- def mkmount
- hash = mkmountargs
- #hash[:provider] = @provider_class.name
-
- fakeresource = stub :type => :mount, :name => hash[:name]
- fakeresource.stubs(:[]).with(:name).returns(hash[:name])
- fakeresource.stubs(:should).with(:target).returns(nil)
-
- mount = @provider_class.new(fakeresource)
- hash[:record_type] = :parsed
- hash[:ensure] = :present
- mount.property_hash = hash
-
- mount
- end
-
- # Here we just create a fake host type that answers to all of the methods
- # but does not modify our actual system.
- def mkfaketype
- @provider.stubs(:filetype).returns(Puppet::Util::FileType.filetype(:ram))
- end
end
provider_class = Puppet::Type.type(:mount).provider(:parsed)
describe provider_class do
+
before :each do
@mount_class = Puppet::Type.type(:mount)
- @provider_class = @mount_class.provider(:parsed)
+ @provider = @mount_class.provider(:parsed)
+ end
+
+ # LAK:FIXME I can't mock Facter because this test happens at parse-time.
+ it "should default to /etc/vfstab on Solaris" do
+ pending "This test only works on Solaris" unless Facter.value(:operatingsystem) == 'Solaris'
+ Puppet::Type.type(:mount).provider(:parsed).default_target.should == '/etc/vfstab'
+ end
+
+ it "should default to /etc/fstab on anything else" do
+ pending "This test does not work on Solaris" if Facter.value(:operatingsystem) == 'Solaris'
+ Puppet::Type.type(:mount).provider(:parsed).default_target.should == '/etc/fstab'
end
+ describe "when parsing a line" do
- describe provider_class do
- include ParsedMountTesting
+ it "should not crash on incomplete lines in fstab" do
+ parse = @provider.parse <<-FSTAB
+/dev/incomplete
+/dev/device name
+FSTAB
+ lambda{ @provider.to_line(parse[0]) }.should_not raise_error
+ end
- it "should be able to parse all of the example mount tabs" do
- tab = fake_fstab
- @provider = @provider_class
- # LAK:FIXME Again, a relatively bad test, but I don't know how to rspec-ify this.
- # I suppose this is more of an integration test? I dunno.
- fakedataparse(tab) do
- # Now just make we've got some mounts we know will be there
- hashes = @provider_class.target_records(tab).find_all { |i| i.is_a? Hash }
- (hashes.length > 0).should be_true
- root = hashes.find { |i| i[:name] == "/" }
+ describe "on Solaris", :if => Facter.value(:operatingsystem) == 'Solaris' do
- proc { @provider_class.to_file(hashes) }.should_not raise_error
+ before :each do
+ @example_line = "/dev/dsk/c0d0s0 /dev/rdsk/c0d0s0 \t\t / \t ufs 1 no\t-"
end
- end
- # LAK:FIXME I can't mock Facter because this test happens at parse-time.
- it "should default to /etc/vfstab on Solaris and /etc/fstab everywhere else" do
- should = case Facter.value(:operatingsystem)
- when "Solaris"; "/etc/vfstab"
- else
- "/etc/fstab"
- end
- Puppet::Type.type(:mount).provider(:parsed).default_target.should == should
- end
+ it "should extract device from the first field" do
+ @provider.parse_line(@example_line)[:device].should == '/dev/dsk/c0d0s0'
+ end
- it "should not crash on incomplete lines in fstab" do
- parse = @provider_class.parse <<-FSTAB
-/dev/incomplete
-/dev/device name
- FSTAB
+ it "should extract blockdevice from second field" do
+ @provider.parse_line(@example_line)[:blockdevice].should == "/dev/rdsk/c0d0s0"
+ end
- lambda{ @provider_class.to_line(parse[0]) }.should_not raise_error
- end
- end
+ it "should extract name from third field" do
+ @provider.parse_line(@example_line)[:name].should == "/"
+ end
- describe provider_class, " when mounting an absent filesystem" do
- include ParsedMountTesting
+ it "should extract fstype from fourth field" do
+ @provider.parse_line(@example_line)[:fstype].should == "ufs"
+ end
- # #730 - Make sure 'flush' is called when a mount is moving from absent to mounted
- it "should flush the fstab to disk" do
- mount = mkmount
+ it "should extract pass from fifth field" do
+ @provider.parse_line(@example_line)[:pass].should == "1"
+ end
- # Mark the mount as absent
- mount.property_hash[:ensure] = :absent
+ it "should extract atboot from sixth field" do
+ @provider.parse_line(@example_line)[:atboot].should == "no"
+ end
- mount.stubs(:mountcmd) # just so we don't actually try to mount anything
+ it "should extract options from seventh field" do
+ @provider.parse_line(@example_line)[:options].should == "-"
+ end
- mount.expects(:flush)
- mount.mount
end
- end
- describe provider_class, " when modifying the filesystem tab" do
- include ParsedMountTesting
- before do
- Puppet.settings.stubs(:use)
- # Never write to disk, only to RAM.
- #@provider_class.stubs(:filetype).returns(Puppet::Util::FileType.filetype(:ram))
- @provider_class.stubs(:target_object).returns(Puppet::Util::FileType.filetype(:ram).new("eh"))
- @provider_class.clear
+ describe "on other platforms than Solaris", :if => Facter.value(:operatingsystem) != 'Solaris' do
- @mount = mkmount
- @target = @provider_class.default_target
- end
+ before :each do
+ @example_line = "/dev/vg00/lv01\t/spare \t \t ext3 defaults\t1 2"
+ end
- it "should write the mount to disk when :flush is called" do
- old_text = @provider_class.target_object(@provider_class.default_target).read
+ it "should extract device from the first field" do
+ @provider.parse_line(@example_line)[:device].should == '/dev/vg00/lv01'
+ end
- @mount.flush
+ it "should extract name from second field" do
+ @provider.parse_line(@example_line)[:name].should == "/spare"
+ end
+
+ it "should extract fstype from third field" do
+ @provider.parse_line(@example_line)[:fstype].should == "ext3"
+ end
+
+ it "should extract options from fourth field" do
+ @provider.parse_line(@example_line)[:options].should == "defaults"
+ end
+
+ it "should extract dump from fifth field" do
+ @provider.parse_line(@example_line)[:dump].should == "1"
+ end
+
+ it "should extract options from sixth field" do
+ @provider.parse_line(@example_line)[:pass].should == "2"
+ end
- text = @provider_class.target_object(@provider_class.default_target).read
- text.should == old_text + @mount.class.to_line(@mount.property_hash) + "\n"
end
+
end
- describe provider_class, " when parsing information about the root filesystem", :if => Facter["operatingsystem"].value != "Darwin" do
+ describe "mountinstances" do
include ParsedMountTesting
- before do
- @mount = @mount_class.new :name => "/"
- @provider = @mount.provider
+ it "should get name from mountoutput found on Solaris" do
+ Facter.stubs(:value).with(:operatingsystem).returns 'Solaris'
+ @provider.stubs(:mountcmd).returns(File.read(fake_mountoutput))
+ mounts = @provider.mountinstances
+ mounts.size.should == 6
+ mounts[0].should == { :name => '/', :mounted => :yes }
+ mounts[1].should == { :name => '/proc', :mounted => :yes }
+ mounts[2].should == { :name => '/etc/mnttab', :mounted => :yes }
+ mounts[3].should == { :name => '/tmp', :mounted => :yes }
+ mounts[4].should == { :name => '/export/home', :mounted => :yes }
+ mounts[5].should == { :name => '/ghost', :mounted => :yes }
end
- it "should have a filesystem tab" do
- FileTest.should be_exist(@provider_class.default_target)
+ it "should get name from mountoutput found on HP-UX" do
+ Facter.stubs(:value).with(:operatingsystem).returns 'HP-UX'
+ @provider.stubs(:mountcmd).returns(File.read(fake_mountoutput))
+ mounts = @provider.mountinstances
+ mounts.size.should == 17
+ mounts[0].should == { :name => '/', :mounted => :yes }
+ mounts[1].should == { :name => '/devices', :mounted => :yes }
+ mounts[2].should == { :name => '/dev', :mounted => :yes }
+ mounts[3].should == { :name => '/system/contract', :mounted => :yes }
+ mounts[4].should == { :name => '/proc', :mounted => :yes }
+ mounts[5].should == { :name => '/etc/mnttab', :mounted => :yes }
+ mounts[6].should == { :name => '/etc/svc/volatile', :mounted => :yes }
+ mounts[7].should == { :name => '/system/object', :mounted => :yes }
+ mounts[8].should == { :name => '/etc/dfs/sharetab', :mounted => :yes }
+ mounts[9].should == { :name => '/lib/libc.so.1', :mounted => :yes }
+ mounts[10].should == { :name => '/dev/fd', :mounted => :yes }
+ mounts[11].should == { :name => '/tmp', :mounted => :yes }
+ mounts[12].should == { :name => '/var/run', :mounted => :yes }
+ mounts[13].should == { :name => '/export', :mounted => :yes }
+ mounts[14].should == { :name => '/export/home', :mounted => :yes }
+ mounts[15].should == { :name => '/rpool', :mounted => :yes }
+ mounts[16].should == { :name => '/ghost', :mounted => :yes }
end
- it "should find the root filesystem" do
- @provider_class.prefetch("/" => @mount)
- @mount.provider.property_hash[:ensure].should == :present
+ it "should get name from mountoutput found on Darwin" do
+ Facter.stubs(:value).with(:operatingsystem).returns 'Darwin'
+ @provider.stubs(:mountcmd).returns(File.read(fake_mountoutput))
+ mounts = @provider.mountinstances
+ mounts.size.should == 6
+ mounts[0].should == { :name => '/', :mounted => :yes }
+ mounts[1].should == { :name => '/dev', :mounted => :yes }
+ mounts[2].should == { :name => '/net', :mounted => :yes }
+ mounts[3].should == { :name => '/home', :mounted => :yes }
+ mounts[4].should == { :name => '/usr', :mounted => :yes }
+ mounts[5].should == { :name => '/ghost', :mounted => :yes }
end
- it "should determine that the root fs is mounted" do
- @provider_class.prefetch("/" => @mount)
- @mount.provider.should be_mounted
+ it "should get name from mountoutput found on Linux" do
+ Facter.stubs(:value).with(:operatingsystem).returns 'Gentoo'
+ @provider.stubs(:mountcmd).returns(File.read(fake_mountoutput))
+ mounts = @provider.mountinstances
+ mounts[0].should == { :name => '/', :mounted => :yes }
+ mounts[1].should == { :name => '/lib64/rc/init.d', :mounted => :yes }
+ mounts[2].should == { :name => '/sys', :mounted => :yes }
+ mounts[3].should == { :name => '/usr/portage', :mounted => :yes }
+ mounts[4].should == { :name => '/ghost', :mounted => :yes }
end
+
+ it "should get name from mountoutput found on AIX" do
+ Facter.stubs(:value).with(:operatingsystem).returns 'AIX'
+ @provider.stubs(:mountcmd).returns(File.read(fake_mountoutput))
+ mounts = @provider.mountinstances
+ mounts[0].should == { :name => '/', :mounted => :yes }
+ mounts[1].should == { :name => '/tmp', :mounted => :yes }
+ mounts[2].should == { :name => '/home', :mounted => :yes }
+ mounts[3].should == { :name => '/usr', :mounted => :yes }
+ mounts[4].should == { :name => '/usr/code', :mounted => :yes }
+ end
+
+ it "should raise an error if a line is not understandable" do
+ @provider.stubs(:mountcmd).returns("bazinga!")
+ lambda { @provider.mountinstances }.should raise_error Puppet::Error
+ end
+
end
- describe provider_class, " when mounting and unmounting" do
+ describe "when prefetching" do
include ParsedMountTesting
- it "should call the 'mount' command to mount the filesystem"
+ before :each do
+ # Note: we have to stub default_target before creating resources
+ # because it is used by Puppet::Type::Mount.new to populate the
+ # :target property.
+ @provider.stubs(:default_target).returns fake_fstab
+
+ @res_ghost = Puppet::Type::Mount.new(:name => '/ghost') # in no fake fstab
+ @res_mounted = Puppet::Type::Mount.new(:name => '/') # in every fake fstab
+ @res_unmounted = Puppet::Type::Mount.new(:name => '/boot') # in every fake fstab
+ @res_absent = Puppet::Type::Mount.new(:name => '/absent') # in no fake fstab
+
+ # Simulate transaction.rb:prefetch
+ @resource_hash = {}
+ [@res_ghost, @res_mounted, @res_unmounted, @res_absent].each do |resource|
+ @resource_hash[resource.name] = resource
+ end
+
+ @provider.stubs(:mountcmd).returns File.read(fake_mountoutput)
+ end
+
+ it "should set :ensure to :unmounted if found in fstab but not mounted" do
+ @provider.prefetch(@resource_hash)
+ @res_unmounted.provider.get(:ensure).should == :unmounted
+ end
+
+ it "should set :ensure to :mounted if found in fstab and mounted" do
+ @provider.prefetch(@resource_hash)
+ @res_ghost.provider.get(:ensure).should == :ghost
+ end
+
+ it "should set :ensure to :ghost if not found in fstab but mounted" do
+ @provider.prefetch(@resource_hash)
+ @res_mounted.provider.get(:ensure).should == :mounted
+ end
- it "should call the 'unmount' command to unmount the filesystem"
+ it "should set :ensure to :absent if not found in fstab and not mounted" do
+ @provider.prefetch(@resource_hash)
+ @res_absent.provider.get(:ensure).should == :absent
+ end
- it "should specify the filesystem when remounting a filesystem"
end
+
end
diff --git a/spec/unit/provider/mount_spec.rb b/spec/unit/provider/mount_spec.rb
index f567a4a40..3fc8a8664 100755
--- a/spec/unit/provider/mount_spec.rb
+++ b/spec/unit/provider/mount_spec.rb
@@ -19,18 +19,13 @@ describe Puppet::Provider::Mount do
describe Puppet::Provider::Mount, " when mounting" do
- it "should use the 'mountcmd' method to mount" do
- @mounter.stubs(:options).returns(nil)
- @mounter.expects(:mountcmd)
-
- @mounter.mount
+ before :each do
+ @mounter.stubs(:get).with(:ensure).returns(:mounted)
end
- it "should flush before mounting if a flush method exists" do
- @mounter.meta_def(:flush) { }
- @mounter.expects(:flush)
- @mounter.stubs(:mountcmd)
+ it "should use the 'mountcmd' method to mount" do
@mounter.stubs(:options).returns(nil)
+ @mounter.expects(:mountcmd)
@mounter.mount
end
@@ -48,6 +43,23 @@ describe Puppet::Provider::Mount do
@mounter.mount
end
+
+ it "should update the :ensure state to :mounted if it was :unmounted before" do
+ @mounter.expects(:mountcmd)
+ @mounter.stubs(:options).returns(nil)
+ @mounter.expects(:get).with(:ensure).returns(:unmounted)
+ @mounter.expects(:set).with(:ensure => :mounted)
+ @mounter.mount
+ end
+
+ it "should update the :ensure state to :ghost if it was :absent before" do
+ @mounter.expects(:mountcmd)
+ @mounter.stubs(:options).returns(nil)
+ @mounter.expects(:get).with(:ensure).returns(:absent)
+ @mounter.expects(:set).with(:ensure => :ghost)
+ @mounter.mount
+ end
+
end
describe Puppet::Provider::Mount, " when remounting" do
@@ -77,69 +89,58 @@ describe Puppet::Provider::Mount do
describe Puppet::Provider::Mount, " when unmounting" do
+ before :each do
+ @mounter.stubs(:get).with(:ensure).returns(:unmounted)
+ end
+
it "should call the :umount command with the resource name" do
@mounter.expects(:umount).with(@name)
@mounter.unmount
end
- end
-
- describe Puppet::Provider::Mount, " when determining if it is mounted" do
-
- it "should parse the results of running the mount command with no arguments" do
- Facter.stubs(:value).returns("whatever")
- @mounter.expects(:mountcmd).returns("")
- @mounter.mounted?
+ it "should update the :ensure state to :absent if it was :ghost before" do
+ @mounter.expects(:umount).with(@name).returns true
+ @mounter.expects(:get).with(:ensure).returns(:ghost)
+ @mounter.expects(:set).with(:ensure => :absent)
+ @mounter.unmount
end
- it "should match ' on /private/var/automount<name>' if the operating system is Darwin" do
- Facter.stubs(:value).with("operatingsystem").returns("Darwin")
- @mounter.expects(:mountcmd).returns("/dev/whatever on /private/var/automount/\ndevfs on /dev")
-
- @mounter.should be_mounted
+ it "should update the :ensure state to :unmounted if it was :mounted before" do
+ @mounter.expects(:umount).with(@name).returns true
+ @mounter.expects(:get).with(:ensure).returns(:mounted)
+ @mounter.expects(:set).with(:ensure => :unmounted)
+ @mounter.unmount
end
- it "should match ' on <name>' if the operating system is Darwin" do
- Facter.stubs(:value).with("operatingsystem").returns("Darwin")
- @mounter.expects(:mountcmd).returns("/dev/disk03 on / (local, journaled)\ndevfs on /dev")
-
- @mounter.should be_mounted
- end
+ end
- it "should match '^<name> on' if the operating system is Solaris" do
- Facter.stubs(:value).with("operatingsystem").returns("Solaris")
- @mounter.expects(:mountcmd).returns("/ on /dev/dsk/whatever\n/var on /dev/dsk/other")
+ describe Puppet::Provider::Mount, " when determining if it is mounted" do
- @mounter.should be_mounted
+ it "should query the property_hash" do
+ @mounter.expects(:get).with(:ensure).returns(:mounted)
+ @mounter.mounted?
end
- it "should match '^<name> on' if the operating system is HP-UX" do
- Facter.stubs(:value).with("operatingsystem").returns("HP-UX")
- @mounter.expects(:mountcmd).returns("/ on /dev/dsk/whatever\n/var on /dev/dsk/other")
-
- @mounter.should be_mounted
+ it "should return true if prefetched value is :mounted" do
+ @mounter.stubs(:get).with(:ensure).returns(:mounted)
+ @mounter.mounted? == true
end
- it "should match mounted devices if the operating system is AIX" do
- Facter.stubs(:value).with("operatingsystem").returns("AIX")
- mount_data = File.read(File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'unit', 'provider', 'mount', 'mount-output.aix.txt'))
- @mounter.expects(:mountcmd).returns(mount_data)
-
- @mounter.should be_mounted
+ it "should return true if prefetched value is :ghost" do
+ @mounter.stubs(:get).with(:ensure).returns(:ghost)
+ @mounter.mounted? == true
end
- it "should match ' on <name>' if the operating system is not Darwin, Solaris, or HP-UX" do
- Facter.stubs(:value).with("operatingsystem").returns("Debian")
- @mounter.expects(:mountcmd).returns("/dev/dsk/whatever on / and stuff\n/dev/other/disk on /var and stuff")
-
- @mounter.should be_mounted
+ it "should return false if prefetched value is :absent" do
+ @mounter.stubs(:get).with(:ensure).returns(:absent)
+ @mounter.mounted? == false
end
- it "should not be considered mounted if it did not match the mount output" do
- Facter.stubs(:value).with("operatingsystem").returns("Debian")
- @mounter.expects(:mountcmd).returns("/dev/dsk/whatever on /something/else and stuff\n/dev/other/disk on /var and stuff")
-
- @mounter.should_not be_mounted
+ it "should return false if prefetched value is :unmounted" do
+ @mounter.stubs(:get).with(:ensure).returns(:unmounted)
+ @mounter.mounted? == false
end
+
end
+
end
diff --git a/spec/unit/provider/ssh_authorized_key/parsed_spec.rb b/spec/unit/provider/ssh_authorized_key/parsed_spec.rb
index 11e9233e0..2e5be165a 100755
--- a/spec/unit/provider/ssh_authorized_key/parsed_spec.rb
+++ b/spec/unit/provider/ssh_authorized_key/parsed_spec.rb
@@ -104,6 +104,7 @@ describe provider_class do
before :each do
@resource = stub("resource", :name => "foo")
@resource.stubs(:[]).returns "foo"
+ @resource.class.stubs(:key_attributes).returns( [:name] )
@provider = provider_class.new(@resource)
provider_class.stubs(:filetype).returns(Puppet::Util::FileType::FileTypeRam)
diff --git a/spec/unit/provider/user/user_role_add_spec.rb b/spec/unit/provider/user/user_role_add_spec.rb
index 9cf649267..f73942389 100644
--- a/spec/unit/provider/user/user_role_add_spec.rb
+++ b/spec/unit/provider/user/user_role_add_spec.rb
@@ -115,6 +115,7 @@ describe provider_class do
describe "when allow duplicate is enabled" do
before do
@resource.expects(:allowdupe?).returns true
+ @resource.stubs(:system?)
@provider.stubs(:is_role?).returns(false)
@provider.stubs(:execute)
@provider.expects(:execute).with { |args| args.include?("-o") }
diff --git a/spec/unit/provider/user/useradd_spec.rb b/spec/unit/provider/user/useradd_spec.rb
index 9ebba596c..fd75c43f3 100755
--- a/spec/unit/provider/user/useradd_spec.rb
+++ b/spec/unit/provider/user/useradd_spec.rb
@@ -15,6 +15,7 @@ describe provider_class do
# #1360
it "should add -o when allowdupe is enabled and the user is being created" do
@resource.expects(:allowdupe?).returns true
+ @resource.expects(:system?).returns true
@provider.stubs(:execute)
@provider.expects(:execute).with { |args| args.include?("-o") }
@provider.create
@@ -27,6 +28,14 @@ describe provider_class do
@provider.uid = 150
end
+ it "should add -r when system is enabled" do
+ @resource.expects(:allowdupe?).returns true
+ @resource.expects(:system?).returns true
+ @provider.stubs(:execute)
+ @provider.expects(:execute).with { |args| args.include?("-r") }
+ @provider.create
+ end
+
it "should set password age rules" do
provider_class.has_feature :manages_password_age
@resource = Puppet::Type.type(:user).new :name => "myuser", :password_min_age => 5, :password_max_age => 10, :provider => :useradd
@@ -53,6 +62,23 @@ describe provider_class do
end
end
+ describe "when checking to add system users" do
+ it "should check system users" do
+ @resource.expects(:system?)
+ @provider.check_system_users
+ end
+
+ it "should return an array with a flag if it's a system user" do
+ @resource.stubs(:system?).returns true
+ @provider.check_system_users.must == ["-r"]
+ end
+
+ it "should return an empty array if it's not a system user" do
+ @resource.stubs(:system?).returns false
+ @provider.check_system_users.must == []
+ end
+ end
+
describe "when checking manage home" do
it "should check manage home" do
@resource.expects(:managehome?)
@@ -88,6 +114,7 @@ describe provider_class do
before do
@resource.stubs(:allowdupe?).returns true
@resource.stubs(:managehome?).returns true
+ @resource.stubs(:system?).returns true
end
it "should call command with :add" do
@@ -115,20 +142,32 @@ describe provider_class do
@provider.addcmd
end
+ it "should return an array with -r if system? is true" do
+ resource = Puppet::Type.type(:user).new( :name => "bob", :system => true)
+
+ provider_class.new( resource ).addcmd.should include("-r")
+ end
+
+ it "should return an array without -r if system? is false" do
+ resource = Puppet::Type.type(:user).new( :name => "bob", :system => false)
+
+ provider_class.new( resource ).addcmd.should_not include("-r")
+ end
+
it "should return an array with full command" do
@provider.stubs(:command).with(:add).returns("useradd")
@provider.stubs(:add_properties).returns(["-G", "somegroup"])
@resource.stubs(:[]).with(:name).returns("someuser")
@resource.stubs(:[]).with(:expiry).returns("somedate")
- @provider.addcmd.must == ["useradd", "-G", "somegroup", "-o", "-m", '-e somedate', "someuser"]
+ @provider.addcmd.must == ["useradd", "-G", "somegroup", "-o", "-m", '-e somedate', "-r", "someuser"]
end
- it "should return an array without -e if expery is undefined full command" do
+ it "should return an array without -e if expiry is undefined full command" do
@provider.stubs(:command).with(:add).returns("useradd")
@provider.stubs(:add_properties).returns(["-G", "somegroup"])
@resource.stubs(:[]).with(:name).returns("someuser")
@resource.stubs(:[]).with(:expiry).returns nil
- @provider.addcmd.must == ["useradd", "-G", "somegroup", "-o", "-m", "someuser"]
+ @provider.addcmd.must == ["useradd", "-G", "somegroup", "-o", "-m", "-r", "someuser"]
end
end
@@ -136,6 +175,7 @@ describe provider_class do
before do
@resource.stubs(:allowdupe?).returns true
@resource.stubs(:managehome?).returns true
+ @resource.stubs(:system?).returns true
end
it "should call command with :pass" do
diff --git a/spec/unit/reports/store_spec.rb b/spec/unit/reports/store_spec.rb
index 1acb5badd..9d9042386 100644
--- a/spec/unit/reports/store_spec.rb
+++ b/spec/unit/reports/store_spec.rb
@@ -11,7 +11,7 @@ describe processor do
describe "#process" do
include PuppetSpec::Files
before :each do
- Puppet[:reportdir] = tmpdir('reports')
+ Puppet[:reportdir] = tmpdir('reports') << '/reports'
@report = YAML.load_file(File.join(PuppetSpec::FIXTURE_DIR, 'yaml/report2.6.x.yaml')).extend processor
end
diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb
index ff31b2492..345ccd06e 100755
--- a/spec/unit/resource_spec.rb
+++ b/spec/unit/resource_spec.rb
@@ -99,11 +99,11 @@ describe Puppet::Resource do
end
it 'should fail if strict is set and type does not exist' do
- lambda { Puppet::Resource.new('foo', 'title', {:strict=>true}) }.should raise_error(ArgumentError, 'Invalid resource type foo')
+ lambda { Puppet::Resource.new('foo', 'title', {:strict=>true}) }.should raise_error(ArgumentError, 'Invalid resource type foo')
end
it 'should fail if strict is set and class does not exist' do
- lambda { Puppet::Resource.new('Class', 'foo', {:strict=>true}) }.should raise_error(ArgumentError, 'Could not find declared class foo')
+ lambda { Puppet::Resource.new('Class', 'foo', {:strict=>true}) }.should raise_error(ArgumentError, 'Could not find declared class foo')
end
it "should fail if the title is a hash and the type is not a valid resource reference string" do
@@ -463,6 +463,28 @@ describe Puppet::Resource do
end
end
+ describe "when loading 0.25.x storedconfigs YAML" do
+ before :each do
+ @old_storedconfig_yaml = %q{--- !ruby/object:Puppet::Resource::Reference
+builtin_type:
+title: /tmp/bar
+type: File
+}
+ end
+
+ it "should deserialize a Puppet::Resource::Reference without exceptions" do
+ lambda { YAML.load(@old_storedconfig_yaml) }.should_not raise_error
+ end
+
+ it "should deserialize as a Puppet::Resource::Reference as a Puppet::Resource" do
+ YAML.load(@old_storedconfig_yaml).class.should == Puppet::Resource
+ end
+
+ it "should to_hash properly" do
+ YAML.load(@old_storedconfig_yaml).to_hash.should == { :path => "/tmp/bar" }
+ end
+ end
+
describe "when converting to a RAL resource" do
it "should use the resource type's :new method to create the resource if the resource is of a builtin type" do
resource = Puppet::Resource.new("file", @basepath+"/my/file")
@@ -486,19 +508,23 @@ describe Puppet::Resource do
describe "when converting to puppet code" do
before do
- @resource = Puppet::Resource.new("one::two", "/my/file", :parameters => {:noop => true, :foo => %w{one two}})
- end
-
- it "should print the type and title" do
- @resource.to_manifest.should be_include("one::two { '/my/file':\n")
- end
-
- it "should print each parameter, with the value single-quoted" do
- @resource.to_manifest.should be_include(" noop => 'true'")
+ @resource = Puppet::Resource.new("one::two", "/my/file",
+ :parameters => {
+ :noop => true,
+ :foo => %w{one two},
+ :ensure => 'present',
+ }
+ )
end
- it "should print array values appropriately" do
- @resource.to_manifest.should be_include(" foo => ['one','two']")
+ it "should align, sort and add trailing commas to attributes with ensure first" do
+ @resource.to_manifest.should == <<-HEREDOC.gsub(/^\s{8}/, '').gsub(/\n$/, '')
+ one::two { '/my/file':
+ ensure => 'present',
+ foo => ['one', 'two'],
+ noop => 'true',
+ }
+ HEREDOC
end
end
diff --git a/spec/unit/type/file/content_spec.rb b/spec/unit/type/file/content_spec.rb
index 5ee26cc52..bd2b2adaf 100755
--- a/spec/unit/type/file/content_spec.rb
+++ b/spec/unit/type/file/content_spec.rb
@@ -4,15 +4,14 @@ Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f
content = Puppet::Type.type(:file).attrclass(:content)
describe content do
+ include PuppetSpec::Files
before do
- @resource = Puppet::Type.type(:file).new :path => "/foo/bar"
+ @filename = tmpfile('testfile')
+ @resource = Puppet::Type.type(:file).new :path => @filename
+ File.open(@filename, 'w') {|f| f.write "initial file content"}
content.stubs(:standalone?).returns(false)
end
- it "should be a subclass of Property" do
- content.superclass.must == Puppet::Property
- end
-
describe "when determining the checksum type" do
it "should use the type specified in the source checksum if a source is set" do
@resource[:source] = "/foo"
@@ -249,10 +248,10 @@ describe content do
describe "when writing" do
before do
@content = content.new(:resource => @resource)
- @fh = stub_everything
end
it "should attempt to read from the filebucket if no actual content nor source exists" do
+ @fh = File.open(@filename, 'w')
@content.should = "{md5}foo"
@content.resource.bucket.class.any_instance.stubs(:getfile).returns "foo"
@content.write(@fh)
@@ -302,166 +301,68 @@ describe content do
describe "from local source" do
before(:each) do
- @content.stubs(:actual_content).returns(nil)
- @source = stub_everything 'source', :local? => true, :full_path => "/path/to/source"
- @resource.stubs(:parameter).with(:source).returns @source
-
- @sum = stub_everything 'sum'
- @resource.stubs(:parameter).with(:checksum).returns(@sum)
-
- @digest = stub_everything 'digest'
- @sum.stubs(:sum_stream).yields(@digest)
-
- @file = stub_everything 'file'
- File.stubs(:open).yields(@file)
- @file.stubs(:read).with(8192).returns("chunk1").then.returns("chunk2").then.returns(nil)
- end
-
- it "should open the local file" do
- File.expects(:open).with("/path/to/source", "r")
- @content.write(@fh)
- end
+ @resource = Puppet::Type.type(:file).new :path => @filename, :backup => false
+ @sourcename = tmpfile('source')
+ @source_content = "source file content"*10000
+ @sourcefile = File.open(@sourcename, 'w') {|f| f.write @source_content}
- it "should read the local file by chunks" do
- @file.expects(:read).with(8192).returns("chunk1").then.returns(nil)
- @content.write(@fh)
+ @content = @resource.newattr(:content)
+ @source = @resource.newattr(:source)
+ @source.stubs(:metadata).returns stub_everything('metadata', :source => @sourcename, :ftype => 'file')
end
- it "should write each chunk to the file" do
- @fh.expects(:print).with("chunk1").then.with("chunk2")
- @content.write(@fh)
- end
-
- it "should pass each chunk to the current sum stream" do
- @digest.expects(:<<).with("chunk1").then.with("chunk2")
- @content.write(@fh)
+ it "should copy content from the source to the file" do
+ @resource.write(@source)
+ File.read(@filename).should == @source_content
end
it "should return the checksum computed" do
- @sum.stubs(:sum_stream).yields(@digest).returns("checksum")
- @content.write(@fh).should == "checksum"
+ File.open(@filename, 'w') do |file|
+ @content.write(file).should == "{md5}#{Digest::MD5.hexdigest(@source_content)}"
+ end
end
end
describe "from remote source" do
before(:each) do
- @response = stub_everything 'mock response', :code => "404"
+ @resource = Puppet::Type.type(:file).new :path => @filename, :backup => false
+ @response = stub_everything 'response', :code => "200"
+ @source_content = "source file content"*10000
+ @response.stubs(:read_body).multiple_yields(*(["source file content"]*10000))
+
@conn = stub_everything 'connection'
@conn.stubs(:request_get).yields(@response)
Puppet::Network::HttpPool.stubs(:http_instance).returns @conn
- @content.stubs(:actual_content).returns(nil)
- @source = stub_everything 'source', :local? => false, :full_path => "/path/to/source", :server => "server", :port => 1234
- @resource.stubs(:parameter).with(:source).returns @source
-
- @sum = stub_everything 'sum'
- @resource.stubs(:parameter).with(:checksum).returns(@sum)
-
- @digest = stub_everything 'digest'
- @sum.stubs(:sum_stream).yields(@digest)
- end
-
- it "should open a network connection to source server and port" do
- Puppet::Network::HttpPool.expects(:http_instance).with("server", 1234).returns @conn
- @content.write(@fh)
- end
-
- it "should send the correct indirection uri" do
- @conn.expects(:request_get).with { |uri,headers| uri == "/production/file_content/path/to/source" }.yields(@response)
- @content.write(@fh)
+ @content = @resource.newattr(:content)
+ @sourcename = "puppet:///test/foo"
+ @source = @resource.newattr(:source)
+ @source.stubs(:metadata).returns stub_everything('metadata', :source => @sourcename, :ftype => 'file')
end
- it "should return nil if source is not found" do
- @response.expects(:code).returns("404")
- @content.write(@fh).should == nil
+ it "should write the contents to the file" do
+ @resource.write(@source)
+ File.read(@filename).should == @source_content
end
it "should not write anything if source is not found" do
- @response.expects(:code).returns("404")
- @fh.expects(:print).never
- @content.write(@fh).should == nil
+ @response.stubs(:code).returns("404")
+ lambda {@resource.write(@source)}.should raise_error(Net::HTTPError) { |e| e.message =~ /404/ }
+ File.read(@filename).should == "initial file content"
end
it "should raise an HTTP error in case of server error" do
- @response.expects(:code).returns("500")
- lambda { @content.write(@fh) }.should raise_error
- end
-
- it "should write content by chunks" do
- @response.expects(:code).returns("200")
- @response.expects(:read_body).multiple_yields("chunk1","chunk2")
- @fh.expects(:print).with("chunk1").then.with("chunk2")
- @content.write(@fh)
- end
-
- it "should pass each chunk to the current sum stream" do
- @response.expects(:code).returns("200")
- @response.expects(:read_body).multiple_yields("chunk1","chunk2")
- @digest.expects(:<<).with("chunk1").then.with("chunk2")
- @content.write(@fh)
+ @response.stubs(:code).returns("500")
+ lambda { @content.write(@fh) }.should raise_error { |e| e.message.include? @source_content }
end
it "should return the checksum computed" do
- @response.expects(:code).returns("200")
- @response.expects(:read_body).multiple_yields("chunk1","chunk2")
- @sum.expects(:sum_stream).yields(@digest).returns("checksum")
- @content.write(@fh).should == "checksum"
- end
-
- it "should get the current accept encoding header value" do
- @content.expects(:add_accept_encoding)
- @content.write(@fh)
- end
-
- it "should uncompress body on error" do
- @response.expects(:code).returns("500")
- @response.expects(:body).returns("compressed body")
- @content.expects(:uncompress_body).with(@response).returns("uncompressed")
- lambda { @content.write(@fh) }.should raise_error { |e| e.message =~ /uncompressed/ }
- end
-
- it "should uncompress chunk by chunk" do
- uncompressor = stub_everything 'uncompressor'
- @content.expects(:uncompress).with(@response).yields(uncompressor)
- @response.expects(:code).returns("200")
- @response.expects(:read_body).multiple_yields("chunk1","chunk2")
-
- uncompressor.expects(:uncompress).with("chunk1").then.with("chunk2")
- @content.write(@fh)
- end
-
- it "should write uncompressed chunks to the file" do
- uncompressor = stub_everything 'uncompressor'
- @content.expects(:uncompress).with(@response).yields(uncompressor)
- @response.expects(:code).returns("200")
- @response.expects(:read_body).multiple_yields("chunk1","chunk2")
-
- uncompressor.expects(:uncompress).with("chunk1").returns("uncompressed1")
- uncompressor.expects(:uncompress).with("chunk2").returns("uncompressed2")
-
- @fh.expects(:print).with("uncompressed1")
- @fh.expects(:print).with("uncompressed2")
-
- @content.write(@fh)
- end
-
- it "should pass each uncompressed chunk to the current sum stream" do
- uncompressor = stub_everything 'uncompressor'
- @content.expects(:uncompress).with(@response).yields(uncompressor)
- @response.expects(:code).returns("200")
- @response.expects(:read_body).multiple_yields("chunk1","chunk2")
-
- uncompressor.expects(:uncompress).with("chunk1").returns("uncompressed1")
- uncompressor.expects(:uncompress).with("chunk2").returns("uncompressed2")
-
- @digest.expects(:<<).with("uncompressed1").then.with("uncompressed2")
- @content.write(@fh)
+ File.open(@filename, 'w') do |file|
+ @content.write(file).should == "{md5}#{Digest::MD5.hexdigest(@source_content)}"
+ end
end
end
- describe "from a filebucket" do
- end
-
# These are testing the implementation rather than the desired behaviour; while that bites, there are a whole
# pile of other methods in the File type that depend on intimate details of this implementation and vice-versa.
# If these blow up, you are gonna have to review the callers to make sure they don't explode! --daniel 2011-02-01
diff --git a/spec/unit/type/file/selinux_spec.rb b/spec/unit/type/file/selinux_spec.rb
index 043471dec..a2444acd9 100644
--- a/spec/unit/type/file/selinux_spec.rb
+++ b/spec/unit/type/file/selinux_spec.rb
@@ -66,6 +66,11 @@ Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f
@sel.default.must == expectedresult
end
+ it "should return nil for defaults if selinux_ignore_defaults is true" do
+ @resource[:selinux_ignore_defaults] = :true
+ @sel.default.must be_nil
+ end
+
it "should be able to set a new context" do
stat = stub 'stat', :ftype => "foo"
@sel.should = %w{newone}
diff --git a/spec/unit/type/mount_spec.rb b/spec/unit/type/mount_spec.rb
index 0d74042e3..fdb67f7d5 100755
--- a/spec/unit/type/mount_spec.rb
+++ b/spec/unit/type/mount_spec.rb
@@ -11,10 +11,14 @@ describe Puppet::Type.type(:mount) do
mount = Puppet::Type.type(:mount).new(:name => "yay")
mount.should(:ensure).should be_nil
end
+
+ it "should have :name as the only keyattribut" do
+ Puppet::Type.type(:mount).key_attributes.should == [:name]
+ end
end
describe Puppet::Type.type(:mount), "when validating attributes" do
- [:name, :remounts].each do |param|
+ [:name, :remounts, :provider].each do |param|
it "should have a #{param} parameter" do
Puppet::Type.type(:mount).attrtype(param).should == :param
end
@@ -38,9 +42,16 @@ describe Puppet::Type.type(:mount)::Ensure, "when validating values" do
mount.should(:ensure).should == :defined
end
+ it "should support :present as a value to :ensure" do
+ Puppet::Type.type(:mount).new(:name => "yay", :ensure => :present)
+ end
+
+ it "should support :defined as a value to :ensure" do
+ Puppet::Type.type(:mount).new(:name => "yay", :ensure => :defined)
+ end
+
it "should support :unmounted as a value to :ensure" do
- mount = Puppet::Type.type(:mount).new(:name => "yay", :ensure => :unmounted)
- mount.should(:ensure).should == :unmounted
+ Puppet::Type.type(:mount).new(:name => "yay", :ensure => :unmounted)
end
it "should support :absent as a value to :ensure" do
@@ -54,7 +65,8 @@ end
describe Puppet::Type.type(:mount)::Ensure do
before :each do
- @provider = stub 'provider', :class => Puppet::Type.type(:mount).defaultprovider, :clear => nil, :satisfies? => true, :name => :mock
+ provider_properties = {}
+ @provider = stub 'provider', :class => Puppet::Type.type(:mount).defaultprovider, :clear => nil, :satisfies? => true, :name => :mock, :property_hash => provider_properties
Puppet::Type.type(:mount).defaultprovider.stubs(:new).returns(@provider)
@mount = Puppet::Type.type(:mount).new(:name => "yay", :check => :ensure)
@@ -74,134 +86,150 @@ describe Puppet::Type.type(:mount)::Ensure do
end
end
- describe Puppet::Type.type(:mount)::Ensure, "when retrieving its current state" do
-
- it "should return the provider's value if it is :absent" do
- @provider.expects(:ensure).returns(:absent)
- @ensure.retrieve.should == :absent
- end
-
- it "should return :mounted if the provider indicates it is mounted and the value is not :absent" do
- @provider.expects(:ensure).returns(:present)
- @provider.expects(:mounted?).returns(true)
- @ensure.retrieve.should == :mounted
- end
-
- it "should return :unmounted if the provider indicates it is not mounted and the value is not :absent" do
- @provider.expects(:ensure).returns(:present)
- @provider.expects(:mounted?).returns(false)
- @ensure.retrieve.should == :unmounted
- end
- end
-
describe Puppet::Type.type(:mount)::Ensure, "when changing the host" do
- it "should destroy itself if it should be absent" do
- @provider.stubs(:mounted?).returns(false)
- @provider.expects(:destroy)
- @ensure.should = :absent
- @ensure.sync
- end
-
- it "should unmount itself before destroying if it is mounted and should be absent" do
- @provider.expects(:mounted?).returns(true)
- @provider.expects(:unmount)
- @provider.expects(:destroy)
- @ensure.should = :absent
- @ensure.sync
- end
-
- it "should create itself if it is absent and should be defined" do
- @provider.stubs(:ensure).returns(:absent)
- @provider.stubs(:mounted?).returns(true)
-
- @provider.stubs(:mounted?).returns(false)
- @provider.expects(:create)
- @ensure.should = :defined
- @ensure.sync
- end
-
- it "should not unmount itself if it is mounted and should be defined" do
- @provider.stubs(:ensure).returns(:mounted)
- @provider.stubs(:mounted?).returns(true)
-
- @provider.stubs(:create)
- @provider.expects(:mount).never
- @provider.expects(:unmount).never
- @ensure.should = :defined
- @ensure.sync
- end
-
- it "should not mount itself if it is unmounted and should be defined" do
- @provider.stubs(:ensure).returns(:unmounted)
- @provider.stubs(:mounted?).returns(false)
-
- @ensure.stubs(:syncothers)
- @provider.stubs(:create)
+ def test_ensure_change(options)
+ @provider.stubs(:get).with(:ensure).returns options[:from]
+ @provider.stubs(:ensure).returns options[:from]
+ @provider.stubs(:mounted?).returns([:mounted,:ghost].include? options[:from])
+ @provider.expects(:create).times(options[:create] || 0)
+ @provider.expects(:destroy).times(options[:destroy] || 0)
@provider.expects(:mount).never
- @provider.expects(:unmount).never
- @ensure.should = :present
- @ensure.sync
- end
-
- it "should unmount itself if it is mounted and should be unmounted" do
- @provider.stubs(:ensure).returns(:present)
- @provider.stubs(:mounted?).returns(true)
-
+ @provider.expects(:unmount).times(options[:unmount] || 0)
@ensure.stubs(:syncothers)
- @provider.expects(:unmount)
- @ensure.should = :unmounted
+ @ensure.should = options[:to]
@ensure.sync
- end
+ (!!@provider.property_hash[:needs_mount]).should == (!!options[:mount])
+ end
+
+ it "should create itself when changing from :ghost to :present" do
+ test_ensure_change(:from => :ghost, :to => :present, :create => 1)
+ end
+
+ it "should create itself when changing from :absent to :present" do
+ test_ensure_change(:from => :absent, :to => :present, :create => 1)
+ end
- it "should create and mount itself if it does not exist and should be mounted" do
- @provider.stubs(:ensure).returns(:absent)
- @provider.stubs(:mounted?).returns(false)
- @provider.expects(:create)
- @ensure.stubs(:syncothers)
- @provider.expects(:mount)
- @ensure.should = :mounted
- @ensure.sync
- end
+ it "should create itself and unmount when changing from :ghost to :unmounted" do
+ test_ensure_change(:from => :ghost, :to => :unmounted, :create => 1, :unmount => 1)
+ end
+
+ it "should unmount resource when changing from :mounted to :unmounted" do
+ test_ensure_change(:from => :mounted, :to => :unmounted, :unmount => 1)
+ end
+
+ it "should create itself when changing from :absent to :unmounted" do
+ test_ensure_change(:from => :absent, :to => :unmounted, :create => 1)
+ end
+
+ it "should unmount resource when changing from :ghost to :absent" do
+ test_ensure_change(:from => :ghost, :to => :absent, :unmount => 1)
+ end
+
+ it "should unmount and destroy itself when changing from :mounted to :absent" do
+ test_ensure_change(:from => :mounted, :to => :absent, :destroy => 1, :unmount => 1)
+ end
+
+ it "should destroy itself when changing from :unmounted to :absent" do
+ test_ensure_change(:from => :unmounted, :to => :absent, :destroy => 1)
+ end
+
+ it "should create itself when changing from :ghost to :mounted" do
+ test_ensure_change(:from => :ghost, :to => :mounted, :create => 1)
+ end
+
+ it "should create itself and mount when changing from :absent to :mounted" do
+ test_ensure_change(:from => :absent, :to => :mounted, :create => 1, :mount => 1)
+ end
+
+ it "should mount resource when changing from :unmounted to :mounted" do
+ test_ensure_change(:from => :unmounted, :to => :mounted, :mount => 1)
+ end
+
+
+ it "should be in sync if it is :absent and should be :absent" do
+ @ensure.should = :absent
+ @ensure.safe_insync?(:absent).should == true
+ end
+
+ it "should be out of sync if it is :absent and should be :defined" do
+ @ensure.should = :defined
+ @ensure.safe_insync?(:absent).should == false
+ end
+
+ it "should be out of sync if it is :absent and should be :mounted" do
+ @ensure.should = :mounted
+ @ensure.safe_insync?(:absent).should == false
+ end
+
+ it "should be out of sync if it is :absent and should be :unmounted" do
+ @ensure.should = :unmounted
+ @ensure.safe_insync?(:absent).should == false
+ end
+
+ it "should be out of sync if it is :mounted and should be :absent" do
+ @ensure.should = :absent
+ @ensure.safe_insync?(:mounted).should == false
+ end
+
+ it "should be in sync if it is :mounted and should be :defined" do
+ @ensure.should = :defined
+ @ensure.safe_insync?(:mounted).should == true
+ end
+
+ it "should be in sync if it is :mounted and should be :mounted" do
+ @ensure.should = :mounted
+ @ensure.safe_insync?(:mounted).should == true
+ end
+
+ it "should be out in sync if it is :mounted and should be :unmounted" do
+ @ensure.should = :unmounted
+ @ensure.safe_insync?(:mounted).should == false
+ end
+
+
+ it "should be out of sync if it is :unmounted and should be :absent" do
+ @ensure.should = :absent
+ @ensure.safe_insync?(:unmounted).should == false
+ end
+
+ it "should be in sync if it is :unmounted and should be :defined" do
+ @ensure.should = :defined
+ @ensure.safe_insync?(:unmounted).should == true
+ end
+
+ it "should be out of sync if it is :unmounted and should be :mounted" do
+ @ensure.should = :mounted
+ @ensure.safe_insync?(:unmounted).should == false
+ end
+
+ it "should be in sync if it is :unmounted and should be :unmounted" do
+ @ensure.should = :unmounted
+ @ensure.safe_insync?(:unmounted).should == true
+ end
- it "should mount itself if it is present and should be mounted" do
- @provider.stubs(:ensure).returns(:present)
- @provider.stubs(:mounted?).returns(false)
- @ensure.stubs(:syncothers)
- @provider.expects(:mount)
- @ensure.should = :mounted
- @ensure.sync
- end
- it "should create but not mount itself if it is absent and mounted and should be mounted" do
- @provider.stubs(:ensure).returns(:absent)
- @provider.stubs(:mounted?).returns(true)
- @ensure.stubs(:syncothers)
- @provider.expects(:create)
- @ensure.should = :mounted
- @ensure.sync
- end
-
- it "should be insync if it is mounted and should be defined" do
- @ensure.should = :defined
- @ensure.safe_insync?(:mounted).should == true
- end
-
- it "should be insync if it is unmounted and should be defined" do
- @ensure.should = :defined
- @ensure.safe_insync?(:unmounted).should == true
- end
+ it "should be out of sync if it is :ghost and should be :absent" do
+ @ensure.should = :absent
+ @ensure.safe_insync?(:ghost).should == false
+ end
- it "should be insync if it is mounted and should be present" do
- @ensure.should = :present
- @ensure.safe_insync?(:mounted).should == true
- end
+ it "should be out of sync if it is :ghost and should be :defined" do
+ @ensure.should = :defined
+ @ensure.safe_insync?(:ghost).should == false
+ end
+
+ it "should be out of sync if it is :ghost and should be :mounted" do
+ @ensure.should = :mounted
+ @ensure.safe_insync?(:ghost).should == false
+ end
+
+ it "should be out of sync if it is :ghost and should be :unmounted" do
+ @ensure.should = :unmounted
+ @ensure.safe_insync?(:ghost).should == false
+ end
- it "should be insync if it is unmounted and should be present" do
- @ensure.should = :present
- @ensure.safe_insync?(:unmounted).should == true
- end
- end
+ end
describe Puppet::Type.type(:mount), "when responding to events" do
@@ -258,4 +286,21 @@ describe Puppet::Type.type(:mount), "when modifying an existing mount entry" do
@catalog.apply
end
+
+ it "should umount before flushing changes to disk" do
+ syncorder = sequence('syncorder')
+ @mount.provider.expects(:options).returns 'soft'
+ @mount.provider.expects(:ensure).returns :mounted
+
+ @mount.provider.expects(:unmount).in_sequence(syncorder)
+ @mount.provider.expects(:options=).in_sequence(syncorder).with 'hard'
+ @mount.expects(:flush).in_sequence(syncorder) # Call inside syncothers
+ @mount.expects(:flush).in_sequence(syncorder) # I guess transaction or anything calls flush again
+
+ @mount[:ensure] = :unmounted
+ @mount[:options] = 'hard'
+
+ @catalog.apply
+ end
+
end
diff --git a/spec/unit/type/user_spec.rb b/spec/unit/type/user_spec.rb
index 297134446..5a84af443 100755
--- a/spec/unit/type/user_spec.rb
+++ b/spec/unit/type/user_spec.rb
@@ -43,6 +43,10 @@ describe user do
user.provider_feature(:manages_password_age).should_not be_nil
end
+ it "should have a system_users feature" do
+ user.provider_feature(:system_users).should_not be_nil
+ end
+
describe "instances" do
it "should have a valid provider" do
user.new(:name => "foo").provider.class.ancestors.should be_include(Puppet::Provider)
diff --git a/spec/unit/type_spec.rb b/spec/unit/type_spec.rb
index b7a08977e..6d9d0b234 100755
--- a/spec/unit/type_spec.rb
+++ b/spec/unit/type_spec.rb
@@ -434,7 +434,7 @@ describe Puppet::Type do
patterns.length.should == 1
patterns[0].length.should == 2
end
-
+
it "should have a regexp that captures the entire string" do
patterns = @type_class.title_patterns
string = "abc\n\tdef"
@@ -570,4 +570,15 @@ describe Puppet::Type.metaparamclass(:audit) do
@resource[:audit] = :noop
@resource.parameter(:noop).should be_nil
end
+
+ describe "when generating the uniqueness key" do
+ it "should include all of the key_attributes in alphabetical order by attribute name" do
+ Puppet::Type.type(:file).stubs(:key_attributes).returns [:path, :mode, :owner]
+ Puppet::Type.type(:file).stubs(:title_patterns).returns(
+ [ [ /(.*)/, [ [:path, lambda{|x| x} ] ] ] ]
+ )
+ res = Puppet::Type.type(:file).new( :title => '/my/file', :path => '/my/file', :owner => 'root', :content => 'hello' )
+ res.uniqueness_key.should == [ nil, 'root', '/my/file']
+ end
+ end
end
diff --git a/spec/unit/util/execution_spec.rb b/spec/unit/util/execution_spec.rb
new file mode 100644
index 000000000..312dd3b8e
--- /dev/null
+++ b/spec/unit/util/execution_spec.rb
@@ -0,0 +1,49 @@
+#!/usr/bin/env ruby
+
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe Puppet::Util::Execution do
+ include Puppet::Util::Execution
+ describe "#withenv" do
+ before :each do
+ @original_path = ENV["PATH"]
+ @new_env = {:PATH => "/some/bogus/path"}
+ end
+
+ it "should change environment variables within the block then reset environment variables to their original values" do
+ withenv @new_env do
+ ENV["PATH"].should == "/some/bogus/path"
+ end
+ ENV["PATH"].should == @original_path
+ end
+
+ it "should reset environment variables to their original values even if the block fails" do
+ begin
+ withenv @new_env do
+ ENV["PATH"].should == "/some/bogus/path"
+ raise "This is a failure"
+ end
+ rescue
+ end
+ ENV["PATH"].should == @original_path
+ end
+
+ it "should reset environment variables even when they are set twice" do
+ # Setting Path & Environment parameters in Exec type can cause weirdness
+ @new_env["PATH"] = "/someother/bogus/path"
+ withenv @new_env do
+ # When assigning duplicate keys, can't guarantee order of evaluation
+ ENV["PATH"].should =~ /\/some.*\/bogus\/path/
+ end
+ ENV["PATH"].should == @original_path
+ end
+
+ it "should remove any new environment variables after the block ends" do
+ @new_env[:FOO] = "bar"
+ withenv @new_env do
+ ENV["FOO"].should == "bar"
+ end
+ ENV["FOO"].should == nil
+ end
+ end
+end
diff --git a/spec/unit/util/execution_stub_spec.rb b/spec/unit/util/execution_stub_spec.rb
new file mode 100644
index 000000000..14cf9c67a
--- /dev/null
+++ b/spec/unit/util/execution_stub_spec.rb
@@ -0,0 +1,35 @@
+#!/usr/bin/env ruby
+
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe Puppet::Util::ExecutionStub do
+ it "should use the provided stub code when 'set' is called" do
+ Puppet::Util::ExecutionStub.set do |command, options|
+ command.should == ['/bin/foo', 'bar']
+ "stub output"
+ end
+ Puppet::Util::ExecutionStub.current_value.should_not == nil
+ Puppet::Util.execute(['/bin/foo', 'bar']).should == "stub output"
+ end
+
+ it "should automatically restore normal execution at the conclusion of each spec test" do
+ # Note: this test relies on the previous test creating a stub.
+ Puppet::Util::ExecutionStub.current_value.should == nil
+ end
+
+ it "should restore normal execution after 'reset' is called" do
+ true_command = Puppet::Util.which('true') # Note: "true" exists at different paths in different OSes
+ stub_call_count = 0
+ Puppet::Util::ExecutionStub.set do |command, options|
+ command.should == [true_command]
+ stub_call_count += 1
+ 'stub called'
+ end
+ Puppet::Util.execute([true_command]).should == 'stub called'
+ stub_call_count.should == 1
+ Puppet::Util::ExecutionStub.reset
+ Puppet::Util::ExecutionStub.current_value.should == nil
+ Puppet::Util.execute([true_command]).should == ''
+ stub_call_count.should == 1
+ end
+end
diff --git a/spec/unit/util/rdoc/parser_spec.rb b/spec/unit/util/rdoc/parser_spec.rb
index 28c33c295..b4453ae86 100755
--- a/spec/unit/util/rdoc/parser_spec.rb
+++ b/spec/unit/util/rdoc/parser_spec.rb
@@ -43,6 +43,18 @@ describe RDoc::Parser do
@parser.scan.should be_a(RDoc::PuppetTopLevel)
end
+
+ it "should scan the top level even if the file has already parsed" do
+ known_type = stub 'known_types'
+ env = stub 'env'
+ Puppet::Node::Environment.stubs(:new).returns(env)
+ env.stubs(:known_resource_types).returns(known_type)
+ known_type.expects(:watching_file?).with("module/manifests/init.pp").returns(true)
+
+ @parser.expects(:scan_top_level)
+
+ @parser.scan
+ end
end
describe "when scanning top level entities" do
@@ -339,7 +351,7 @@ describe RDoc::Parser do
describe "when scanning for includes and requires" do
def create_stmt(name)
- stmt_value = stub "#{name}_value", :value => "myclass"
+ stmt_value = stub "#{name}_value", :to_s => "myclass"
Puppet::Parser::AST::Function.new(
:name => name,
@@ -357,13 +369,13 @@ describe RDoc::Parser do
it "should also scan mono-instruction code" do
@class.expects(:add_include).with { |i| i.is_a?(RDoc::Include) and i.name == "myclass" and i.comment == "mydoc" }
- @parser.scan_for_include_or_require(@class,create_stmt("include"))
+ @parser.scan_for_include_or_require(@class, create_stmt("include"))
end
it "should register recursively includes to the current container" do
@code.stubs(:children).returns([ create_stmt("include") ])
- @class.expects(:add_include).with { |i| i.is_a?(RDoc::Include) and i.name == "myclass" and i.comment == "mydoc" }
+ @class.expects(:add_include)#.with { |i| i.is_a?(RDoc::Include) and i.name == "myclass" and i.comment == "mydoc" }
@parser.scan_for_include_or_require(@class, [@code])
end
diff --git a/spec/unit/util/settings_spec.rb b/spec/unit/util/settings_spec.rb
index 7bca44b76..07b712c08 100755
--- a/spec/unit/util/settings_spec.rb
+++ b/spec/unit/util/settings_spec.rb
@@ -284,7 +284,8 @@ describe Puppet::Util::Settings do
@settings = Puppet::Util::Settings.new
@settings.setdefaults :section,
:config => ["/my/file", "a"],
- :one => ["ONE", "a"]
+ :one => ["ONE", "a"],
+ :two => ["TWO", "b"]
FileTest.stubs(:exist?).returns true
Puppet.stubs(:run_mode).returns stub('run_mode', :name => :mymode)
end
@@ -331,12 +332,20 @@ describe Puppet::Util::Settings do
@settings.value(:one, "env").should == "envval"
end
- it "should interpolate found values using the current environment" do
+ it 'should use the current environment for $environment' do
@settings.setdefaults :main, :myval => ["$environment/foo", "mydocs"]
@settings.value(:myval, "myenv").should == "myenv/foo"
end
+ it "should interpolate found values using the current environment" do
+ text = "[main]\none = mainval\n[myname]\none = nameval\ntwo = $one/two\n"
+ @settings.stubs(:read_file).returns(text)
+ @settings.parse
+
+ @settings.value(:two, "myname").should == "nameval/two"
+ end
+
it "should return values in a specified environment before values in the main or name sections" do
text = "[env]\none = envval\n[main]\none = mainval\n[myname]\none = nameval\n"
@settings.stubs(:read_file).returns(text)
diff --git a/tasks/rake/git_workflow.rake b/tasks/rake/git_workflow.rake
index b2f96c603..980d2fbce 100644
--- a/tasks/rake/git_workflow.rake
+++ b/tasks/rake/git_workflow.rake
@@ -1,5 +1,5 @@
# This set of tasks helps automate the workflow as described on
-# http://reductivelabs.com/trac/puppet/wiki/Development/DevelopmentLifecycle
+# http://projects.puppetlabs.com/projects/puppet/wiki/Development_Lifecycle
def find_start(start)
diff --git a/test/Rakefile b/test/Rakefile
index 47be213d9..7cde050f6 100644
--- a/test/Rakefile
+++ b/test/Rakefile
@@ -94,5 +94,3 @@ filemap.each do |dir, files|
# And alias it with a slash on the end
task(dir + "/" => dir)
end
-
-# $Id$
diff --git a/test/data/providers/mount/parsed/aix.mount b/test/data/providers/mount/parsed/aix.mount
new file mode 100644
index 000000000..380dbc5ae
--- /dev/null
+++ b/test/data/providers/mount/parsed/aix.mount
@@ -0,0 +1,7 @@
+node mounted mounted over vfs date options
+---- ------- ------------ --- ------------ -------------------
+ /dev/hd0 / jfs Dec 17 08:04 rw, log =/dev/hd8
+ /dev/hd3 /tmp jfs Dec 17 08:04 rw, log =/dev/hd8
+ /dev/hd1 /home jfs Dec 17 08:06 rw, log =/dev/hd8
+ /dev/hd2 /usr jfs Dec 17 08:06 rw, log =/dev/hd8
+sue /home/local/src /usr/code nfs Dec 17 08:06 ro, log =/dev/hd8
diff --git a/test/data/providers/mount/parsed/darwin.mount b/test/data/providers/mount/parsed/darwin.mount
new file mode 100644
index 000000000..1bdfcf89a
--- /dev/null
+++ b/test/data/providers/mount/parsed/darwin.mount
@@ -0,0 +1,6 @@
+/dev/disk0s2 on / (hfs, local, journaled)
+devfs on /dev (devfs, local, nobrowse)
+map -hosts on /net (autofs, nosuid, automounted, nobrowse)
+map auto_home on /home (autofs, automounted, nobrowse)
+/dev/disk0s3 on /usr (hfs, local, journaled)
+/dev/fake on /ghost (hfs, local, journaled)
diff --git a/test/data/providers/mount/parsed/hpux.mount b/test/data/providers/mount/parsed/hpux.mount
new file mode 100644
index 000000000..d414fa47a
--- /dev/null
+++ b/test/data/providers/mount/parsed/hpux.mount
@@ -0,0 +1,17 @@
+/ on rpool/ROOT/opensolaris read/write/setuid/devices/dev=2d90002 on Wed Dec 31 16:00:00 1969
+/devices on /devices read/write/setuid/devices/dev=4a00000 on Thu Feb 17 14:34:02 2011
+/dev on /dev read/write/setuid/devices/dev=4a40000 on Thu Feb 17 14:34:02 2011
+/system/contract on ctfs read/write/setuid/devices/dev=4ac0001 on Thu Feb 17 14:34:02 2011
+/proc on proc read/write/setuid/devices/dev=4b00000 on Thu Feb 17 14:34:02 2011
+/etc/mnttab on mnttab read/write/setuid/devices/dev=4b40001 on Thu Feb 17 14:34:02 2011
+/etc/svc/volatile on swap read/write/setuid/devices/xattr/dev=4b80001 on Thu Feb 17 14:34:02 2011
+/system/object on objfs read/write/setuid/devices/dev=4bc0001 on Thu Feb 17 14:34:02 2011
+/etc/dfs/sharetab on sharefs read/write/setuid/devices/dev=4c00001 on Thu Feb 17 14:34:02 2011
+/lib/libc.so.1 on /usr/lib/libc/libc_hwcap1.so.1 read/write/setuid/devices/dev=2d90002 on Thu Feb 17 14:34:14 2011
+/dev/fd on fd read/write/setuid/devices/dev=4d00001 on Thu Feb 17 14:34:18 2011
+/tmp on swap read/write/setuid/devices/xattr/dev=4b80002 on Thu Feb 17 14:34:19 2011
+/var/run on swap read/write/setuid/devices/xattr/dev=4b80003 on Thu Feb 17 14:34:19 2011
+/export on rpool/export read/write/setuid/devices/nonbmand/exec/xattr/atime/dev=2d90006 on Thu Feb 17 14:37:48 2011
+/export/home on rpool/export/home read/write/setuid/devices/nonbmand/exec/xattr/atime/dev=2d90007 on Thu Feb 17 14:37:48 2011
+/rpool on rpool read/write/setuid/devices/nonbmand/exec/xattr/atime/dev=2d90009 on Thu Feb 17 14:37:48 2011
+/ghost on /dev/fake read/write/setuid/devices/nonbmand/exec/xattr/atime/dev=2d90009 on Thu Feb 17 14:37:48 2011
diff --git a/test/data/providers/mount/parsed/linux.mount b/test/data/providers/mount/parsed/linux.mount
new file mode 100644
index 000000000..75dd71fd4
--- /dev/null
+++ b/test/data/providers/mount/parsed/linux.mount
@@ -0,0 +1,5 @@
+/dev/root on / type jfs (rw,noatime)
+rc-svcdir on /lib64/rc/init.d type tmpfs (rw,nosuid,nodev,noexec,relatime,size=1024k,mode=755)
+sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
+/dev/sda9 on /usr/portage type jfs (rw)
+/dev/fake on /ghost type jfs (rw)
diff --git a/test/data/providers/mount/parsed/solaris.mount b/test/data/providers/mount/parsed/solaris.mount
new file mode 100644
index 000000000..26fabc575
--- /dev/null
+++ b/test/data/providers/mount/parsed/solaris.mount
@@ -0,0 +1,6 @@
+/ on /dev/dsk/c0t0d0s0 read/write/setuid/intr/largefiles/xattr/onerror=panic/dev=2200000 on Mon Mar 18 08:48:45 2002
+/proc on /proc read/write/setuid/dev=4300000 on Mon Mar 18 08:48:44 2002
+/etc/mnttab on mnttab read/write/setuid/dev=43c0000 on Mon Mar 18 08:48:44 2002
+/tmp on swap read/write/setuid/xattr/dev=2 on Mon Mar 18 08:48:52 2002
+/export/home on /dev/dsk/c0t0d0s7 read/write/setuid/intr/largefiles/xattr/onerror=panic/dev=2200007 on Mon Mar 18
+/ghost on /dev/dsk/c0t1d0s7 read/write/setuid/intr/largefiles/xattr/onerror=panic/dev=2200007 on Mon Mar 18
diff --git a/test/data/types/mount/linux.fstab b/test/data/types/mount/linux.fstab
index b1debff9c..c94ec7fa8 100644
--- a/test/data/types/mount/linux.fstab
+++ b/test/data/types/mount/linux.fstab
@@ -9,3 +9,4 @@ proc /proc proc defaults 0 0
/dev/vg00/lv01 /spare ext3 defaults 1 2
sysfs /sys sysfs defaults 0 0
LABEL=SWAP-hda6 swap swap defaults 0 0
+/dev/sda1 /usr xfs noatime 0 0
diff --git a/test/data/types/mount/solaris.fstab b/test/data/types/mount/solaris.fstab
index 54afc898c..348b9d50b 100644
--- a/test/data/types/mount/solaris.fstab
+++ b/test/data/types/mount/solaris.fstab
@@ -9,3 +9,4 @@ fd - /dev/fd fd - no -
ctfs - /system/contract ctfs - no -
objfs - /system/object objfs - no -
#swap - /tmp tmpfs - yes -
+/dev/dsk/c0d0s2 /dev/rdsk/c0d0s2 /usr ufs 1 no -