Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
{
"name": "VoxBox",
"image": "ghcr.io/voxpupuli/voxbox:latest"
Expand Down
2 changes: 1 addition & 1 deletion .msync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

modulesync_config_version: '10.5.0'
modulesync_config_version: '10.6.0'
33 changes: 27 additions & 6 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,36 @@
# This configuration was generated by
# `rubocop --auto-gen-config --no-auto-gen-timestamp`
# using RuboCop version 1.50.2.
# using RuboCop version 1.85.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 8
# Offense count: 5
# This cop supports unsafe autocorrection (--autocorrect-all).
RSpec/BeEq:
Exclude:
- 'spec/unit/puppet/provider/rabbitmq_plugin/rabbitmqctl_spec.rb'
- 'spec/unit/puppet/provider/rabbitmq_policy/rabbitmqctl_spec.rb'
- 'spec/unit/puppet/provider/rabbitmq_user_permissions/rabbitmqctl_spec.rb'
- 'spec/unit/puppet/provider/rabbitmq_vhost/rabbitmqctl_spec.rb'
- 'spec/unit/puppet/type/rabbitmq_user_permissions_spec.rb'

# Offense count: 185
# Offense count: 13
RSpec/LeakyLocalVariable:
Exclude:
- 'spec/classes/rabbitmq_spec.rb'
- 'spec/unit/puppet/provider/rabbitmq_binding/rabbitmqadmin_spec.rb'
- 'spec/unit/puppet/provider/rabbitmq_cli_spec.rb'
- 'spec/unit/puppet/provider/rabbitmq_cluster/rabbitmqctl_spec.rb'
- 'spec/unit/puppet/provider/rabbitmq_exchange/rabbitmqadmin_spec.rb'
- 'spec/unit/puppet/provider/rabbitmq_parameter/rabbitmqctl_federation_spec.rb'
- 'spec/unit/puppet/provider/rabbitmq_parameter/rabbitmqctl_spec.rb'
- 'spec/unit/puppet/provider/rabbitmq_plugin/rabbitmqctl_spec.rb'
- 'spec/unit/puppet/provider/rabbitmq_queue/rabbitmqadmin_spec.rb'
- 'spec/unit/puppet/provider/rabbitmq_user/rabbitmqctl_spec.rb'
- 'spec/unit/puppet/provider/rabbitmq_vhost/rabbitmqctl_spec.rb'

# Offense count: 172
# Configuration parameters: .
# SupportedStyles: have_received, receive
RSpec/MessageSpies:
Expand All @@ -37,7 +51,7 @@ RSpec/RepeatedExampleGroupDescription:
Exclude:
- 'spec/classes/rabbitmq_spec.rb'

# Offense count: 125
# Offense count: 118
RSpec/StubbedMock:
Exclude:
- 'spec/unit/facter/util/fact_rabbitmq_clustername_spec.rb'
Expand All @@ -54,4 +68,11 @@ RSpec/StubbedMock:
- 'spec/unit/puppet/provider/rabbitmq_policy/rabbitmqctl_spec.rb'
- 'spec/unit/puppet/provider/rabbitmq_queue/rabbitmqadmin_spec.rb'
- 'spec/unit/puppet/provider/rabbitmq_user_permissions/rabbitmqctl_spec.rb'
- 'spec/unit/puppet/provider/rabbitmq_vhost/rabbitmqctl_spec.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowedReceivers.
# AllowedReceivers: Thread.current
Style/HashEachMethods:
Exclude:
- 'lib/puppet/type/rabbitmq_parameter.rb'
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
source ENV['GEM_SOURCE'] || 'https://rubygems.org'

group :test do
gem 'voxpupuli-test', '~> 13.0', :require => false
gem 'voxpupuli-test', '~> 14.0', :require => false
gem 'puppet_metadata', '~> 6.0', :require => false
end

Expand All @@ -18,7 +18,7 @@ group :system_tests do
end

group :release do
gem 'voxpupuli-release', '~> 5.0', :require => false
gem 'voxpupuli-release', '~> 5.3', :require => false
end

gem 'rake', :require => false
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/rabbitmq_binding/rabbitmqadmin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def self.instances
routing_key: routing_key,
arguments: JSON.parse(arguments),
ensure: :present,
name: hashed_name
name: hashed_name,
}
resources << new(binding) if binding[:name]
end
Expand Down
4 changes: 2 additions & 2 deletions lib/puppet/provider/rabbitmq_cluster/rabbitmqctl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'rabbitmq_cli'))
Puppet::Type.type(:rabbitmq_cluster).provide(
:rabbitmqctl,
parent: Puppet::Provider::RabbitmqCli
parent: Puppet::Provider::RabbitmqCli,
) do
desc 'Rabbitmqctl provider for rabbitmq cluster'
confine feature: :posix
Expand All @@ -19,7 +19,7 @@ def create
local_node = @resource[:local_node].to_s.gsub(%r{^.*@}, '')

