Skip to content

Commit

Permalink
Merge pull request #1089 from chef/ssd/reindex-debug
Browse files Browse the repository at this point in the history
[pedant] Fix PATH in queues_empty? helper, add debug output
  • Loading branch information
srenatus committed Feb 17, 2017
2 parents 60ba3e1 + bc5939d commit f7236b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -13,3 +13,4 @@ MODIFIED_COMPONENTS_CHANGELOG.md
/dev/nodes
dev/*.deb
src/oc_erchef/log
compile_commands.json
9 changes: 7 additions & 2 deletions oc-chef-pedant/lib/pedant/rspec/search_util.rb
Expand Up @@ -912,11 +912,16 @@ def wait_until_queues_are_empty(i = 10)

# queues are not readable (e.g. there's no rabbitmq) OR empty
def queues_empty?
ENV['PATH'] = "/opt/opscode/embedded/bin:#{ENV['PATH']}"
output = `/opt/opscode/embedded/service/rabbitmq/sbin/rabbitmqctl list_queues -p /chef | awk '{sum += $2} END {print sum}'`
status = $?
if !status.success?
true
if !status.success?
STDERR.puts "Command exitstatus: #{status.exitstatus}"
STDERR.puts "Command output: #{output}"
true
else
STDERR.puts "Command exitstatus: #{status.exitstatus}"
STDERR.puts "Command output: #{output}"
output.to_i == 0
end
end
Expand Down

0 comments on commit f7236b5

Please sign in to comment.