Skip to content

Commit

Permalink
changed regex to match /s instead /b
Browse files Browse the repository at this point in the history
the default  vhost is a "/" which isn't a word and there's no word boundary to match on.
  • Loading branch information
francoisnicholas committed Feb 5, 2015
1 parent 495926a commit a1bb98b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion providers/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def user_has_tag?(name, tag)
# empty perm_list means we're checking for any permissions
def user_has_permissions?(name, vhost, perm_list = nil) # rubocop:disable all
vhost = '/' if vhost.nil? # rubocop:enable all
cmd = "rabbitmqctl -q list_user_permissions #{name} | grep \"^#{vhost}\\b\""
cmd = "rabbitmqctl -q list_user_permissions #{name} | grep \"^#{vhost}\\s\""
cmd = Mixlib::ShellOut.new(cmd)
cmd.environment['HOME'] = ENV.fetch('HOME', '/root')
cmd.run_command
Expand Down

0 comments on commit a1bb98b

Please sign in to comment.