Skip to content

Commit

Permalink
Simplify "all_vhosts" in rabbitmq_queue provider
Browse files Browse the repository at this point in the history
This is more idiomatic ruby, avoids creating array only to throw it away, and consistent with a method below.
  • Loading branch information
KarolisL authored May 23, 2017
1 parent 2000ce7 commit fd70605
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/puppet/provider/rabbitmq_queue/rabbitmqadmin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ def should_vhost
end

def self.all_vhosts
vhosts = []
rabbitmqctl('list_vhosts', '-q').split(/\n/).collect do |vhost|
vhosts.push(vhost)
end
vhosts
rabbitmqctl('list_vhosts', '-q').split(/\n/)
end

def self.all_queues(vhost)
Expand Down

0 comments on commit fd70605

Please sign in to comment.