From 7d3c30323efa5c2de2282395bc4105fef8b19e50 Mon Sep 17 00:00:00 2001 From: James Turnbull Date: Wed, 20 Apr 2011 02:35:40 +1000 Subject: Fixed #7166 - Replaced deprecated stomp "send" method with "publish" The "send" method in the stomp gem has been deprecated since: http://gitorious.org/stomp/mainline/commit/d542a976028cb4c5badcbb69e3383e746721e44c It's been replaced with the "publish" method. Also renamed the send_message method to publish_message more in keeping with language used in queuing. --- lib/puppet/util/queue.rb | 2 +- lib/puppet/util/queue/stomp.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/puppet/util') diff --git a/lib/puppet/util/queue.rb b/lib/puppet/util/queue.rb index 02357742a..636bdcf2e 100644 --- a/lib/puppet/util/queue.rb +++ b/lib/puppet/util/queue.rb @@ -30,7 +30,7 @@ require 'puppet/util/instance_loader' # # The client plugins are expected to implement an interface similar to that of Stomp::Client: # * new should return a connected, ready-to-go client instance. Note that no arguments are passed in. -# * send_message(queue, message) should send the _message_ to the specified _queue_. +# * publish_message(queue, message) should publish the _message_ to the specified _queue_. # * subscribe(queue) _block_ subscribes to _queue_ and executes _block_ upon receiving a message. # * _queue_ names are simple names independent of the message broker or client library. No "/queue/" prefixes like in Stomp::Client. module Puppet::Util::Queue diff --git a/lib/puppet/util/queue/stomp.rb b/lib/puppet/util/queue/stomp.rb index c18edae6a..cabc56627 100644 --- a/lib/puppet/util/queue/stomp.rb +++ b/lib/puppet/util/queue/stomp.rb @@ -28,8 +28,8 @@ class Puppet::Util::Queue::Stomp end end - def send_message(target, msg) - stomp_client.send(stompify_target(target), msg, :persistent => true) + def publish_message(target, msg) + stomp_client.publish(stompify_target(target), msg, :persistent => true) end def subscribe(target) -- cgit From c3a76a98226866fe691d0c6cb3995ec08af799e5 Mon Sep 17 00:00:00 2001 From: Matt Robinson Date: Thu, 21 Apr 2011 11:29:05 -0700 Subject: (#7021) Fix order dependent spec failures Running: rspec spec/unit/util/network_device_spec.rb spec/integration/transaction_spec.rb Caused Mocha::ExpectationError: unexpected invocation: #.command() The NetworkDevice class had a current reader that once set, never got unset and lived between tests. Paired-with: Josh Cooper --- lib/puppet/util/network_device.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/puppet/util') diff --git a/lib/puppet/util/network_device.rb b/lib/puppet/util/network_device.rb index d9c1aa34d..7fb8e2ff3 100644 --- a/lib/puppet/util/network_device.rb +++ b/lib/puppet/util/network_device.rb @@ -9,4 +9,9 @@ class Puppet::Util::NetworkDevice rescue => detail raise "Can't load #{device.provider} for #{device.name}: #{detail}" end -end \ No newline at end of file + + # Should only be used in tests + def self.teardown + @current = nil + end +end -- cgit