GitLab upgraded to 13.5.0-ee.0 - changelog: https://gitlab.com/gitlab-org/gitlab/blob/master/CHANGELOG-EE.md

More Cookstyle/Rubocop fixes

parent 192e2aec
AlignParameters:
AsciiComments:
Enabled: false
AsciiComments:
ChefStyle/CommentFormat:
Enabled: false
ChefModernize/FoodcriticComments:
Enabled: false
ChefModernize/ExecuteSleep:
Enabled: false
Encoding:
Layout/ParameterAlignment:
Enabled: false
Layout/ElseAlignment:
......@@ -16,18 +22,21 @@ Layout/EndAlignment:
Layout/IndentationWidth:
Enabled: false
LineLength:
Layout/LineLength:
Max: 200
MethodLength:
Max: 18
Naming/FileName:
Enabled: false
Metrics/AbcSize:
Max: 16
Metrics/MethodLength:
Max: 18
Style/Encoding:
Enabled: false
Style/RegexpLiteral:
Enabled: false
......
......@@ -22,8 +22,8 @@ default['rabbitmq']['erlang']['enabled'] = false
# suggests that the intent is to use recipe[rabbitmq::erlang_package]
#
if !node['rabbitmq']['use_distro_version'] && !node['rabbitmq']['erlang']['enabled'] &&
(node['platform'] == 'debian' && node['platform_version'].to_i < 8 ||
platform_family?('rhel', 'centos', 'scientific') && node['platform_version'].to_i < 7)
(platform_family?('debian') && node['platform_version'].to_i < 8 ||
platform_family?('rhel') && node['platform_version'].to_i < 7)
default['erlang']['install_method'] = 'esl'
end
......
......@@ -37,7 +37,7 @@ def run_rabbitmqctl(*args)
cmd.error!
Chef::Log.debug("[rabbitmq_cluster] #{cmd.stdout}")
rescue
Chef::Application.fatal!("[rabbitmq_cluster] #{cmd.stderr}")
raise("[rabbitmq_cluster] #{cmd.stderr}")
end
end
......@@ -63,7 +63,7 @@ end
# Match regex pattern from result of rabbitmqctl cluster_status
def match_pattern_cluster_status(cluster_status, pattern)
if cluster_status.nil? || cluster_status.to_s.empty?
Chef::Application.fatal!('[rabbitmq_cluster] cluster_status should not be empty')
raise('[rabbitmq_cluster] cluster_status should not be empty')
end
match = cluster_status.match(pattern)
match && match[2]
......@@ -181,7 +181,7 @@ def change_cluster_node_type(cluster_node_type)
if err.include?('{not_clustered,"Non-clustered nodes can only be disc nodes."}')
Chef::Log.info('[rabbitmq_cluster] Node is not clustered yet, error will be ignored.')
else
Chef::Application.fatal!("[rabbitmq_cluster] #{err}")
raise("[rabbitmq_cluster] #{err}")
end
end
end
......@@ -196,7 +196,7 @@ end
action :join do
Chef::Log.info('[rabbitmq_cluster] Action join ... ')
Chef::Application.fatal!('rabbitmq_cluster with action :join requires a non-nil/empty cluster_nodes.') if new_resource.cluster_nodes.nil? || new_resource.cluster_nodes.empty?
raise('rabbitmq_cluster with action :join requires a non-nil/empty cluster_nodes.') if new_resource.cluster_nodes.nil? || new_resource.cluster_nodes.empty?
var_cluster_status = cluster_status
var_node_name = node_name
......@@ -220,7 +220,7 @@ action :join do
begin
join_cluster(var_node_name_to_join, var_node_type)
rescue JoinError => exc
Chef::Application.fatal!("[rabbitmq_cluster] #{exc.message}")
raise("[rabbitmq_cluster] #{exc.message}")
ensure
run_rabbitmqctl('start_app')
end
......@@ -232,7 +232,7 @@ end
# Action for set cluster name
action :set_cluster_name do
Chef::Application.fatal!('rabbitmq_cluster with action :join requires a non-nil/empty cluster_nodes.') if new_resource.cluster_nodes.nil? || new_resource.cluster_nodes.empty?
raise('rabbitmq_cluster with action :join requires a non-nil/empty cluster_nodes.') if new_resource.cluster_nodes.nil? || new_resource.cluster_nodes.empty?
var_cluster_status = cluster_status
var_cluster_name = new_resource.cluster_name
if current_cluster_name(var_cluster_status).nil?
......@@ -251,7 +251,7 @@ end
action :change_cluster_node_type do
Chef::Log.info('[rabbitmq_cluster] Action change_cluster_node_type ... ')
Chef::Application.fatal!('rabbitmq_cluster with action :join requires a non-nil/empty cluster_nodes.') if new_resource.cluster_nodes.nil? || new_resource.cluster_nodes.empty?
raise('rabbitmq_cluster with action :join requires a non-nil/empty cluster_nodes.') if new_resource.cluster_nodes.nil? || new_resource.cluster_nodes.empty?
var_cluster_status = cluster_status
var_node_name = node_name
......
......@@ -62,7 +62,7 @@ action :install do
end
end
if platform_family?('rhel', 'fedora', 'amazon')
if platform_family?('rhel', 'fedora')
package new_resource.name do
package_name 'erlang'
version new_resource.version unless new_resource.version.nil?
......@@ -105,7 +105,7 @@ action :remove do
end
end
if platform_family?('rhel', 'fedora', 'amazon')
if platform_family?('rhel', 'fedora')
package new_resource.name do
action :remove
end
......
......@@ -92,7 +92,7 @@ end
action :add do
unless user_exists?(new_resource.user)
Chef::Application.fatal!('rabbitmq_user with action :add requires a non-nil/empty password.') if new_resource.password.nil? || new_resource.password.empty?
raise('rabbitmq_user with action :add requires a non-nil/empty password.') if new_resource.password.nil? || new_resource.password.empty?
# To escape single quotes in a shell, you have to close the surrounding single quotes, add
# in an escaped single quote, and then re-open the original single quotes.
......@@ -121,7 +121,7 @@ action :delete do
end
action :set_permissions do
Chef::Application.fatal!("rabbitmq_user action :set_permissions fails with nonexistent '#{new_resource.user}' user.") unless user_exists?(new_resource.user)
raise("rabbitmq_user action :set_permissions fails with nonexistent '#{new_resource.user}' user.") unless user_exists?(new_resource.user)
perm_list = new_resource.permissions.split
vhosts = new_resource.vhost.is_a?(Array) ? new_resource.vhost : [new_resource.vhost]
......@@ -138,7 +138,7 @@ action :set_permissions do
end
action :clear_permissions do
Chef::Application.fatal!("rabbitmq_user action :clear_permissions fails with nonexistent '#{new_resource.user}' user.") unless user_exists?(new_resource.user)
raise("rabbitmq_user action :clear_permissions fails with nonexistent '#{new_resource.user}' user.") unless user_exists?(new_resource.user)
vhosts = new_resource.vhost.is_a?(Array) ? new_resource.vhost : [new_resource.vhost]
# filter out vhosts for which the user already has the permissions we expect
......@@ -154,7 +154,7 @@ action :clear_permissions do
end
action :set_tags do
Chef::Application.fatal!("rabbitmq_user action :set_tags fails with nonexistent '#{new_resource.user}' user.") unless user_exists?(new_resource.user)
raise("rabbitmq_user action :set_tags fails with nonexistent '#{new_resource.user}' user.") unless user_exists?(new_resource.user)
unless user_has_tag?(new_resource.user, new_resource.tag)
cmd = "rabbitmqctl -q set_user_tags #{new_resource.user} #{new_resource.tag}"
......@@ -166,7 +166,7 @@ action :set_tags do
end
action :clear_tags do
Chef::Application.fatal!("rabbitmq_user action :clear_tags fails with nonexistent '#{new_resource.user}' user.") unless user_exists?(new_resource.user)
raise("rabbitmq_user action :clear_tags fails with nonexistent '#{new_resource.user}' user.") unless user_exists?(new_resource.user)
unless user_has_tag?(new_resource.user, '"\[\]"')
cmd = "rabbitmqctl -q set_user_tags #{new_resource.user}"
......
......@@ -98,7 +98,7 @@ if platform_family?('debian')
if node['platform_version'].to_i == 7 && !use_distro_version?
Chef::Log.warn 'Debian 7 is too old to use the recent .deb RabbitMQ packages. Falling back to distro package!'
node.normal['rabbitmq']['use_distro_version'] = true
node.override['rabbitmq']['use_distro_version'] = true
end
if use_distro_version?
......@@ -365,8 +365,9 @@ existing_erlang_key = if File.exist?(node['rabbitmq']['erlang_cookie_path']) &&
end
if node['rabbitmq']['clustering']['enable'] && (node['rabbitmq']['erlang_cookie'] != existing_erlang_key)
log "stop #{node['rabbitmq']['service_name']} to change erlang cookie" do
notifies :stop, "service[#{node['rabbitmq']['service_name']}]", :immediately
log "stopping #{node['rabbitmq']['service_name']} because shared cluster secret (the Erlang cookie) has changed"
service node['rabbitmq']['service_name'] do
action :stop
end
template node['rabbitmq']['erlang_cookie_path'] do
......
......@@ -55,7 +55,7 @@ if platform_family?('rhel')
end
end
if platform_family?('rhel', 'fedora', 'amazon')
if platform_family?('rhel', 'fedora')
rabbitmq_erlang_yum_repository_on_bintray 'rabbitmq_erlang' do
baseurl node['rabbitmq']['erlang']['yum']['baseurl']
gpgkey node['rabbitmq']['erlang']['yum']['gpgkey']
......
......@@ -25,8 +25,8 @@ attribute :uri, String, default: 'https://dl.bintray.com/rabbitmq-erlang/debian'
attribute :distribution, String
# Available values: 'erlang', 'erlang-21.x', 'erlang-20.x', 'erlang-19.x'
# 'erlang' means "the latest release"
attribute :components, Array, default: ['erlang'], required: true
attribute :key, String, default: '6B73A36E6026DFCA', required: true
attribute :components, Array, default: ['erlang']
attribute :key, String, default: '6B73A36E6026DFCA'
attribute :keyserver, String
attribute :trusted, [TrueClass, FalseClass], default: false
attribute :trusted, [true, false], default: false
......@@ -22,7 +22,7 @@ actions :install, :remove
default_action :install
attribute :version, String
attribute :use_hipe, [TrueClass, FalseClass], default: false
attribute :use_hipe, [true, false], default: false
attribute :options, [String, Array]
attribute :retries, Integer, default: 3
attribute :retry_delay, Integer, default: 10
......@@ -23,12 +23,12 @@ default_action :create
attribute :baseurl, String, required: true
attribute :gpgcheck, [TrueClass, FalseClass], default: true
attribute :gpgcheck, [true, false], default: true
attribute :gpgkey, String
attribute :repo_gpgcheck, [TrueClass, FalseClass], default: true
attribute :repo_gpgcheck, [true, false], default: true
attribute :repositoryid, String
attribute :enabled, [TrueClass, FalseClass], default: true
attribute :enabled, [true, false], default: true
attribute :priority, String
attribute :proxy, String
......@@ -38,6 +38,6 @@ attribute :proxy_password, String
attribute :sslcacert, String
attribute :sslclientcert, String
attribute :sslclientkey, String
attribute :sslverify, [TrueClass, FalseClass]
attribute :sslverify, [true, false]
attribute :timeout
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment