summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/defaults.rb13
-rw-r--r--lib/puppet/file_serving/configuration/parser.rb6
-rw-r--r--lib/puppet/indirector/facts/facter.rb3
-rw-r--r--lib/puppet/indirector/node/ldap.rb3
-rw-r--r--lib/puppet/indirector/node/plain.rb7
-rw-r--r--lib/puppet/indirector/report/processor.rb3
-rw-r--r--lib/puppet/indirector/yaml.rb5
-rw-r--r--lib/puppet/metatype/evaluation.rb16
-rw-r--r--lib/puppet/metatype/providers.rb11
-rwxr-xr-xlib/puppet/network/authstore.rb3
-rw-r--r--lib/puppet/network/client.rb5
-rw-r--r--lib/puppet/network/client/master.rb6
-rw-r--r--lib/puppet/network/handler/master.rb2
-rwxr-xr-xlib/puppet/network/handler/report.rb3
-rw-r--r--lib/puppet/network/http/mongrel/rest.rb6
-rw-r--r--lib/puppet/network/http/webrick/rest.rb8
-rw-r--r--lib/puppet/network/http_pool.rb25
-rw-r--r--lib/puppet/node.rb2
-rw-r--r--lib/puppet/node/environment.rb3
-rw-r--r--lib/puppet/parser/parser_support.rb21
-rwxr-xr-xlib/puppet/provider/mailalias/aliases.rb5
-rwxr-xr-xlib/puppet/provider/package/openbsd.rb12
-rw-r--r--lib/puppet/provider/zone/solaris.rb3
-rw-r--r--lib/puppet/resource_reference.rb3
-rwxr-xr-xlib/puppet/type/host.rb3
-rw-r--r--lib/puppet/type/service.rb4
-rw-r--r--lib/puppet/util.rb3
-rw-r--r--lib/puppet/util/constant_inflector.rb3
-rw-r--r--lib/puppet/util/diff.rb4
-rw-r--r--lib/puppet/util/fileparsing.rb3
-rw-r--r--lib/puppet/util/tagging.rb3
31 files changed, 125 insertions, 72 deletions
diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb
index 8dcc46a8e..0f01c2ee2 100644
--- a/lib/puppet/defaults.rb
+++ b/lib/puppet/defaults.rb
@@ -346,11 +346,15 @@ module Puppet
:ssl_client_header => ["HTTP_X_CLIENT_DN", "The header containing an authenticated
client's SSL DN. Only used with Mongrel. This header must be set by the proxy
to the authenticated client's SSL DN (e.g., ``/CN=puppet.reductivelabs.com``).
- See the http://reductivelabs.com/puppet/trac/wiki/UsingMongrel page for more information."],
+ See http://reductivelabs.com/puppet/trac/wiki/UsingMongrel for more information."],
:ssl_client_verify_header => ["HTTP_X_CLIENT_VERIFY", "The header containing the status
message of the client verification. Only used with Mongrel. This header must be set by the proxy
to 'SUCCESS' if the client successfully authenticated, and anything else otherwise.
- See the http://reductivelabs.com/puppet/trac/wiki/UsingMongrel page for more information."]
+ See http://reductivelabs.com/puppet/trac/wiki/UsingMongrel for more information."],
+ # To make sure this directory is created before we try to use it on the server, we need
+ # it to be in the server section (#1138).
+ :yamldir => {:default => "$vardir/yaml", :owner => "$user", :group => "$user", :mode => "750",
+ :desc => "The directory in which YAML data is stored, usually in a subdirectory."}
)
self.setdefaults(:puppetd,
@@ -671,10 +675,5 @@ module Puppet
:rrdinterval => ["$runinterval", "How often RRD should expect data.
This should match how often the hosts report back to the server."]
)
-
- Puppet.setdefaults(:yaml,
- :yamldir => {:default => "$vardir/yaml", :owner => "$user", :group => "$user", :mode => "750",
- :desc => "The directory in which YAML data is stored, usually in a subdirectory."}
- )
end
diff --git a/lib/puppet/file_serving/configuration/parser.rb b/lib/puppet/file_serving/configuration/parser.rb
index 707c3f9b1..cda6889d4 100644
--- a/lib/puppet/file_serving/configuration/parser.rb
+++ b/lib/puppet/file_serving/configuration/parser.rb
@@ -62,7 +62,8 @@ class Puppet::FileServing::Configuration::Parser < Puppet::Util::LoadedFile
# Allow a given pattern access to a mount.
def allow(mount, value)
- value.split(/\s*,\s*/).each { |val|
+ # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
+ x = value.split(/\s*,\s*/).each { |val|
begin
mount.info "allowing %s access" % val
mount.allow(val)
@@ -75,7 +76,8 @@ class Puppet::FileServing::Configuration::Parser < Puppet::Util::LoadedFile
# Deny a given pattern access to a mount.
def deny(mount, value)
- value.split(/\s*,\s*/).each { |val|
+ # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
+ x = value.split(/\s*,\s*/).each { |val|
begin
mount.info "denying %s access" % val
mount.deny(val)
diff --git a/lib/puppet/indirector/facts/facter.rb b/lib/puppet/indirector/facts/facter.rb
index 5b9a7b3c0..a8c47e3bf 100644
--- a/lib/puppet/indirector/facts/facter.rb
+++ b/lib/puppet/indirector/facts/facter.rb
@@ -23,7 +23,8 @@ class Puppet::Node::Facts::Facter < Puppet::Indirector::Code
end
def self.loadfacts
- Puppet[:factpath].split(":").each do |dir|
+ # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
+ x = Puppet[:factpath].split(":").each do |dir|
loaddir(dir, "fact")
end
end
diff --git a/lib/puppet/indirector/node/ldap.rb b/lib/puppet/indirector/node/ldap.rb
index 8537e1cf3..73b5cdd70 100644
--- a/lib/puppet/indirector/node/ldap.rb
+++ b/lib/puppet/indirector/node/ldap.rb
@@ -7,7 +7,8 @@ class Puppet::Node::Ldap < Puppet::Indirector::Ldap
# The attributes that Puppet class information is stored in.
def class_attributes
- Puppet[:ldapclassattrs].split(/\s*,\s*/)
+ # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
+ x = Puppet[:ldapclassattrs].split(/\s*,\s*/)
end
# Look for our node in ldap.
diff --git a/lib/puppet/indirector/node/plain.rb b/lib/puppet/indirector/node/plain.rb
index d60cc3aa5..8058563e6 100644
--- a/lib/puppet/indirector/node/plain.rb
+++ b/lib/puppet/indirector/node/plain.rb
@@ -16,4 +16,11 @@ class Puppet::Node::Plain < Puppet::Indirector::Plain
node.fact_merge
node
end
+
+ # Use the version of the facts, since we assume that's the main thing
+ # that changes. If someone wants their own way of defining version,
+ # they can easily provide their own, um, version of this class.
+ def version(name)
+ Puppet::Node::Facts.version(name)
+ end
end
diff --git a/lib/puppet/indirector/report/processor.rb b/lib/puppet/indirector/report/processor.rb
index fd1bc413a..fa2b7f36b 100644
--- a/lib/puppet/indirector/report/processor.rb
+++ b/lib/puppet/indirector/report/processor.rb
@@ -45,6 +45,7 @@ class Puppet::Transaction::Report::Processor < Puppet::Indirector::Code
# Handle the parsing of the reports attribute.
def reports
- Puppet[:reports].gsub(/(^\s+)|(\s+$)/, '').split(/\s*,\s*/)
+ # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
+ x = Puppet[:reports].gsub(/(^\s+)|(\s+$)/, '').split(/\s*,\s*/)
end
end
diff --git a/lib/puppet/indirector/yaml.rb b/lib/puppet/indirector/yaml.rb
index 4baeb38db..4dd29159e 100644
--- a/lib/puppet/indirector/yaml.rb
+++ b/lib/puppet/indirector/yaml.rb
@@ -2,11 +2,6 @@ require 'puppet/indirector/terminus'
# The base class for YAML indirection termini.
class Puppet::Indirector::Yaml < Puppet::Indirector::Terminus
- def initialize
- # Make sure our base directory exists.
- Puppet.settings.use(:yaml)
- end
-
# Read a given name's file in and convert it from YAML.
def find(name)
raise ArgumentError.new("You must specify the name of the object to retrieve") unless name
diff --git a/lib/puppet/metatype/evaluation.rb b/lib/puppet/metatype/evaluation.rb
index 36328c537..ff1eddb55 100644
--- a/lib/puppet/metatype/evaluation.rb
+++ b/lib/puppet/metatype/evaluation.rb
@@ -4,6 +4,11 @@ class Puppet::Type
# This returns any changes resulting from testing, thus 'collect' rather
# than 'each'.
def evaluate
+ if self.provider.is_a?(Puppet::Provider)
+ unless provider.class.suitable?
+ raise Puppet::Error, "Provider %s is not functional on this platform" % provider.class.name
+ end
+ end
#Puppet.err "Evaluating %s" % self.path.join(":")
unless defined? @evalcount
self.err "No evalcount defined on '%s' of type '%s'" %
@@ -125,14 +130,19 @@ class Puppet::Type
# the other properties matter.
changes = []
ensureparam = @parameters[:ensure]
- if @parameters.include?(:ensure) && !currentvalues.include?(ensureparam)
+
+ # This allows resource types to have 'ensure' be a parameter, which allows them to
+ # just pass the parameter on to other generated resources.
+ ensureparam = nil unless ensureparam.is_a?(Puppet::Property)
+ if ensureparam && !currentvalues.include?(ensureparam)
raise Puppet::DevError, "Parameter ensure defined but missing from current values"
end
- if @parameters.include?(:ensure) and ! ensureparam.insync?(currentvalues[ensureparam])
+
+ if ensureparam and ! ensureparam.insync?(currentvalues[ensureparam])
changes << Puppet::PropertyChange.new(ensureparam, currentvalues[ensureparam])
# Else, if the 'ensure' property is correctly absent, then do
# nothing
- elsif @parameters.include?(:ensure) and currentvalues[ensureparam] == :absent
+ elsif ensureparam and currentvalues[ensureparam] == :absent
return []
else
changes = properties().find_all { |property|
diff --git a/lib/puppet/metatype/providers.rb b/lib/puppet/metatype/providers.rb
index c302d9928..6308f7e54 100644
--- a/lib/puppet/metatype/providers.rb
+++ b/lib/puppet/metatype/providers.rb
@@ -188,15 +188,8 @@ class Puppet::Type
provider_class = provider_class.class.name
end
- if provider = @resource.class.provider(provider_class)
- unless provider.suitable?
- raise ArgumentError,
- "Provider '%s' is not functional on this platform" %
- [provider_class]
- end
- else
- raise ArgumentError, "Invalid %s provider '%s'" %
- [@resource.class.name, provider_class]
+ unless provider = @resource.class.provider(provider_class)
+ raise ArgumentError, "Invalid %s provider '%s'" % [@resource.class.name, provider_class]
end
end
diff --git a/lib/puppet/network/authstore.rb b/lib/puppet/network/authstore.rb
index c16bef32f..cb1fdc57d 100755
--- a/lib/puppet/network/authstore.rb
+++ b/lib/puppet/network/authstore.rb
@@ -235,7 +235,8 @@ module Puppet
# Convert the name to a common pattern.
def munge_name(name)
- name.downcase.split(".").reverse
+ # LAK:NOTE http://snurl.com/21zf8 [groups_google_com]
+ x = name.downcase.split(".").reverse
end
# Parse our input pattern and figure out what kind of allowal
diff --git a/lib/puppet/network/client.rb b/lib/puppet/network/client.rb
index cf1782f79..478883959 100644
--- a/lib/puppet/network/client.rb
+++ b/lib/puppet/network/client.rb
@@ -96,8 +96,9 @@ class Puppet::Network::Client
self.read_cert
# We have to start the HTTP connection manually before we start
- # sending it requests or keep-alive won't work.
- @driver.start if @driver.respond_to? :start
+ # sending it requests or keep-alive won't work. Note that with #1010,
+ # we don't currently actually want keep-alive.
+ @driver.start if @driver.respond_to? :start and Puppet::Network::HttpPool.keep_alive?
@local = false
elsif hash.include?(driverparam)
diff --git a/lib/puppet/network/client/master.rb b/lib/puppet/network/client/master.rb
index e914d5c69..955acbfb5 100644
--- a/lib/puppet/network/client/master.rb
+++ b/lib/puppet/network/client/master.rb
@@ -50,7 +50,8 @@ class Puppet::Network::Client::Master < Puppet::Network::Client
# Return the list of dynamic facts as an array of symbols
def self.dynamic_facts
- Puppet.settings[:dynamicfacts].split(/\s*,\s*/).collect { |fact| fact.downcase }
+ # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
+ x = Puppet.settings[:dynamicfacts].split(/\s*,\s*/).collect { |fact| fact.downcase }
end
# Cache the config
@@ -425,7 +426,8 @@ class Puppet::Network::Client::Master < Puppet::Network::Client
end
def self.loadfacts
- Puppet[:factpath].split(":").each do |dir|
+ # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
+ x = Puppet[:factpath].split(":").each do |dir|
loaddir(dir, "fact")
end
end
diff --git a/lib/puppet/network/handler/master.rb b/lib/puppet/network/handler/master.rb
index 3e004046e..dabfaca50 100644
--- a/lib/puppet/network/handler/master.rb
+++ b/lib/puppet/network/handler/master.rb
@@ -81,9 +81,9 @@ class Puppet::Network::Handler
clientip = facts["ipaddress"]
if Puppet[:node_name] == 'cert'
if name
+ client = name
facts["fqdn"] = client
facts["hostname"], facts["domain"] = client.split('.', 2)
- client = name
end
if ip
clientip = ip
diff --git a/lib/puppet/network/handler/report.rb b/lib/puppet/network/handler/report.rb
index 8ddeed9f6..b92b77ea5 100755
--- a/lib/puppet/network/handler/report.rb
+++ b/lib/puppet/network/handler/report.rb
@@ -79,7 +79,8 @@ class Puppet::Network::Handler
# Handle the parsing of the reports attribute.
def reports
- Puppet[:reports].gsub(/(^\s+)|(\s+$)/, '').split(/\s*,\s*/)
+ # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
+ x = Puppet[:reports].gsub(/(^\s+)|(\s+$)/, '').split(/\s*,\s*/)
end
end
end
diff --git a/lib/puppet/network/http/mongrel/rest.rb b/lib/puppet/network/http/mongrel/rest.rb
index db63613ab..6c24e360c 100644
--- a/lib/puppet/network/http/mongrel/rest.rb
+++ b/lib/puppet/network/http/mongrel/rest.rb
@@ -14,11 +14,13 @@ class Puppet::Network::HTTP::MongrelREST < Puppet::Network::HTTP::Handler
end
def path(request)
- '/' + request.params[Mongrel::Const::REQUEST_PATH].split('/')[1]
+ # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
+ x = '/' + request.params[Mongrel::Const::REQUEST_PATH].split('/')[1]
end
def request_key(request)
- request.params[Mongrel::Const::REQUEST_PATH].split('/')[2]
+ # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
+ x = request.params[Mongrel::Const::REQUEST_PATH].split('/')[2]
end
def body(request)
diff --git a/lib/puppet/network/http/webrick/rest.rb b/lib/puppet/network/http/webrick/rest.rb
index dd0c84d61..8cda079e2 100644
--- a/lib/puppet/network/http/webrick/rest.rb
+++ b/lib/puppet/network/http/webrick/rest.rb
@@ -19,11 +19,13 @@ class Puppet::Network::HTTP::WEBrickREST < Puppet::Network::HTTP::Handler
end
def path(request)
- '/' + request.path.split('/')[1]
+ # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
+ x = '/' + request.path.split('/')[1]
end
def request_key(request)
- request.path.split('/')[2]
+ # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
+ x = request.path.split('/')[2]
end
def body(request)
@@ -38,4 +40,4 @@ class Puppet::Network::HTTP::WEBrickREST < Puppet::Network::HTTP::Handler
response.status = status
response.body = result
end
-end \ No newline at end of file
+end
diff --git a/lib/puppet/network/http_pool.rb b/lib/puppet/network/http_pool.rb
index 69574d8fd..9d37f2eeb 100644
--- a/lib/puppet/network/http_pool.rb
+++ b/lib/puppet/network/http_pool.rb
@@ -6,6 +6,15 @@ end
# Manage Net::HTTP instances for keep-alive.
module Puppet::Network::HttpPool
+ # 2008/03/23
+ # LAK:WARNING: Enabling this has a high propability of
+ # causing corrupt files and who knows what else. See #1010.
+ HTTP_KEEP_ALIVE = false
+
+ def self.keep_alive?
+ HTTP_KEEP_ALIVE
+ end
+
# This handles reading in the key and such-like.
extend Puppet::SSLCertificates::Support
@http_cache = {}
@@ -56,12 +65,14 @@ module Puppet::Network::HttpPool
# Return our cached instance if we've got a cache, as long as we're not
# resetting the instance.
- return @http_cache[key] if ! reset and @http_cache[key]
-
- # Clean up old connections if we have them.
- if http = @http_cache[key]
- @http_cache.delete(key)
- http.finish if http.started?
+ if keep_alive?
+ return @http_cache[key] if ! reset and @http_cache[key]
+
+ # Clean up old connections if we have them.
+ if http = @http_cache[key]
+ @http_cache.delete(key)
+ http.finish if http.started?
+ end
end
args = [host, port]
@@ -88,7 +99,7 @@ module Puppet::Network::HttpPool
cert_setup(http)
- @http_cache[key] = http
+ @http_cache[key] = http if keep_alive?
return http
end
diff --git a/lib/puppet/node.rb b/lib/puppet/node.rb
index 1091e5056..252ab961e 100644
--- a/lib/puppet/node.rb
+++ b/lib/puppet/node.rb
@@ -10,7 +10,7 @@ class Puppet::Node
extend Puppet::Indirector
# Use the node source as the indirection terminus.
- indirects :node, :terminus_setting => :node_terminus, :cache_class => :yaml, :doc => "Where to find node information.
+ indirects :node, :terminus_setting => :node_terminus, :doc => "Where to find node information.
A node is composed of its name, its facts, and its environment."
# Retrieve a node from the node source, with some additional munging
diff --git a/lib/puppet/node/environment.rb b/lib/puppet/node/environment.rb
index 2a314803f..343720a62 100644
--- a/lib/puppet/node/environment.rb
+++ b/lib/puppet/node/environment.rb
@@ -4,7 +4,8 @@ class Puppet::Node::Environment
# Return the list of valid environments. Just looks them up in
# the settings.
def self.valid
- Puppet.settings.value(:environments).split(",").collect { |e| e.to_sym }
+ # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
+ x = Puppet.settings.value(:environments).split(",").collect { |e| e.to_sym }
end
# Is the provided environment valid?
diff --git a/lib/puppet/parser/parser_support.rb b/lib/puppet/parser/parser_support.rb
index ccfc4d48a..b86a4792b 100644
--- a/lib/puppet/parser/parser_support.rb
+++ b/lib/puppet/parser/parser_support.rb
@@ -123,13 +123,17 @@ class Puppet::Parser::Parser
def fqfind(namespace, name, table)
namespace = namespace.downcase
name = name.to_s.downcase
+
+ # If our classname is fully qualified or we have no namespace,
+ # just try directly for the class, and return either way.
if name =~ /^::/ or namespace == ""
classname = name.sub(/^::/, '')
- unless table[classname]
- self.load(classname)
- end
+ self.load(classname) unless table[classname]
return table[classname]
end
+
+ # Else, build our namespace up piece by piece, checking
+ # for the class in each namespace.
ary = namespace.split("::")
while ary.length > 0
@@ -221,7 +225,6 @@ class Puppet::Parser::Parser
return false if classname == ""
filename = classname.gsub("::", File::SEPARATOR)
- loaded = false
# First try to load the top-level module
mod = filename.scan(/^[\w-]+/).shift
unless @loaded.include?(mod)
@@ -229,24 +232,24 @@ class Puppet::Parser::Parser
begin
import(mod)
Puppet.info "Autoloaded module %s" % mod
- loaded = true
rescue Puppet::ImportError => detail
# We couldn't load the module
end
end
- unless filename == mod and ! @loaded.include?(mod)
- @loaded << mod
+ return true if classes.include?(classname)
+
+ unless @loaded.include?(filename)
+ @loaded << filename
# Then the individual file
begin
import(filename)
Puppet.info "Autoloaded file %s from module %s" % [filename, mod]
- loaded = true
rescue Puppet::ImportError => detail
# We couldn't load the file
end
end
- return loaded
+ return classes.include?(classname)
end
# Split an fq name into a namespace and name
diff --git a/lib/puppet/provider/mailalias/aliases.rb b/lib/puppet/provider/mailalias/aliases.rb
index 85dec29cc..8b5c45617 100755
--- a/lib/puppet/provider/mailalias/aliases.rb
+++ b/lib/puppet/provider/mailalias/aliases.rb
@@ -10,7 +10,10 @@ Puppet::Type.type(:mailalias).provide(:aliases,
record_line :aliases, :fields => %w{name recipient}, :separator => /\s*:\s*/, :block_eval => :instance do
def post_parse(record)
- record[:recipient] = record[:recipient].split(/\s*,\s*/).collect { |d| d.gsub(/^['"]|['"]$/, '') }
+ # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
+ # It's not sufficient to assign to an existing hash.
+ recipient = record[:recipient].split(/\s*,\s*/).collect { |d| d.gsub(/^['"]|['"]$/, '') }
+ record[:recipient] = recipient
record
end
diff --git a/lib/puppet/provider/package/openbsd.rb b/lib/puppet/provider/package/openbsd.rb
index f76c37176..af590eb4d 100755
--- a/lib/puppet/provider/package/openbsd.rb
+++ b/lib/puppet/provider/package/openbsd.rb
@@ -2,6 +2,7 @@ require 'puppet/provider/package'
# Packaging on OpenBSD. Doesn't work anywhere else that I know of.
Puppet::Type.type(:package).provide :openbsd, :parent => Puppet::Provider::Package do
+ include Puppet::Util::Execution
desc "OpenBSD's form of ``pkg_add`` support."
commands :pkginfo => "pkg_info", :pkgadd => "pkg_add", :pkgdelete => "pkg_delete"
@@ -58,7 +59,14 @@ Puppet::Type.type(:package).provide :openbsd, :parent => Puppet::Provider::Packa
"You must specify a package source for BSD packages"
end
- pkgadd @resource[:source]
+ if @resource[:source] =~ /\/$/
+ withenv :PKG_PATH => @resource[:source] do
+ pkgadd @resource[:name]
+ end
+ else
+ pkgadd @resource[:source]
+ end
+
end
def query
@@ -67,7 +75,7 @@ Puppet::Type.type(:package).provide :openbsd, :parent => Puppet::Provider::Packa
# Search for the version info
if info =~ /Information for (inst:)?#{@resource[:name]}-(\S+)/
- hash[:ensure] = $1
+ hash[:ensure] = $2
else
return nil
end
diff --git a/lib/puppet/provider/zone/solaris.rb b/lib/puppet/provider/zone/solaris.rb
index dd8698b92..be2dd97f9 100644
--- a/lib/puppet/provider/zone/solaris.rb
+++ b/lib/puppet/provider/zone/solaris.rb
@@ -26,7 +26,8 @@ Puppet::Type.type(:zone).provide(:solaris) do
end
def self.instances
- adm(:list, "-cp").split("\n").collect do |line|
+ # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
+ x = adm(:list, "-cp").split("\n").collect do |line|
new(line2hash(line))
end
end
diff --git a/lib/puppet/resource_reference.rb b/lib/puppet/resource_reference.rb
index 771a91be7..44b518816 100644
--- a/lib/puppet/resource_reference.rb
+++ b/lib/puppet/resource_reference.rb
@@ -49,7 +49,8 @@ class Puppet::ResourceReference
if value.nil? or value.to_s.downcase == "component"
@type = "Class"
else
- @type = value.to_s.split("::").collect { |s| s.capitalize }.join("::")
+ # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
+ x = @type = value.to_s.split("::").collect { |s| s.capitalize }.join("::")
end
end
diff --git a/lib/puppet/type/host.rb b/lib/puppet/type/host.rb
index 868e41629..53365bf40 100755
--- a/lib/puppet/type/host.rb
+++ b/lib/puppet/type/host.rb
@@ -87,7 +87,8 @@ module Puppet
isnamevar
validate do |value|
- value.split('.').each do |hostpart|
+ # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
+ x = value.split('.').each do |hostpart|
unless hostpart =~ /^([\d\w]+|[\d\w][\d\w\-]+[\d\w])$/
raise Puppet::Error, "Invalid host name"
end
diff --git a/lib/puppet/type/service.rb b/lib/puppet/type/service.rb
index 1b625cc41..560d81bae 100644
--- a/lib/puppet/type/service.rb
+++ b/lib/puppet/type/service.rb
@@ -113,7 +113,9 @@ module Puppet
munge do |value|
value = [value] unless value.is_a?(Array)
- paths = value.flatten.collect { |p| p.split(":") }.flatten.find_all do |path|
+ # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
+ # It affects stand-alone blocks, too.
+ paths = value.flatten.collect { |p| x = p.split(":") }.flatten.find_all do |path|
if FileTest.directory?(path)
true
else
diff --git a/lib/puppet/util.rb b/lib/puppet/util.rb
index 2e83a08e9..560afe10b 100644
--- a/lib/puppet/util.rb
+++ b/lib/puppet/util.rb
@@ -226,7 +226,8 @@ module Util
return nil
end
else
- ENV['PATH'].split(":").each do |dir|
+ # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
+ x = ENV['PATH'].split(":").each do |dir|
if FileTest.exists? File.join(dir, bin)
return File.join(dir, bin)
end
diff --git a/lib/puppet/util/constant_inflector.rb b/lib/puppet/util/constant_inflector.rb
index 8b083951f..eeeaa0632 100644
--- a/lib/puppet/util/constant_inflector.rb
+++ b/lib/puppet/util/constant_inflector.rb
@@ -5,7 +5,8 @@
# file names.
module Puppet::Util::ConstantInflector
def file2constant(file)
- file.split("/").collect { |name| name.capitalize }.join("::").gsub(/_+(.)/) { |term| $1.capitalize }
+ # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
+ x = file.split("/").collect { |name| name.capitalize }.join("::").gsub(/_+(.)/) { |term| $1.capitalize }
end
def constant2file(constant)
diff --git a/lib/puppet/util/diff.rb b/lib/puppet/util/diff.rb
index e6ff57108..f37ea0850 100644
--- a/lib/puppet/util/diff.rb
+++ b/lib/puppet/util/diff.rb
@@ -27,7 +27,7 @@ module Puppet::Util::Diff
output = ""
- diffs = Diff::LCS.diff(data_old, data_new)
+ diffs = ::Diff::LCS.diff(data_old, data_new)
return output if diffs.empty?
oldhunk = hunk = nil
@@ -35,7 +35,7 @@ module Puppet::Util::Diff
diffs.each do |piece|
begin
- hunk = Diff::LCS::Hunk.new(data_old, data_new, piece,
+ hunk = ::Diff::LCS::Hunk.new(data_old, data_new, piece,
context_lines,
file_length_difference)
file_length_difference = hunk.file_length_difference
diff --git a/lib/puppet/util/fileparsing.rb b/lib/puppet/util/fileparsing.rb
index 8e39719c8..23d02ea60 100644
--- a/lib/puppet/util/fileparsing.rb
+++ b/lib/puppet/util/fileparsing.rb
@@ -223,7 +223,8 @@ module Puppet::Util::FileParsing
# Split text into separate lines using the record separator.
def lines(text)
# Remove any trailing separators, and then split based on them
- text.sub(/#{self.line_separator}\Q/,'').split(self.line_separator)
+ # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
+ x = text.sub(/#{self.line_separator}\Q/,'').split(self.line_separator)
end
# Split a bunch of text into lines and then parse them individually.
diff --git a/lib/puppet/util/tagging.rb b/lib/puppet/util/tagging.rb
index 8a50f3458..e06e13a2c 100644
--- a/lib/puppet/util/tagging.rb
+++ b/lib/puppet/util/tagging.rb
@@ -16,7 +16,8 @@ module Puppet::Util::Tagging
@tags << tag unless @tags.include?(tag)
end
- qualified.collect { |name| name.split("::") }.flatten.each { |tag| @tags << tag unless @tags.include?(tag) }
+ # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
+ qualified.collect { |name| x = name.split("::") }.flatten.each { |tag| @tags << tag unless @tags.include?(tag) }
end
# Are we tagged with the provided tag?