diff --git a/lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb b/lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb index 8a8e9f41c..7f7f81eb4 100644 --- a/lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb +++ b/lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb @@ -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