summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-04-14 11:18:02 -0500
committerJames Turnbull <james@lovedthanlost.net>2009-04-22 14:39:38 +1000
commit9b90f34cdc2c7c462e2e20028b115209e9748969 (patch)
treeead95686bf03f90be1a06b51ba3cec9c6712c68d /lib/puppet
parent444ae9f8341348b0b8163788ada35892bc98f562 (diff)
downloadpuppet-9b90f34cdc2c7c462e2e20028b115209e9748969.tar.gz
puppet-9b90f34cdc2c7c462e2e20028b115209e9748969.tar.xz
puppet-9b90f34cdc2c7c462e2e20028b115209e9748969.zip
Using a setting for configuring queueing
Removing class methods and such, and switching to relying solely on a setting for the queue configuration. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/defaults.rb3
-rw-r--r--lib/puppet/indirector/queue.rb1
-rw-r--r--lib/puppet/util/queue.rb14
3 files changed, 6 insertions, 12 deletions
diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb
index ac7281356..3454f02dd 100644
--- a/lib/puppet/defaults.rb
+++ b/lib/puppet/defaults.rb
@@ -162,7 +162,8 @@ module Puppet
"The minimum time to wait (in seconds) between checking for updates in
configuration files. This timeout determines how quickly Puppet checks whether
a file (such as manifests or templates) has changed on disk."
- ]
+ ],
+ :queue_type => ["stomp", "Which type of queue to use for asynchronous processing."]
)
hostname = Facter["hostname"].value
diff --git a/lib/puppet/indirector/queue.rb b/lib/puppet/indirector/queue.rb
index c58af9814..91e431795 100644
--- a/lib/puppet/indirector/queue.rb
+++ b/lib/puppet/indirector/queue.rb
@@ -20,7 +20,6 @@ require 'yaml'
# creation is automatic and not a concern).
class Puppet::Indirector::Queue < Puppet::Indirector::Terminus
extend ::Puppet::Util::Queue
- self.queue_type_default = :stomp
# Queue has no idiomatic "find"
def find(request)
diff --git a/lib/puppet/util/queue.rb b/lib/puppet/util/queue.rb
index 3724bab92..ce462ac66 100644
--- a/lib/puppet/util/queue.rb
+++ b/lib/puppet/util/queue.rb
@@ -23,9 +23,6 @@ require 'puppet/util/instance_loader'
# class Queue::Fue
# # mix it in at the class object level rather than instance level
# extend ::Puppet::Util::Queue
-#
-# # specify the default client type to use.
-# self.queue_type_default = :special_magical_type
# end
#
# Queue::Fue instances can get a message queue client through the registry through the mixed-in method
@@ -38,7 +35,6 @@ require 'puppet/util/instance_loader'
# * _queue_ names are simple names independent of the message broker or client library. No "/queue/" prefixes like in Stomp::Client.
module Puppet::Util::Queue
extend Puppet::Util::InstanceLoader
- attr_accessor :queue_type_default
instance_load :queue_clients, 'puppet/util/queue'
# Adds a new class/queue-type pair to the registry. The _type_ argument is optional; if not provided,
@@ -84,13 +80,11 @@ module Puppet::Util::Queue
end
# The class object for the client to be used, determined by queue configuration
- # settings and known queue client types.
- # Looked to the <tt>:queue_client</tt> configuration entry in the running application for
- # the default queue type to use, and fails over to +queue_type_default+ if the configuration
- # information is not present.
+ # settings.
+ # Looks to the <tt>:queue_type</tt> configuration entry in the running application for
+ # the default queue type to use.
def client_class
- Puppet::Util::Queue.queue_type_to_class(Puppet[:queue_client] || queue_type_default)
- # Puppet::Util::Queue.queue_type_to_class(Puppet[:queue_client] || :stomp)
+ Puppet::Util::Queue.queue_type_to_class(Puppet[:queue_type])
end
# Returns (instantiating as necessary) the singleton queue client instance, according to the