Skip to content

Commit e709ba7

Browse files
author
Edmund Rhudy
committed
my first set of changes for the user tag idempotence issue
1 parent 1cc2e54 commit e709ba7

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ def get_user_tags
111111
match = rabbitmqctl('-q', 'list_users').split(/\n/).collect do |line|
112112
line.match(/^#{Regexp.escape(resource[:name])}\s+\[(.*?)\]/)
113113
end.compact.first
114-
Set.new(match[1].split(/, /)) if match
114+
if match
115+
# RabbitMQ 3.3.5 and up separate tags with ', '
116+
# 3.3.4 just separates with space
117+
# this splits by space and then strips word-final commas
118+
# (if you're ending a valid tag name with a comma, why)
119+
Set.new(match[1].split(' ')).map{|x| x.gsub(/,$/, '')}
120+
end
115121
end
116122
end

0 commit comments

Comments
 (0)