summaryrefslogtreecommitdiff
path: root/lib/chef/resource
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2019-07-05 14:17:04 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2019-07-05 14:31:16 -0700
commit9e9a408aea747e86385f4d49ef715e9745b6ef50 (patch)
tree54475fa46a81192db2a8322cfbdca9cbec551987 /lib/chef/resource
parent174a2748b54a5dbd746005e2aead59221b80f2b9 (diff)
downloadchef-9e9a408aea747e86385f4d49ef715e9745b6ef50.tar.gz
lazy procs are instance_exec in the resource already
exposed by Style/SymbolProc mangling some bad code. no idea how this ever worked. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/resource')
-rw-r--r--lib/chef/resource/cab_package.rb4
-rw-r--r--lib/chef/resource/dmg_package.rb6
-rw-r--r--lib/chef/resource/execute.rb4
-rw-r--r--lib/chef/resource/file.rb4
-rw-r--r--lib/chef/resource/msu_package.rb4
-rw-r--r--lib/chef/resource/windows_certificate.rb4
6 files changed, 13 insertions, 13 deletions
diff --git a/lib/chef/resource/cab_package.rb b/lib/chef/resource/cab_package.rb
index 82f8fd90ea..376a384bd7 100644
--- a/lib/chef/resource/cab_package.rb
+++ b/lib/chef/resource/cab_package.rb
@@ -1,6 +1,6 @@
#
# Author:: Vasundhara Jagdale (<vasundhara.jagdale@msystechnologies.com>)
-# Copyright:: Copyright 2008-2016, Chef Software, Inc.
+# Copyright:: Copyright 2008-2019, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -39,7 +39,7 @@ class Chef
uri_scheme?(s) ? s : Chef::Util::PathHelper.canonical_path(s, false)
end
end),
- default: lazy(&:package_name), default_description: "The package name."
+ default: lazy { package_name }, default_description: "The package name."
end
end
end
diff --git a/lib/chef/resource/dmg_package.rb b/lib/chef/resource/dmg_package.rb
index 3972b7abb9..403716cad7 100644
--- a/lib/chef/resource/dmg_package.rb
+++ b/lib/chef/resource/dmg_package.rb
@@ -1,6 +1,6 @@
#
# Author:: Joshua Timberman (<jtimberman@chef.io>)
-# Copyright:: 2011-2018, Chef Software, Inc.
+# Copyright:: 2011-2019, 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.
@@ -48,12 +48,12 @@ class Chef
property :volumes_dir, String,
description: "The directory under /Volumes where the dmg is mounted if it differs from the name of the .dmg file.",
- default: lazy(&:app), default_description: "The value passed for the application name."
+ default: lazy { app }, default_description: "The value passed for the application name."
property :dmg_name, String,
description: "The name of the .dmg file if it differs from that of the app, or if the name has spaces.",
desired_state: false,
- default: lazy(&:app), default_description: "The value passed for the application name."
+ default: lazy { app }, default_description: "The value passed for the application name."
property :type, String,
description: "The type of package.",
diff --git a/lib/chef/resource/execute.rb b/lib/chef/resource/execute.rb
index 50fa0f13b2..add15e3085 100644
--- a/lib/chef/resource/execute.rb
+++ b/lib/chef/resource/execute.rb
@@ -1,7 +1,7 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Tyler Cloke (<tyler@chef.io>)
-# Copyright:: Copyright 2008-2018, Chef Software Inc.
+# Copyright:: Copyright 2008-2019, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -94,7 +94,7 @@ class Chef
# lazy used to set default value of sensitive to true if password is set
property :sensitive, [ TrueClass, FalseClass ],
description: "Ensure that sensitive resource data is not logged by the #{Chef::Dist::CLIENT}.",
- default: lazy { |r| r.password ? true : false }, default_description: "True if the password property is set. False otherwise."
+ default: lazy { password ? true : false }, default_description: "True if the password property is set. False otherwise."
property :elevated, [ TrueClass, FalseClass ], default: false,
description: "Determines whether the script will run with elevated permissions to circumvent User Access Control (UAC) interactively blocking the process.\nThis will cause the process to be run under a batch login instead of an interactive login. The user running #{Chef::Dist::CLIENT} needs the “Replace a process level token” and “Adjust Memory Quotas for a process” permissions. The user that is running the command needs the “Log on as a batch job” permission.\nBecause this requires a login, the user and password properties are required.",
diff --git a/lib/chef/resource/file.rb b/lib/chef/resource/file.rb
index 8cfbe47358..c737780e2d 100644
--- a/lib/chef/resource/file.rb
+++ b/lib/chef/resource/file.rb
@@ -1,7 +1,7 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Seth Chisamore (<schisamo@chef.io>)
-# Copyright:: Copyright 2008-2018, Chef Software Inc.
+# Copyright:: Copyright 2008-2019, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -55,7 +55,7 @@ class Chef
property :path, String, name_property: true, identity: true,
description: "The full path to the file, including the file name and its extension. For example: /files/file.txt. Default value: the name of the resource block. Microsoft Windows: A path that begins with a forward slash (/) will point to the root of the current working directory of the #{Chef::Dist::CLIENT} process. This path can vary from system to system. Therefore, using a path that begins with a forward slash (/) is not recommended."
- property :atomic_update, [ TrueClass, FalseClass ], desired_state: false, default: lazy { |r| r.docker? && r.special_docker_files?(r.path) ? false : Chef::Config[:file_atomic_update] },
+ property :atomic_update, [ TrueClass, FalseClass ], desired_state: false, default: lazy { docker? && special_docker_files?(path) ? false : Chef::Config[:file_atomic_update] },
description: "Perform atomic file updates on a per-resource basis. Set to true for atomic file updates. Set to false for non-atomic file updates. This setting overrides file_atomic_update, which is a global setting found in the client.rb file."
property :backup, [ Integer, FalseClass ], desired_state: false, default: 5,
diff --git a/lib/chef/resource/msu_package.rb b/lib/chef/resource/msu_package.rb
index 270cbd4b16..a69f72001f 100644
--- a/lib/chef/resource/msu_package.rb
+++ b/lib/chef/resource/msu_package.rb
@@ -1,6 +1,6 @@
#
# Author:: Nimisha Sharad (<nimisha.sharad@msystechnologies.com>)
-# Copyright:: Copyright 2008-2016, Chef Software, Inc.
+# Copyright:: Copyright 2008-2019, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -40,7 +40,7 @@ class Chef
uri_scheme?(s) ? s : Chef::Util::PathHelper.canonical_path(s, false)
end
end),
- default: lazy(&:package_name)
+ default: lazy { package_name }
property :checksum, String, desired_state: false,
description: "SHA-256 digest used to verify the checksum of the downloaded MSU package."
diff --git a/lib/chef/resource/windows_certificate.rb b/lib/chef/resource/windows_certificate.rb
index a85c56748f..cdd7ed1ef1 100644
--- a/lib/chef/resource/windows_certificate.rb
+++ b/lib/chef/resource/windows_certificate.rb
@@ -2,7 +2,7 @@
# Author:: Richard Lavey (richard.lavey@calastone.com)
#
# Copyright:: 2015-2017, Calastone Ltd.
-# Copyright:: 2018, Chef Software, Inc.
+# Copyright:: 2018-2019, 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.
@@ -55,7 +55,7 @@ class Chef
# lazy used to set default value of sensitive to true if password is set
property :sensitive, [TrueClass, FalseClass],
description: "Ensure that sensitive resource data is not logged by the #{Chef::Dist::CLIENT}.",
- default: lazy { |r| r.pfx_password ? true : false }, skip_docs: true
+ default: lazy { pfx_password ? true : false }, skip_docs: true
action :create do
description "Creates or updates a certificate."