Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve all cookstyle warnings #541

Merged
merged 12 commits into from
Dec 10, 2019
2 changes: 1 addition & 1 deletion attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@

# rabbitmq_auth_backend_cache
default['rabbitmq']['auth']['cache']['enabled'] = false
default['rabbitmq']['auth']['cache']['conf'] = {}
default['rabbitmq']['auth']['cache']['conf'] = {}

# TLS
default['rabbitmq']['ssl'] = false
Expand Down
2 changes: 1 addition & 1 deletion libraries/default.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true
#
# Cookbook Name:: rabbitmq
# Cookbook:: rabbitmq
# Library:: default
# Author:: Jake Davis (<jake@simple.com>)
#
Expand Down
70 changes: 0 additions & 70 deletions libraries/matchers.rb

This file was deleted.

24 changes: 0 additions & 24 deletions metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,6 @@
description 'Installs and configures RabbitMQ server'
version '6.0.0'

recipe 'rabbitmq', 'Install and configure RabbitMQ'

recipe 'rabbitmq::systemd_limits', 'Sets up kernel limits (e.g. nofile) for RabbitMQ via systemd'
recipe 'rabbitmq::cluster', 'Set up RabbitMQ clustering.'

recipe 'rabbitmq::management_ui', 'Sets up RabbitMQ management plugin/UI'
recipe 'rabbitmq::mgmt_console', 'Deprecated, alias for rabbitmq::management_ui'

recipe 'rabbitmq::plugins', 'Manage plugins with node attributes'
recipe 'rabbitmq::plugin_management', 'Deprecated, alias for rabbitmq::plugins'

recipe 'rabbitmq::vhosts', 'Manage virtual hosts with node attributes'
recipe 'rabbitmq::virtualhost_management', 'Deprecated, alias for rabbitmq::vhosts'

recipe 'rabbitmq::users', 'Manage users with node attributes'
recipe 'rabbitmq::user_management', 'Deprecated, alias for rabbitmq::users'

recipe 'rabbitmq::policies', 'Manage policies with node attributes'
recipe 'rabbitmq::policy_management', 'Deprecated, alias for rabbitmq::policies'

recipe 'rabbitmq::erlang_package', 'Provisions Erlang via Team RabbitMQ packages'
recipe 'rabbitmq::esl_erlang_package', 'Alias for erlang::esl'

issues_url 'https://github.com/rabbitmq/chef-cookbook/issues'
source_url 'https://github.com/rabbitmq/chef-cookbook'

Expand All @@ -44,7 +21,6 @@
supports 'centos', '>= 7.0'
supports 'debian', '>= 8.0'
supports 'fedora', '>= 23'
supports 'opensuse'
supports 'opensuseleap'
supports 'oracle'
supports 'redhat'
Expand Down
7 changes: 2 additions & 5 deletions providers/cluster.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# frozen_string_literal: true
#
# Cookbook Name:: rabbitmq
# Cookbook:: rabbitmq
# Provider:: cluster
#
# Author: Sunggun Yu <sunggun.dev@gmail.com>
# Copyright (C) 2015 Sunggun Yu
# Copyright:: (C) 2015 Sunggun Yu
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -20,9 +20,6 @@
#

include RabbitMQ::CoreHelpers
include Chef::Mixin::ShellOut

use_inline_resources if defined?(:use_inline_resources) # ~FC113

# Get ShellOut
def get_shellout(cmd)
Expand Down
8 changes: 3 additions & 5 deletions providers/erlang_apt_repository_on_bintray.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# frozen_string_literal: true
#
# Cookbook Name:: rabbitmq
# Cookbook:: rabbitmq
# Provider:: erlang_apt_repository_on_bintray
#
# Copyright 2019, Pivotal Software, Inc.
# Copyright:: 2019, Pivotal Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -18,9 +18,7 @@
# limitations under the License.
#

use_inline_resources if defined?(:use_inline_resources) # ~FC113

provides :erlang_repository, platform_family: %w(debian ubuntu)
provides :erlang_repository, platform_family: %w(debian)

action :add do
package 'apt-transport-https'
Expand Down
16 changes: 7 additions & 9 deletions providers/erlang_package_from_bintray.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# frozen_string_literal: true
#
# Cookbook Name:: rabbitmq
# Cookbook:: rabbitmq
# Provider:: erlang_package_from_bintray
#
# Copyright 2019, Pivotal Software, Inc.
# Copyright:: 2019, Pivotal Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -18,17 +18,15 @@
# limitations under the License.
#

use_inline_resources if defined?(:use_inline_resources) # ~FC113

provides :erlang_package_from_bintray, platform_family: %w(debian ubuntu rhel centos fedora)
provides :erlang_package_from_bintray, platform_family: %w(debian rhel fedora)

DEBIAN_PACKAGES = %w(erlang-mnesia erlang-runtime-tools erlang-asn1 erlang-crypto erlang-public-key erlang-ssl
erlang-syntax-tools erlang-snmp erlang-os-mon erlang-parsetools
erlang-ftp erlang-tftp erlang-inets erlang-tools erlang-eldap erlang-xmerl
erlang-dev erlang-edoc erlang-eunit erlang-erl-docgen erlang-src).freeze

action :install do
if platform_family?('debian', 'ubuntu')
if platform_family?('debian')
base_pkg = if new_resource.use_hipe
'erlang-base-hipe'
else
Expand Down Expand Up @@ -64,7 +62,7 @@
end
end

