Skip to content

Commit

Permalink
my first set of changes for the user tag idempotence issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Edmund Rhudy committed Dec 26, 2014
1 parent 1cc2e54 commit e709ba7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ def get_user_tags
match = rabbitmqctl('-q', 'list_users').split(/\n/).collect do |line|
line.match(/^#{Regexp.escape(resource[:name])}\s+\[(.*?)\]/)
end.compact.first
Set.new(match[1].split(/, /)) if match
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
end
end

0 comments on commit e709ba7

Please sign in to comment.