diff --git a/.rubocop.yml b/.rubocop.yml index a1bb0e2..fa3e44c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,5 @@ +inherit_from: .rubocop_todo.yml + AlignParameters: Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 0000000..5f1c437 --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,17 @@ +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2018-04-20 15:39:52 -0500 using RuboCop version 0.49.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: 7 +# Configuration parameters: CountComments, ExcludedMethods. +Metrics/BlockLength: + Max: 51 + +# Offense count: 1 +Security/MarshalLoad: + Exclude: + - 'libraries/cache_data.rb' diff --git a/Berksfile b/Berksfile index ca6b553..1a921f7 100644 --- a/Berksfile +++ b/Berksfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source 'https://supermarket.chef.io' metadata diff --git a/Gemfile b/Gemfile index 9cb48d3..e9dc0a1 100644 --- a/Gemfile +++ b/Gemfile @@ -1,10 +1,12 @@ +# frozen_string_literal: true + source 'https://rubygems.org' group :integration do # Workaround: berkshell is dependent on buff-extensions gem but install older version as the new one (2.0.0) requires # ruby 2.2 and chefdk up to 0.17 provides ruby 2.1.8 - gem 'buff-extensions', '~>1.0.0' gem 'berkshelf' + gem 'buff-extensions', '~>1.0.0' gem 'kitchen-docker', '>=2.3.0' gem 'kitchen-vagrant', '>=0.18.0' gem 'test-kitchen', '>=1.4.2' diff --git a/attributes/agents_package.rb b/attributes/agents_package.rb index 00d5f56..b29fd35 100644 --- a/attributes/agents_package.rb +++ b/attributes/agents_package.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Attributes:: agents_package diff --git a/attributes/apache_wsagent.rb b/attributes/apache_wsagent.rb index 4699618..b621930 100644 --- a/attributes/apache_wsagent.rb +++ b/attributes/apache_wsagent.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Attributes:: apache_wsagent diff --git a/attributes/collector.rb b/attributes/collector.rb index a6fcdd2..7ae2279 100644 --- a/attributes/collector.rb +++ b/attributes/collector.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Attributes:: collector diff --git a/attributes/copy_or_download_file.rb b/attributes/copy_or_download_file.rb index 94ec618..6854fbf 100644 --- a/attributes/copy_or_download_file.rb +++ b/attributes/copy_or_download_file.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Attributes:: copy_or_download_file diff --git a/attributes/default.rb b/attributes/default.rb index 530c744..0a00f33 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Attributes:: default diff --git a/attributes/dotnet_agent.rb b/attributes/dotnet_agent.rb index 22ad26d..0e25067 100644 --- a/attributes/dotnet_agent.rb +++ b/attributes/dotnet_agent.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Attributes:: dotnet_agent diff --git a/attributes/host_agent.rb b/attributes/host_agent.rb index 597e93d..aed6b70 100644 --- a/attributes/host_agent.rb +++ b/attributes/host_agent.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Attributes:: host_agent diff --git a/attributes/iis_wsagent.rb b/attributes/iis_wsagent.rb index 700aff0..b94fc76 100644 --- a/attributes/iis_wsagent.rb +++ b/attributes/iis_wsagent.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Attributes:: iis_wsagent diff --git a/attributes/java.rb b/attributes/java.rb index 218fb42..b00f269 100644 --- a/attributes/java.rb +++ b/attributes/java.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Attributes:: java diff --git a/attributes/java_agent.rb b/attributes/java_agent.rb index cfbf121..3ede243 100644 --- a/attributes/java_agent.rb +++ b/attributes/java_agent.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Attributes:: java_agent diff --git a/attributes/memory_analysis_server.rb b/attributes/memory_analysis_server.rb index 931a111..8b16a42 100644 --- a/attributes/memory_analysis_server.rb +++ b/attributes/memory_analysis_server.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Attributes:: memory_analysis_server diff --git a/attributes/one_agent.rb b/attributes/one_agent.rb index 726e374..d4e304d 100644 --- a/attributes/one_agent.rb +++ b/attributes/one_agent.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # The Dynatrace One Agent package will be installed into the directory # node['dynatrace']['agents_package']['linux']['installer']['prefix_dir']/dynatrace-$major-$minor-$rev, # where $major, $minor and $rev are given by the installer. A symbolic link to the actual installation directory will diff --git a/attributes/server.rb b/attributes/server.rb index 4025b13..1789afa 100644 --- a/attributes/server.rb +++ b/attributes/server.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Attributes:: server @@ -50,7 +52,7 @@ default['dynatrace']['server']['pwh_connection']['password'] = 'dynatrace' # Accepted HTTP return codes when setting PWH connection. Used mainly for integration tests -default['dynatrace']['server']['pwh_connection']['success_codes'] = %w(200) +default['dynatrace']['server']['pwh_connection']['success_codes'] = %w[200] # Set a longer boot timeout due to the time to open the collector port # (see log "[SelfMonitoringLauncher] Waiting for self-monitoring Collector startup (max: 90 seconds)") diff --git a/attributes/server_update.rb b/attributes/server_update.rb index fc598c5..d953ff9 100644 --- a/attributes/server_update.rb +++ b/attributes/server_update.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Attributes:: server_update diff --git a/attributes/upgrade_system.rb b/attributes/upgrade_system.rb index 8da42cb..3ac1161 100644 --- a/attributes/upgrade_system.rb +++ b/attributes/upgrade_system.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: upgrade_system # Attributes:: upgrade system diff --git a/attributes/wsagent_package.rb b/attributes/wsagent_package.rb index 3e500e6..cecc701 100644 --- a/attributes/wsagent_package.rb +++ b/attributes/wsagent_package.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Attributes:: wsagent_package diff --git a/libraries/cache_data.rb b/libraries/cache_data.rb index 87d6bd7..27b79e9 100644 --- a/libraries/cache_data.rb +++ b/libraries/cache_data.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Libraries:: cache_data diff --git a/libraries/endpoint_helpers.rb b/libraries/endpoint_helpers.rb index fba0fad..6785460 100644 --- a/libraries/endpoint_helpers.rb +++ b/libraries/endpoint_helpers.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Libraries:: endpoint_helpers @@ -19,9 +21,9 @@ class DynatraceTimeout < Timeout::Error; end # Exception used to inform that a connection endpoint (listening port, REST WS) is still not available class DynatraceNotReady < StandardError def initialize(endpoint, timeout) - super <<-EOH -The Dynatrace Server at `#{endpoint}' did not become ready within #{timeout} seconds. -Possibly, Dynatrace has failed to start. Please check your Dynatrace Server log files. + super <<~EOH + The Dynatrace Server at `#{endpoint}' did not become ready within #{timeout} seconds. + Possibly, Dynatrace has failed to start. Please check your Dynatrace Server log files. EOH end end @@ -90,7 +92,7 @@ def self.wait_until_rest_endpoint_is_ready!(endpoint, timeout = 180) def self.rest_get(endpoint, user, pass, options = {}) options[:accept] = options.fetch(:accept, 'application/json') - options[:success_codes] = options.fetch(:success_codes, %w(200)) + options[:success_codes] = options.fetch(:success_codes, %w[200]) uri = URI(endpoint) http = Net::HTTP.new(uri.host, uri.port) @@ -106,7 +108,7 @@ def self.rest_get(endpoint, user, pass, options = {}) def self.rest_put(endpoint, user, pass, body, options = {}) options[:accept] = options.fetch(:accept, 'application/json') - options[:success_codes] = options.fetch(:success_codes, %w(200)) + options[:success_codes] = options.fetch(:success_codes, %w[200]) uri = URI(endpoint) http = Net::HTTP.new(uri.host, uri.port) diff --git a/libraries/file_helpers.rb b/libraries/file_helpers.rb index 79079cc..5630f39 100644 --- a/libraries/file_helpers.rb +++ b/libraries/file_helpers.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Libraries:: file_helpers diff --git a/libraries/package_helpers.rb b/libraries/package_helpers.rb index 5f3da98..a73feca 100644 --- a/libraries/package_helpers.rb +++ b/libraries/package_helpers.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Libraries:: package_helpers diff --git a/libraries/process_helpers.rb b/libraries/process_helpers.rb index 97eaf2f..da67a1c 100644 --- a/libraries/process_helpers.rb +++ b/libraries/process_helpers.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Libraries:: process_helpers @@ -53,7 +55,7 @@ def self.stop_processes(proc_pattern, proc_user, platform_family, timeout = 15, # private_class_method def self.find_pids(pattern, user, platform_family) pids = [] - raise 'ERROR: Unsupported platform' unless %w(debian fedora rhel).include? platform_family + raise 'ERROR: Unsupported platform' unless %w[debian fedora rhel].include? platform_family pgrep_pattern_opt = !pattern.nil? ? "-f \"#{pattern}\"" : '' pgrep_user_opt = !user.nil? ? "-u #{user}" : '' diff --git a/libraries/s3_helpers.rb b/libraries/s3_helpers.rb index 084c25d..761c014 100644 --- a/libraries/s3_helpers.rb +++ b/libraries/s3_helpers.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Libraries:: s3_helpers diff --git a/metadata.rb b/metadata.rb index 9b85bef..36dac0a 100644 --- a/metadata.rb +++ b/metadata.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + name 'dynatrace-appmon' maintainer 'Martin Etmajer' maintainer_email 'martin.etmajer@dynatrace.com' @@ -9,7 +11,7 @@ issues_url 'https://github.com/Dynatrace/Dynatrace-AppMon-Chef/issues' chef_version '>= 12.1' -%w( debian ubuntu redhat centos fedora amazon windows ).each do |os| +%w[debian ubuntu redhat centos fedora amazon windows].each do |os| supports os end diff --git a/providers/configure_ini_files.rb b/providers/configure_ini_files.rb index 20ccdcf..70ff822 100644 --- a/providers/configure_ini_files.rb +++ b/providers/configure_ini_files.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Providers:: configure_ini_files diff --git a/providers/configure_init_scripts.rb b/providers/configure_init_scripts.rb index f75d03f..b2cfbcd 100644 --- a/providers/configure_init_scripts.rb +++ b/providers/configure_init_scripts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Providers:: configure_init_scripts diff --git a/providers/copy_or_download_file.rb b/providers/copy_or_download_file.rb index 5fc7cea..06a84a3 100644 --- a/providers/copy_or_download_file.rb +++ b/providers/copy_or_download_file.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Providers:: copy_or_download_file diff --git a/providers/delete_directory_by_link.rb b/providers/delete_directory_by_link.rb index 6df2b65..84dd2f5 100644 --- a/providers/delete_directory_by_link.rb +++ b/providers/delete_directory_by_link.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Providers:: delete_directory_by_link diff --git a/providers/run_jar_installer.rb b/providers/run_jar_installer.rb index 12b267b..d73292d 100644 --- a/providers/run_jar_installer.rb +++ b/providers/run_jar_installer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Providers:: run_jar_installer diff --git a/providers/run_tar_installer.rb b/providers/run_tar_installer.rb index 23160d1..060f431 100644 --- a/providers/run_tar_installer.rb +++ b/providers/run_tar_installer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Providers:: run_tar_installer diff --git a/recipes/agents_package.rb b/recipes/agents_package.rb index 28629f0..3779e7c 100644 --- a/recipes/agents_package.rb +++ b/recipes/agents_package.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Recipes:: agents_package diff --git a/recipes/agents_package_uninstall.rb b/recipes/agents_package_uninstall.rb index d41352a..c84c4d7 100644 --- a/recipes/agents_package_uninstall.rb +++ b/recipes/agents_package_uninstall.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Recipes:: agents_package_uninstall diff --git a/recipes/apache_wsagent.rb b/recipes/apache_wsagent.rb index 3a788bb..e0cfb2f 100644 --- a/recipes/apache_wsagent.rb +++ b/recipes/apache_wsagent.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Recipes:: apache_wsagent diff --git a/recipes/apache_wsagent_uninstall.rb b/recipes/apache_wsagent_uninstall.rb index 328094c..40564ee 100644 --- a/recipes/apache_wsagent_uninstall.rb +++ b/recipes/apache_wsagent_uninstall.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Recipes:: apache_wsagent_uninstall diff --git a/recipes/collector.rb b/recipes/collector.rb index 74cab1f..f702074 100644 --- a/recipes/collector.rb +++ b/recipes/collector.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Recipes:: collector @@ -103,7 +105,7 @@ service_name service # For Debian and Ubuntu distros - to correctly stop our service we need the status support which is disabled by default supports :status => true - action [:start, :enable] + action %i[start enable] end ruby_block "Waiting for port #{agent_port} to become available" do diff --git a/recipes/collector_uninstall.rb b/recipes/collector_uninstall.rb index 560233f..85a9414 100644 --- a/recipes/collector_uninstall.rb +++ b/recipes/collector_uninstall.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Recipes:: collector_uninstall diff --git a/recipes/default.rb b/recipes/default.rb index ac5bf2e..bc7e4e9 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Recipes:: default diff --git a/recipes/dotnet_agent.rb b/recipes/dotnet_agent.rb index db0e7e0..9801ff1 100644 --- a/recipes/dotnet_agent.rb +++ b/recipes/dotnet_agent.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Recipes:: dotnet_agent diff --git a/recipes/dynatrace_user.rb b/recipes/dynatrace_user.rb index 59a5429..c76de69 100644 --- a/recipes/dynatrace_user.rb +++ b/recipes/dynatrace_user.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Recipes:: dynatrace_user diff --git a/recipes/dynatrace_user_uninstall.rb b/recipes/dynatrace_user_uninstall.rb index 9736c0a..356510d 100644 --- a/recipes/dynatrace_user_uninstall.rb +++ b/recipes/dynatrace_user_uninstall.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Recipes:: dynatrace_user_uninstall diff --git a/recipes/host_agent.rb b/recipes/host_agent.rb index bfe977f..64c7d14 100644 --- a/recipes/host_agent.rb +++ b/recipes/host_agent.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Recipes:: host_agent @@ -115,5 +117,5 @@ service_name service_name # For Debian and Ubuntu distros - to correctly stop our service we need the status support which is disabled by default supports :status => true - action [:enable, :start] + action %i[enable start] end diff --git a/recipes/host_agent_uninstall.rb b/recipes/host_agent_uninstall.rb index e232e23..db44fdb 100644 --- a/recipes/host_agent_uninstall.rb +++ b/recipes/host_agent_uninstall.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Recipes:: host_agent_uninstall diff --git a/recipes/iis_wsagent.rb b/recipes/iis_wsagent.rb index 7512390..d8be630 100644 --- a/recipes/iis_wsagent.rb +++ b/recipes/iis_wsagent.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Recipes:: iis_wsagent diff --git a/recipes/java.rb b/recipes/java.rb index 3e0d742..cb5aaf0 100644 --- a/recipes/java.rb +++ b/recipes/java.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Recipes:: java diff --git a/recipes/java_agent.rb b/recipes/java_agent.rb index 8a73234..358a822 100644 --- a/recipes/java_agent.rb +++ b/recipes/java_agent.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Recipes:: java_agent diff --git a/recipes/memory_analysis_server.rb b/recipes/memory_analysis_server.rb index 6fb68e8..796f8b4 100644 --- a/recipes/memory_analysis_server.rb +++ b/recipes/memory_analysis_server.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Recipes:: memory_analysis_server @@ -95,7 +97,7 @@ service_name service # For Debian and Ubuntu distros - to correctly stop our service we need the status support which is disabled by default supports :status => true - action [:start, :enable] + action %i[start enable] end ruby_block "Waiting for port #{server_port} to become available" do diff --git a/recipes/node_info.rb b/recipes/node_info.rb index a9c6825..0228178 100644 --- a/recipes/node_info.rb +++ b/recipes/node_info.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Recipes:: node_info diff --git a/recipes/one_agent.rb b/recipes/one_agent.rb index dfd7ad3..973d232 100644 --- a/recipes/one_agent.rb +++ b/recipes/one_agent.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Recipes:: one_agent diff --git a/recipes/prerequisites.rb b/recipes/prerequisites.rb index 91e993e..1aedba1 100644 --- a/recipes/prerequisites.rb +++ b/recipes/prerequisites.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Recipes:: prerequisites diff --git a/recipes/server.rb b/recipes/server.rb index eaae3aa..284457a 100644 --- a/recipes/server.rb +++ b/recipes/server.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Recipes:: server @@ -119,7 +121,7 @@ service_name service # For Debian and Ubuntu distros - to correctly stop our service we need the status support which is disabled by default supports :status => true - action [:start, :enable] + action %i[start enable] end max_boot_time = node['dynatrace']['server']['max_boot_time'] diff --git a/recipes/server_ldap_config.rb b/recipes/server_ldap_config.rb index ff71d4a..a1992a6 100644 --- a/recipes/server_ldap_config.rb +++ b/recipes/server_ldap_config.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Recipes:: server_ldap_config @@ -46,6 +48,6 @@ rest_user, rest_pass, body, - :success_codes => %w(204)) + :success_codes => %w[204]) end end diff --git a/recipes/server_license.rb b/recipes/server_license.rb index ad91535..9805513 100644 --- a/recipes/server_license.rb +++ b/recipes/server_license.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Recipes:: server_license diff --git a/recipes/server_pwh_connection.rb b/recipes/server_pwh_connection.rb index 66057fb..4cd6993 100644 --- a/recipes/server_pwh_connection.rb +++ b/recipes/server_pwh_connection.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Recipes:: server_pwh_connection diff --git a/recipes/server_uninstall.rb b/recipes/server_uninstall.rb index 7a1fadd..f941b3b 100644 --- a/recipes/server_uninstall.rb +++ b/recipes/server_uninstall.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Recipes:: server_uninstall diff --git a/recipes/server_update.rb b/recipes/server_update.rb index f8b442d..8a37078 100644 --- a/recipes/server_update.rb +++ b/recipes/server_update.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Cookbook Name:: dynatrace # Recipes:: server_update # diff --git a/recipes/server_user_groups.rb b/recipes/server_user_groups.rb index 1ca9ea7..1eaed90 100644 --- a/recipes/server_user_groups.rb +++ b/recipes/server_user_groups.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Recipes:: server_user_groups @@ -49,7 +51,7 @@ rest_user, rest_pass, JSON.dump(group_descr), - :success_codes => %w(201 204 403)) + :success_codes => %w[201 204 403]) # Pass over erroneous attempts to modify a group (error 403) - it is normal for some predefined groups # e.g. 'Personal System Profile Access' group diff --git a/recipes/server_users.rb b/recipes/server_users.rb index cc836df..be65ad8 100644 --- a/recipes/server_users.rb +++ b/recipes/server_users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Recipes:: server_users @@ -44,7 +46,7 @@ rest_user, rest_pass, JSON.dump(user_descr), - :success_codes => %w(201 204)) + :success_codes => %w[201 204]) end end only_if { node['dynatrace']['server']['user_config']['users'] } diff --git a/recipes/upgrade_system.rb b/recipes/upgrade_system.rb index 6b0d723..f85b1d9 100644 --- a/recipes/upgrade_system.rb +++ b/recipes/upgrade_system.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: upgrade_system # Recipes:: dynatrace diff --git a/recipes/wsagent_package.rb b/recipes/wsagent_package.rb index 238f2b1..53f3b04 100644 --- a/recipes/wsagent_package.rb +++ b/recipes/wsagent_package.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Recipes:: wsagent_package @@ -103,7 +105,7 @@ service_name service # For Debian and Ubuntu distros - to correctly stop our service we need the status support which is disabled by default supports :status => true - action [:start, :enable] + action %i[start enable] end elsif platform_family?('windows') dynatrace_powershell_scripts_project = "#{installer_cache_dir}\\Dynatrace-Powershell" diff --git a/recipes/wsagent_package_uninstall.rb b/recipes/wsagent_package_uninstall.rb index 43c721b..20df320 100644 --- a/recipes/wsagent_package_uninstall.rb +++ b/recipes/wsagent_package_uninstall.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Recipes:: wsagent_package_uninstall diff --git a/resources/configure_ini_files.rb b/resources/configure_ini_files.rb index c4462af..2ee0a72 100644 --- a/resources/configure_ini_files.rb +++ b/resources/configure_ini_files.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Resources:: configure_ini_files diff --git a/resources/configure_init_scripts.rb b/resources/configure_init_scripts.rb index 3f6d256..0692d0e 100644 --- a/resources/configure_init_scripts.rb +++ b/resources/configure_init_scripts.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Resources:: configure_init_scripts diff --git a/resources/copy_or_download_file.rb b/resources/copy_or_download_file.rb index ff7b694..a27eeb7 100644 --- a/resources/copy_or_download_file.rb +++ b/resources/copy_or_download_file.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Resources:: copy_or_download_file diff --git a/resources/delete_directory_by_link.rb b/resources/delete_directory_by_link.rb index c2af317..68c0005 100644 --- a/resources/delete_directory_by_link.rb +++ b/resources/delete_directory_by_link.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Resources:: delete_directory_by_link diff --git a/resources/java_agent.rb b/resources/java_agent.rb index 6574acd..28da210 100644 --- a/resources/java_agent.rb +++ b/resources/java_agent.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Resource:: java_agent diff --git a/resources/run_jar_installer.rb b/resources/run_jar_installer.rb index c2673a6..32d8d19 100644 --- a/resources/run_jar_installer.rb +++ b/resources/run_jar_installer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Resources:: run_jar_installer diff --git a/resources/run_tar_installer.rb b/resources/run_tar_installer.rb index b113feb..07c3600 100644 --- a/resources/run_tar_installer.rb +++ b/resources/run_tar_installer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Resources:: run_tar_installer diff --git a/resources/s3_file.rb b/resources/s3_file.rb index 955cfd9..d4d853d 100644 --- a/resources/s3_file.rb +++ b/resources/s3_file.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Resource:: s3_file diff --git a/resources/uninstall_package.rb b/resources/uninstall_package.rb index d5967ae..40d90df 100644 --- a/resources/uninstall_package.rb +++ b/resources/uninstall_package.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Cookbook Name:: dynatrace # Resource:: uninstall_package @@ -22,7 +24,7 @@ service service_name do # For Debian and Ubuntu distros - to correctly stop our service we need the status support which is disabled by default supports :status => true - action [:stop, :disable] + action %i[stop disable] end end diff --git a/test/integration/agents_package/serverspec/agents_package_spec.rb b/test/integration/agents_package/serverspec/agents_package_spec.rb index 1923f64..3eb38af 100644 --- a/test/integration/agents_package/serverspec/agents_package_spec.rb +++ b/test/integration/agents_package/serverspec/agents_package_spec.rb @@ -1,6 +1,8 @@ +# frozen_string_literal: true + require 'spec_helper' -if %w(debian redhat ubuntu).include? os[:family] +if %w[debian redhat ubuntu].include? os[:family] describe user('dynatrace') do it { should exist } it { should belong_to_group 'dynatrace' } diff --git a/test/integration/agents_package/serverspec/spec_helper.rb b/test/integration/agents_package/serverspec/spec_helper.rb index b5d2b22..97b5185 100644 --- a/test/integration/agents_package/serverspec/spec_helper.rb +++ b/test/integration/agents_package/serverspec/spec_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'serverspec' if (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM).nil? diff --git a/test/integration/agents_package_uninstall/serverspec/agents_package_uninstall_spec.rb b/test/integration/agents_package_uninstall/serverspec/agents_package_uninstall_spec.rb index 50ac6b6..6eb59b1 100644 --- a/test/integration/agents_package_uninstall/serverspec/agents_package_uninstall_spec.rb +++ b/test/integration/agents_package_uninstall/serverspec/agents_package_uninstall_spec.rb @@ -1,6 +1,8 @@ +# frozen_string_literal: true + require 'spec_helper' -if %w(debian redhat ubuntu).include? os[:family] +if %w[debian redhat ubuntu].include? os[:family] describe file('/opt/dynatrace') do it { should_not exist } end diff --git a/test/integration/agents_package_uninstall/serverspec/spec_helper.rb b/test/integration/agents_package_uninstall/serverspec/spec_helper.rb index b5d2b22..97b5185 100644 --- a/test/integration/agents_package_uninstall/serverspec/spec_helper.rb +++ b/test/integration/agents_package_uninstall/serverspec/spec_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'serverspec' if (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM).nil? diff --git a/test/integration/apache_wsagent/serverspec/apache_wsagent_spec.rb b/test/integration/apache_wsagent/serverspec/apache_wsagent_spec.rb index 086b11e..f089fe4 100644 --- a/test/integration/apache_wsagent/serverspec/apache_wsagent_spec.rb +++ b/test/integration/apache_wsagent/serverspec/apache_wsagent_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'serverspec' # Required by serverspec diff --git a/test/integration/apache_wsagent_uninstall/serverspec/apache_wsagent_uninstall_spec.rb b/test/integration/apache_wsagent_uninstall/serverspec/apache_wsagent_uninstall_spec.rb index 9e6740b..dabe30a 100644 --- a/test/integration/apache_wsagent_uninstall/serverspec/apache_wsagent_uninstall_spec.rb +++ b/test/integration/apache_wsagent_uninstall/serverspec/apache_wsagent_uninstall_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'serverspec' # Required by serverspec diff --git a/test/integration/collector/serverspec/collector_spec.rb b/test/integration/collector/serverspec/collector_spec.rb index 15156da..1e1a831 100644 --- a/test/integration/collector/serverspec/collector_spec.rb +++ b/test/integration/collector/serverspec/collector_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'serverspec' # Required by serverspec diff --git a/test/integration/collector_uninstall/serverspec/collector_uninstall_spec.rb b/test/integration/collector_uninstall/serverspec/collector_uninstall_spec.rb index 14ae170..f57fa01 100644 --- a/test/integration/collector_uninstall/serverspec/collector_uninstall_spec.rb +++ b/test/integration/collector_uninstall/serverspec/collector_uninstall_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'serverspec' # Required by serverspec diff --git a/test/integration/dotnet_agent/serverspec/dotnet_agent_spec.rb b/test/integration/dotnet_agent/serverspec/dotnet_agent_spec.rb index 2cbabc1..d0c0eff 100644 --- a/test/integration/dotnet_agent/serverspec/dotnet_agent_spec.rb +++ b/test/integration/dotnet_agent/serverspec/dotnet_agent_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe windows_registry_key('HKLM:\SOFTWARE\Wow6432Node\dynaTrace\Agent\Whitelist\1') do diff --git a/test/integration/dotnet_agent/serverspec/spec_helper.rb b/test/integration/dotnet_agent/serverspec/spec_helper.rb index 5a8faa8..cc0f3b4 100644 --- a/test/integration/dotnet_agent/serverspec/spec_helper.rb +++ b/test/integration/dotnet_agent/serverspec/spec_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'serverspec' set :backend, :cmd diff --git a/test/integration/host_agent/serverspec/host_agent_spec.rb b/test/integration/host_agent/serverspec/host_agent_spec.rb index 1479d55..de24209 100644 --- a/test/integration/host_agent/serverspec/host_agent_spec.rb +++ b/test/integration/host_agent/serverspec/host_agent_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'serverspec' # Required by serverspec diff --git a/test/integration/host_agent_uninstall/serverspec/host_agent_uninstall_spec.rb b/test/integration/host_agent_uninstall/serverspec/host_agent_uninstall_spec.rb index 5130513..4cd66d7 100644 --- a/test/integration/host_agent_uninstall/serverspec/host_agent_uninstall_spec.rb +++ b/test/integration/host_agent_uninstall/serverspec/host_agent_uninstall_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'serverspec' # Required by serverspec diff --git a/test/integration/java_agent/serverspec/java_agent_spec.rb b/test/integration/java_agent/serverspec/java_agent_spec.rb index 15020b7..5f28975 100644 --- a/test/integration/java_agent/serverspec/java_agent_spec.rb +++ b/test/integration/java_agent/serverspec/java_agent_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'serverspec' # Required by serverspec diff --git a/test/integration/memory_analysis_server/serverspec/memory_analysis_server_spec.rb b/test/integration/memory_analysis_server/serverspec/memory_analysis_server_spec.rb index 197ff76..efbcf6a 100644 --- a/test/integration/memory_analysis_server/serverspec/memory_analysis_server_spec.rb +++ b/test/integration/memory_analysis_server/serverspec/memory_analysis_server_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'serverspec' # Required by serverspec diff --git a/test/integration/one_agent/serverspec/one_agent_spec.rb b/test/integration/one_agent/serverspec/one_agent_spec.rb index 44d5b55..4d27702 100644 --- a/test/integration/one_agent/serverspec/one_agent_spec.rb +++ b/test/integration/one_agent/serverspec/one_agent_spec.rb @@ -1,6 +1,8 @@ +# frozen_string_literal: true + require 'spec_helper' -if %w(debian redhat ubuntu).include? os[:family] +if %w[debian redhat ubuntu].include? os[:family] describe user('dynatrace') do it { should exist } it { should belong_to_group 'dynatrace' } diff --git a/test/integration/one_agent/serverspec/spec_helper.rb b/test/integration/one_agent/serverspec/spec_helper.rb index b5d2b22..97b5185 100644 --- a/test/integration/one_agent/serverspec/spec_helper.rb +++ b/test/integration/one_agent/serverspec/spec_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'serverspec' if (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM).nil? diff --git a/test/integration/server/serverspec/server_spec.rb b/test/integration/server/serverspec/server_spec.rb index 4002fb5..b54450a 100644 --- a/test/integration/server/serverspec/server_spec.rb +++ b/test/integration/server/serverspec/server_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'json' require 'net/http' require 'serverspec' diff --git a/test/integration/server_uninstall/serverspec/server_uninstall_spec.rb b/test/integration/server_uninstall/serverspec/server_uninstall_spec.rb index 4ee07e2..e30ccb0 100644 --- a/test/integration/server_uninstall/serverspec/server_uninstall_spec.rb +++ b/test/integration/server_uninstall/serverspec/server_uninstall_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'serverspec' # Required by serverspec diff --git a/test/integration/server_update/serverspec/server_update_spec.rb b/test/integration/server_update/serverspec/server_update_spec.rb index 1e804ca..f298f6e 100644 --- a/test/integration/server_update/serverspec/server_update_spec.rb +++ b/test/integration/server_update/serverspec/server_update_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'net/http' require 'rexml/document' include REXML diff --git a/test/integration/wsagent_package/serverspec/spec_helper.rb b/test/integration/wsagent_package/serverspec/spec_helper.rb index b5d2b22..97b5185 100644 --- a/test/integration/wsagent_package/serverspec/spec_helper.rb +++ b/test/integration/wsagent_package/serverspec/spec_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'serverspec' if (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM).nil? diff --git a/test/integration/wsagent_package/serverspec/wsagent_package_spec.rb b/test/integration/wsagent_package/serverspec/wsagent_package_spec.rb index 2ccc7f3..9f69284 100644 --- a/test/integration/wsagent_package/serverspec/wsagent_package_spec.rb +++ b/test/integration/wsagent_package/serverspec/wsagent_package_spec.rb @@ -1,6 +1,8 @@ +# frozen_string_literal: true + require 'spec_helper' -if %w(debian redhat ubuntu).include? os[:family] +if %w[debian redhat ubuntu].include? os[:family] describe user('dynatrace') do it { should exist } it { should belong_to_group 'dynatrace' } diff --git a/test/integration/wsagent_package_uninstall/serverspec/spec_helper.rb b/test/integration/wsagent_package_uninstall/serverspec/spec_helper.rb index b5d2b22..97b5185 100644 --- a/test/integration/wsagent_package_uninstall/serverspec/spec_helper.rb +++ b/test/integration/wsagent_package_uninstall/serverspec/spec_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'serverspec' if (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM).nil? diff --git a/test/integration/wsagent_package_uninstall/serverspec/wsagent_package_uninstall_spec.rb b/test/integration/wsagent_package_uninstall/serverspec/wsagent_package_uninstall_spec.rb index 48c5132..f3cdabe 100644 --- a/test/integration/wsagent_package_uninstall/serverspec/wsagent_package_uninstall_spec.rb +++ b/test/integration/wsagent_package_uninstall/serverspec/wsagent_package_uninstall_spec.rb @@ -1,6 +1,8 @@ +# frozen_string_literal: true + require 'spec_helper' -if %w(debian redhat ubuntu).include? os[:family] +if %w[debian redhat ubuntu].include? os[:family] describe file('/opt/dynatrace') do it { should_not exist } end