if platform_family?('rhel', 'centos', 'scientific', 'fedora', 'amazon')
if platform_family?('rhel', 'fedora', 'amazon')
package new_resource.name do
package_name 'erlang'
version new_resource.version unless new_resource.version.nil?
Expand All @@ -76,7 +74,7 @@
end

action :remove do
if platform_family?('debian', 'ubuntu')
if platform_family?('debian')
base_pkg = if new_resource.use_hipe
'erlang-base-hipe'
else
Expand Down Expand Up @@ -107,7 +105,7 @@
end
end

if platform_family?('rhel', 'centos', 'scientific', 'fedora', 'amazon')
if platform_family?('rhel', 'fedora', 'amazon')
package new_resource.name do
action :remove
end
Expand Down
8 changes: 3 additions & 5 deletions providers/erlang_yum_repository_on_bintray.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# frozen_string_literal: true
#
# Cookbook Name:: rabbitmq
# Cookbook:: rabbitmq
# Provider:: erlang_yum_repository_on_bintray
#
# Copyright 2019, Pivotal Software, Inc.
# Copyright:: 2019, Pivotal Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -18,9 +18,7 @@
# limitations under the License.
#

use_inline_resources if defined?(:use_inline_resources) # ~FC113

provides :erlang_repository, platform_family: %w(rhel centos fedora)
provides :erlang_repository, platform_family: %w(rhel fedora)

action :create do
yum_repository(new_resource.name) do
Expand Down
8 changes: 3 additions & 5 deletions providers/erlang_zypper_repository_on_suse_factory.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# frozen_string_literal: true
#
# Cookbook Name:: rabbitmq
# Cookbook:: rabbitmq
# Provider:: erlang_yum_repository_on_bintray
#
# Copyright 2019, Pivotal Software, Inc.
# Copyright:: 2019, Pivotal Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -18,9 +18,7 @@
# limitations under the License.
#

use_inline_resources if defined?(:use_inline_resources) # ~FC113

provides :erlang_repository, platform_family: %w(suse opensuse)
provides :erlang_repository, platform_family: %w(suse)

action :create do
execute 'zypper refresh' do
Expand Down
6 changes: 2 additions & 4 deletions providers/parameter.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# frozen_string_literal: true
#
# Cookbook Name:: rabbitmq
# Cookbook:: rabbitmq
# Provider:: parameter
#
# Author: Sean Porter <portertech@gmail.com>
# Copyright 2015 by Heavy Water Operations, LLC.
# Copyright:: 2015 by Heavy Water Operations, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -23,8 +23,6 @@

include RabbitMQ::CoreHelpers

use_inline_resources if defined?(:use_inline_resources) # ~FC113

def parameter_exists?(vhost, name)
cmd = if Gem::Version.new(installed_rabbitmq_version) >= Gem::Version.new('3.7.10')
'rabbitmqctl list_parameters -s'
Expand Down
8 changes: 3 additions & 5 deletions providers/plugin.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# frozen_string_literal: true
#
# Cookbook Name:: rabbitmq
# Cookbook:: rabbitmq
# Provider:: plugin
#
# Copyright 2012-2018, Chef Software, Inc.
# Copyright 2018-2019, Pivotal Software, Inc.
# Copyright:: 2012-2018, Chef Software, Inc.
# Copyright:: 2018-2019, Pivotal Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,8 +32,6 @@ def plugin_enabled?(name)
cmd.stdout =~ /\b#{name}\b/
end

use_inline_resources if defined?(:use_inline_resources) # ~FC113

action :enable do
unless plugin_enabled?(new_resource.plugin)
execute "rabbitmq-plugins enable #{new_resource.plugin}" do
Expand Down
6 changes: 2 additions & 4 deletions providers/policy.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# frozen_string_literal: true
#
# Cookbook Name:: rabbitmq
# Cookbook:: rabbitmq
# Provider:: policy
#
# Author: Robert Choi <taeilchoi1@gmail.com>
# Copyright 2013 by Robert Choi
# Copyright:: 2013 by Robert Choi
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -23,8 +23,6 @@

include RabbitMQ::CoreHelpers

use_inline_resources if defined?(:use_inline_resources) # ~FC113

def policy_exists?(vhost, name)
cmd = if Gem::Version.new(installed_rabbitmq_version) >= Gem::Version.new('3.7.10')
'rabbitmqctl list_policies -s'
Expand Down
6 changes: 2 additions & 4 deletions providers/user.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# frozen_string_literal: true
#
# Cookbook Name:: rabbitmq
# Cookbook:: rabbitmq
# Provider:: user
#
# Copyright 2011-2013, Chef Software, Inc.
# Copyright:: 2011-2013, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -20,8 +20,6 @@

include RabbitMQ::CoreHelpers

use_inline_resources if defined?(:use_inline_resources) # ~FC113

def user_exists?(name)
cmd = if Gem::Version.new(installed_rabbitmq_version) >= Gem::Version.new('3.7.10')
"rabbitmqctl -s list_users |grep '^#{name}\\s'"
Expand Down
6 changes: 2 additions & 4 deletions providers/vhost.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# frozen_string_literal: true
#
# Cookbook Name:: rabbitmq
# Cookbook:: rabbitmq
# Provider:: vhost
#
# Copyright 2011-2013, Chef Software, Inc.
# Copyright:: 2011-2013, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -20,8 +20,6 @@

include RabbitMQ::CoreHelpers

use_inline_resources if defined?(:use_inline_resources) # ~FC113

def vhost_exists?(name)
cmd = "rabbitmqctl -q list_vhosts | grep ^#{name}$"
cmd = Mixlib::ShellOut.new(cmd, env: shell_environment)
Expand Down
Loading