diff options
author | Tim Smith <tsmith@chef.io> | 2020-03-16 13:11:36 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-16 13:11:36 -0700 |
commit | 82faf0c44b4598aefda899c1033cfccac3691193 (patch) | |
tree | 18f962632d5066567d508d68b25e7846e6e7c0eb | |
parent | 3d228a95bf05cd1654601aab44045ff6acc8f507 (diff) | |
parent | 72668ebfe92e7f6d36630861759812aba92b9513 (diff) | |
download | chef-82faf0c44b4598aefda899c1033cfccac3691193.tar.gz |
Merge pull request #9495 from chef/cookstyle_fixes
Cookstyle fixes for our resources
-rw-r--r-- | lib/chef/provider/group/usermod.rb | 7 | ||||
-rw-r--r-- | lib/chef/provider/package/homebrew.rb | 3 | ||||
-rw-r--r-- | lib/chef/provider/package/zypper.rb | 3 | ||||
-rw-r--r-- | lib/chef/provider/route.rb | 4 | ||||
-rw-r--r-- | lib/chef/resource/homebrew_package.rb | 3 | ||||
-rw-r--r-- | lib/chef/resource/kernel_module.rb | 5 | ||||
-rw-r--r-- | lib/chef/resource/swap_file.rb | 4 | ||||
-rw-r--r-- | lib/chef/resource/timezone.rb | 4 | ||||
-rw-r--r-- | lib/chef/resource/windows_certificate.rb | 1 |
9 files changed, 15 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..a7292bc50a 100644 --- a/lib/chef/provider/package/zypper.rb +++ b/lib/chef/provider/package/zypper.rb @@ -3,7 +3,8 @@ # 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 cbed1f70ec..fdfdc53a03 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 55c61478ec..3649bd0214 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-2016, Chef Software Inc. -# Copyright 2014-2016, 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 2f9b7748f6..6f6c0ff776 100644 --- a/lib/chef/resource/kernel_module.rb +++ b/lib/chef/resource/kernel_module.rb @@ -3,8 +3,9 @@ # # The MIT License (MIT) # -# Copyright 2016-2018, Shopify Inc. -# Copyright 2018, 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..942424ab6f 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-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/timezone.rb b/lib/chef/resource/timezone.rb index 16a7f1031e..d2b85e43b0 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, 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 |