summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-02-25 15:16:32 -0800
committerTim Smith <tsmith84@gmail.com>2020-02-25 15:16:32 -0800
commit7cc078609ad5d2fdc7ace4338de17501b98b57a5 (patch)
tree509ffbceacab909699cd6ee9f4255c624d5be715
parent372ce32577b49a499638a58d4f38ffbaab7640aa (diff)
downloadchef-cookstyle.tar.gz
Cookstyle fixes for our resourcescookstyle
I ran cookstyle against the resources and fixes a few minor issues: - Remove the now default guard interpreter from a powershell_script - Use our rdoc like header format everywhere - Remove some duplicate copyrights - Simplify a few platform case statements Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/chef/provider/group/usermod.rb7
-rw-r--r--lib/chef/provider/package/homebrew.rb3
-rw-r--r--lib/chef/provider/package/zypper.rb2
-rw-r--r--lib/chef/provider/route.rb4
-rw-r--r--lib/chef/resource/homebrew_package.rb3
-rw-r--r--lib/chef/resource/kernel_module.rb4
-rw-r--r--lib/chef/resource/swap_file.rb4
-rw-r--r--lib/chef/resource/timezone.rb4
-rw-r--r--lib/chef/resource/windows_certificate.rb1
9 files changed, 13 insertions, 19 deletions
diff --git a/lib/chef/provider/group/usermod.rb b/lib/chef/provider/group/usermod.rb
index b4e93580ff..90386b1659 100644
--- a/lib/chef/provider/group/usermod.rb
+++ b/lib/chef/provider/group/usermod.rb
@@ -1,6 +1,6 @@
#
# Author:: AJ Christensen (<aj@chef.io>)
-# Copyright:: Copyright 2008-2019, Chef Software Inc.
+# Copyright:: Copyright 2008-2020, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -76,10 +76,7 @@ class Chef
end
def append_flags
- case node[:platform]
- when "openbsd", "netbsd", "aix", "smartos", "omnios"
- "-G"
- end
+ "-G" if platform?("openbsd", "netbsd", "aix", "smartos", "omnios")
end
end
diff --git a/lib/chef/provider/package/homebrew.rb b/lib/chef/provider/package/homebrew.rb
index 3d60ee4380..700fc8f721 100644
--- a/lib/chef/provider/package/homebrew.rb
+++ b/lib/chef/provider/package/homebrew.rb
@@ -2,8 +2,7 @@
# Author:: Joshua Timberman (<joshua@chef.io>)
# Author:: Graeme Mathieson (<mathie@woss.name>)
#
-# Copyright 2011-2016, Chef Software Inc.
-# Copyright 2014-2016, Chef Software, Inc <legal@chef.io>
+# Copyright:: 2011-2016, Chef Software, Inc <legal@chef.io>
#
# 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/lib/chef/provider/package/zypper.rb b/lib/chef/provider/package/zypper.rb
index 6d464a1930..47fe7514ee 100644
--- a/lib/chef/provider/package/zypper.rb
+++ b/lib/chef/provider/package/zypper.rb
@@ -3,7 +3,7 @@
# Authors:: Adam Jacob (<adam@chef.io>)
# Ionuț Arțăriși (<iartarisi@suse.cz>)
# Copyright:: Copyright 2008-2017, Chef Software Inc.
-# Copyright 2013-2016, SUSE Linux GmbH
+# Copyright:: 2013-2016, SUSE Linux GmbH
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/lib/chef/provider/route.rb b/lib/chef/provider/route.rb
index 523074bdbb..8dabde40d6 100644
--- a/lib/chef/provider/route.rb
+++ b/lib/chef/provider/route.rb
@@ -1,6 +1,7 @@
#
# Author:: Bryan McLellan (btm@loftninjas.org), Jesse Nelson (spheromak@gmail.com)
# Copyright:: Copyright 2009-2016, Bryan McLellan
+# Copyright:: Copyright 2020, Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -159,8 +160,7 @@ class Chef
end
def generate_config
- case node[:platform_family]
- when "rhel", "amazon", "fedora"
+ if platform_family?("rhel", "amazon", "fedora")
conf = {}
# walk the collection
run_context.resource_collection.each do |resource|
diff --git a/lib/chef/resource/homebrew_package.rb b/lib/chef/resource/homebrew_package.rb
index a33bdc63d6..2261979c09 100644
--- a/lib/chef/resource/homebrew_package.rb
+++ b/lib/chef/resource/homebrew_package.rb
@@ -2,8 +2,7 @@
# Author:: Joshua Timberman (<joshua@chef.io>)
# Author:: Graeme Mathieson (<mathie@woss.name>)
#
-# Copyright 2011-2020, Chef Software Inc.
-# Copyright 2014-2020, Chef Software Inc.<legal@chef.io>
+# Copyright:: 2011-2020, Chef Software Inc.<legal@chef.io>
#
# 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/lib/chef/resource/kernel_module.rb b/lib/chef/resource/kernel_module.rb
index 3dc9c0bd4f..9b732c0218 100644
--- a/lib/chef/resource/kernel_module.rb
+++ b/lib/chef/resource/kernel_module.rb
@@ -3,8 +3,8 @@
#
# The MIT License (MIT)
#
-# Copyright 2016-2018, Shopify Inc.
-# Copyright 2018-2020, Chef Software Inc.
+# Copyright:: 2016-2018, Shopify Inc.
+# Copyright:: 2018-2020, Chef Software Inc.
require_relative "../resource"
diff --git a/lib/chef/resource/swap_file.rb b/lib/chef/resource/swap_file.rb
index 2efe040c47..888dbf332d 100644
--- a/lib/chef/resource/swap_file.rb
+++ b/lib/chef/resource/swap_file.rb
@@ -1,6 +1,6 @@
#
-# Copyright 2012-2018, Seth Vargo
-# Copyright 2017-2018, Chef Software, Inc.
+# Copyright:: 2012-2018, Seth Vargo
+# Copyright:: 2017-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.
diff --git a/lib/chef/resource/timezone.rb b/lib/chef/resource/timezone.rb
index b34b0a077b..63eed848ab 100644
--- a/lib/chef/resource/timezone.rb
+++ b/lib/chef/resource/timezone.rb
@@ -1,8 +1,8 @@
#
# Author:: Kirill Kouznetsov <agon.smith@gmail.com>
#
-# Copyright 2018, Kirill Kouznetsov.
-# Copyright 2018-2020, Chef Software Inc.
+# Copyright:: 2018, Kirill Kouznetsov.
+# Copyright:: 2018-2020, 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/lib/chef/resource/windows_certificate.rb b/lib/chef/resource/windows_certificate.rb
index cdd7ed1ef1..474f9ad69c 100644
--- a/lib/chef/resource/windows_certificate.rb
+++ b/lib/chef/resource/windows_certificate.rb
@@ -85,7 +85,6 @@ class Chef
guard_script << cert_exists_script(hash)
powershell_script "setting the acls on #{new_resource.source} in #{cert_location}\\#{new_resource.store_name}" do
- guard_interpreter :powershell_script
convert_boolean_return true
code code_script
only_if guard_script