Skip to content

Commit

Permalink
- moved the parenthesis before map to the end so that the map works on
Browse files Browse the repository at this point in the history
  the array and then the set is created from that, instead of map
  coercing the set to an array, which breaks things that call Set#add
- switching back to the previous more concise expression form
  • Loading branch information
Edmund Rhudy committed Dec 26, 2014
1 parent e709ba7 commit 247b6e0
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,6 @@ def get_user_tags
match = rabbitmqctl('-q', 'list_users').split(/\n/).collect do |line|
line.match(/^#{Regexp.escape(resource[:name])}\s+\[(.*?)\]/)
end.compact.first
if match
# RabbitMQ 3.3.5 and up separate tags with ', '
# 3.3.4 just separates with space
# this splits by space and then strips word-final commas
# (if you're ending a valid tag name with a comma, why)
Set.new(match[1].split(' ')).map{|x| x.gsub(/,$/, '')}
end
Set.new(match[1].split(' ').map{|x| x.gsub(/,$/, '')}) if match
end
end

0 comments on commit 247b6e0

Please sign in to comment.