From a9b7d57640fb331f250bd20d1f60ec742fc474af Mon Sep 17 00:00:00 2001 From: Cookstyle Bot Date: Wed, 26 Jan 2022 13:56:30 -0800 Subject: [PATCH] Cookstyle Bot Auto Corrections with Cookstyle 7.31.1 This change is automatically generated by the Cookstyle Bot using the latest version of Cookstyle (7.31.1). Adopting changes suggested by Cookstyle improves cookbook readability, avoids common coding mistakes, and eases upgrades to newer versions of the Chef Infra Client. Signed-off-by: Cookstyle --- attributes/default.rb | 6 +++--- libraries/helpers.rb | 4 ++-- metadata.rb | 10 +++------- recipes/_ip-detect.rb | 4 ++-- recipes/cli.rb | 4 ++-- recipes/default.rb | 6 +++--- resources/dcos_user.rb | 8 ++++---- spec/spec_helper.rb | 2 -- spec/unit/recipes/cli_spec.rb | 4 ++-- spec/unit/recipes/default_spec.rb | 6 +++--- test/integration/default/controls/default_spec.rb | 2 +- 11 files changed, 25 insertions(+), 31 deletions(-) diff --git a/attributes/default.rb b/attributes/default.rb index 0b1b7c9..18f37c6 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -1,9 +1,9 @@ # # Author:: Matt Ray -# Cookbook Name:: dcos +# Cookbook:: dcos # -# Copyright 2016 Chef Software, Inc -# Copyright 2017-2018 Chris Gianelloni +# Copyright:: 2016 Chef Software, Inc +# Copyright:: 2017-2018 Chris Gianelloni # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/libraries/helpers.rb b/libraries/helpers.rb index dd56ebf..726f86a 100644 --- a/libraries/helpers.rb +++ b/libraries/helpers.rb @@ -30,7 +30,7 @@ def dcos_base_url return 'https://downloads.dcos.io/dcos/EarlyAccess' if v.downcase == 'earlyaccess' if v.to_f >= 1.10 return "https://downloads.mesosphere.com/dcos-enterprise/stable/#{v}" if dcos_enterprise? - return "https://downloads.dcos.io/dcos/stable/#{v}" + "https://downloads.dcos.io/dcos/stable/#{v}" else # stable or older releases return 'https://downloads.mesosphere.com/dcos-enterprise/stable/1.12.2' if dcos_enterprise? 'https://downloads.dcos.io/dcos/stable' @@ -39,5 +39,5 @@ def dcos_base_url end end -Chef::Recipe.send(:include, Dcos::Helpers) +Chef::DSL::Recipe.send(:include, Dcos::Helpers) Chef::Resource.send(:include, Dcos::Helpers) diff --git a/metadata.rb b/metadata.rb index 2ade19b..055988f 100644 --- a/metadata.rb +++ b/metadata.rb @@ -3,15 +3,11 @@ maintainer_email 'partnereng@chef.io' license 'Apache-2.0' description 'Installs/Configures Mesosphere DC/OS' -long_description 'Installs/Configures Mesosphere DC/OS' version '3.0.1' -source_url 'https://github.com/chef-partners/dcos-cookbook' if - respond_to?(:source_url) -issues_url 'https://github.com/chef-partners/dcos-cookbook/issues' if - respond_to?(:issues_url) -chef_version '>= 12.10' if - respond_to?(:chef_version) +source_url 'https://github.com/chef-partners/dcos-cookbook' +issues_url 'https://github.com/chef-partners/dcos-cookbook/issues' +chef_version '>= 12.10' %w( centos diff --git a/recipes/_ip-detect.rb b/recipes/_ip-detect.rb index bc37cf2..54aba9d 100644 --- a/recipes/_ip-detect.rb +++ b/recipes/_ip-detect.rb @@ -1,8 +1,8 @@ # -# Cookbook Name:: dcos +# Cookbook:: dcos # Recipe:: _ip-detect # -# Copyright 2016, Chef Software, Inc. +# Copyright:: 2016, 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. diff --git a/recipes/cli.rb b/recipes/cli.rb index 3886ecf..020158a 100644 --- a/recipes/cli.rb +++ b/recipes/cli.rb @@ -1,8 +1,8 @@ # -# Cookbook Name:: dcos +# Cookbook:: dcos # Recipe:: cli # -# Copyright 2018 Chris Gianelloni +# Copyright:: 2018 Chris Gianelloni # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/recipes/default.rb b/recipes/default.rb index 69d3171..ad1d75c 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -1,9 +1,9 @@ # -# Cookbook Name:: dcos +# Cookbook:: dcos # Recipe:: default # -# Copyright 2016, Chef Software, Inc. -# Copyright 2017-2018 Chris Gianelloni +# Copyright:: 2016, Chef Software, Inc. +# Copyright:: 2017-2018 Chris Gianelloni # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/resources/dcos_user.rb b/resources/dcos_user.rb index ef20855..223d532 100644 --- a/resources/dcos_user.rb +++ b/resources/dcos_user.rb @@ -1,8 +1,8 @@ # -# Cookbook Name:: dcos +# Cookbook:: dcos # Recipe:: default # -# Copyright 2018, Chef Software, Inc. +# Copyright:: 2018, 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. @@ -18,10 +18,10 @@ # resource_name :dcos_user +provides :dcos_user +unified_mode true property :zk_host, String, - default: 'zk-1.zk:2181,zk-2.zk:2181,zk-3.zk:2181,zk-4.zk:2181,'\ - 'zk-5.zk:2181', required: true property :email, String, required: false diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 7fe8b16..5d94fb3 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -5,5 +5,3 @@ config.formatter = :documentation config.color = true end - -at_exit { ChefSpec::Coverage.report! } diff --git a/spec/unit/recipes/cli_spec.rb b/spec/unit/recipes/cli_spec.rb index a2faa85..294b1e5 100644 --- a/spec/unit/recipes/cli_spec.rb +++ b/spec/unit/recipes/cli_spec.rb @@ -1,5 +1,5 @@ # -# Cookbook Name:: dcos +# Cookbook:: dcos # Spec:: cli # @@ -8,7 +8,7 @@ describe 'dcos::cli' do context 'Default behavior' do let(:chef_run) do - ChefSpec::SoloRunner.new(platform: 'centos', version: '7.3.1611').converge(described_recipe) + ChefSpec::SoloRunner.new(platform: 'centos', version: '7').converge(described_recipe) end it 'creates remote_file[/usr/local/bin/dcos]' do diff --git a/spec/unit/recipes/default_spec.rb b/spec/unit/recipes/default_spec.rb index 5a61ce3..8cca4f6 100644 --- a/spec/unit/recipes/default_spec.rb +++ b/spec/unit/recipes/default_spec.rb @@ -1,5 +1,5 @@ # -# Cookbook Name:: dcos +# Cookbook:: dcos # Spec:: default # @@ -8,7 +8,7 @@ describe 'dcos::default' do context 'Default behavior, assume eth0' do let(:chef_run) do - ChefSpec::SoloRunner.new(platform: 'centos', version: '7.3.1611') do |node| + ChefSpec::SoloRunner.new(platform: 'centos', version: '7') do |node| node.override['network']['interfaces']['eth0']['addresses'] = { '1.2.3.4' => @@ -104,7 +104,7 @@ context 'DC/OS Enterprise 1.11' do let(:chef_run) do - ChefSpec::SoloRunner.new(platform: 'centos', version: '7.3.1611') do |node| + ChefSpec::SoloRunner.new(platform: 'centos', version: '7') do |node| node.override['dcos']['dcos_enterprise'] = true node.override['dcos']['dcos_version'] = '1.11.1' node.override['dcos']['dcos_license_text'] = 'STUB' diff --git a/test/integration/default/controls/default_spec.rb b/test/integration/default/controls/default_spec.rb index 7a0922d..05cb092 100644 --- a/test/integration/default/controls/default_spec.rb +++ b/test/integration/default/controls/default_spec.rb @@ -103,7 +103,7 @@ end describe yaml('/etc/rexray/config.yml') do - its(['rexray', 'modules', 'default-docker', 'disabled']) { should eq true } + its(%w(rexray modules default-docker disabled)) { should eq true } end # IPv4 (TCP + UDP)