if local_node == init_node || [Facter.value(:networking)['hostname'], Facter.value(:networking)['fqdn']].include?(init_node)
return rabbitmqctl('set_cluster_name', @resource[:name]) unless cluster_name == resource[:name].to_s
rabbitmqctl('set_cluster_name', @resource[:name]) unless cluster_name == resource[:name].to_s
else
rabbitmqctl('stop_app')
rabbitmqctl('join_cluster', "rabbit@#{init_node}", "--#{storage_type}")
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/rabbitmq_exchange/rabbitmqadmin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def self.instances
durable: durable,
auto_delete: auto_delete,
name: format('%s@%s', name, vhost),
arguments: JSON.parse(arguments)
arguments: JSON.parse(arguments),
}
resources << new(exchange) if exchange[:type]
end
Expand Down
4 changes: 2 additions & 2 deletions lib/puppet/provider/rabbitmq_parameter/rabbitmqctl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
mk_resource_methods

def initialize(value = {})
super(value)
super
@property_flush = {}
end

Expand All @@ -33,7 +33,7 @@ def self.instances
ensure: :present,
component_name: Regexp.last_match(1),
name: format('%s@%s', Regexp.last_match(2), vhost),
value: JSON.parse(Regexp.last_match(3))
value: JSON.parse(Regexp.last_match(3)),
}
resources << new(parameter)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/rabbitmq_policy/rabbitmqctl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def self.policies(vhost, name)
applyto: applyto,
pattern: pattern,
definition: definition,
priority: priority
priority: priority,
}
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/rabbitmq_queue/rabbitmqadmin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def self.instances
auto_delete: auto_delete,
arguments: JSON.parse(arguments),
ensure: :present,
name: format('%s@%s', name, vhost)
name: format('%s@%s', name, vhost),
}
resources << new(queue) if queue[:name]
end
Expand Down
8 changes: 4 additions & 4 deletions lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'rabbitmq_cli'))
Puppet::Type.type(:rabbitmq_user).provide(
:rabbitmqctl,
parent: Puppet::Provider::RabbitmqCli
parent: Puppet::Provider::RabbitmqCli,
) do
desc 'Rabbitmqctl provider for rabbitmq user'
confine feature: :posix

def initialize(value = {})
super(value)
super
@property_flush = {}
end

Expand All @@ -26,7 +26,7 @@ def self.instances
new(
ensure: :present,
name: user,
tags: tags
tags: tags,
)
end
end
Expand Down Expand Up @@ -73,7 +73,7 @@ def check_password(password)
check_access_control = [
'rabbit_access_control:check_user_pass_login(',
%[list_to_binary("#{@resource[:name]}"), ],
%[list_to_binary("#{password.to_s.gsub('"', '\\"')}")).]
%[list_to_binary("#{password.to_s.gsub('"', '\\"')}")).],
]

response = rabbitmqctl('eval', check_access_control.join)
Expand Down
6 changes: 3 additions & 3 deletions lib/puppet/provider/rabbitmq_vhost/rabbitmqctl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'rabbitmq_cli'))
Puppet::Type.type(:rabbitmq_vhost).provide(
:rabbitmqctl,
parent: Puppet::Provider::RabbitmqCli
parent: Puppet::Provider::RabbitmqCli,
) do
desc 'Rabbitmqctl provider for rabbitmq vhost'
confine feature: :posix

def initialize(value = {})
super(value)
super
@property_flush = {}
end

Expand Down Expand Up @@ -49,7 +49,7 @@ def self.vhost_list
def self.instances
vhost_list.split(%r{\n}).map do |line|
if supports_metadata?
raise Puppet::Error, "Cannot parse invalid vhost line: #{line}" unless \
raise Puppet::Error, "Cannot parse invalid vhost line: #{line}" unless
(matches = line.match(%r{^(\S+)\t+(.*?)\t+(undefined|quorum|classic|stream)?\t+\[(.*?)\]$}i))

name, description, default_queue_type, tags = matches.captures
Expand Down
12 changes: 6 additions & 6 deletions lib/puppet/type/rabbitmq_binding.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,18 @@ def self.title_patterns
[
%r{(^([^@]*)$)}m,
[
[:name]
]
[:name],
],
],
[
%r{^((\S+)@(\S+)@(\S+))$}m,
[
[:name],
[:source],
[:destination],
[:vhost]
]
]
[:vhost],
],
],
]
end

Expand Down Expand Up @@ -153,7 +153,7 @@ def self.title_patterns
autorequire(:rabbitmq_user_permissions) do
[
"#{self[:user]}@#{self[:source]}",
"#{self[:user]}@#{self[:destination]}"
"#{self[:user]}@#{self[:destination]}",
]
end

Expand Down
Loading
Loading