summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Batye <gbatye@gmail.com>2023-04-25 12:36:12 -0700
committerGitHub <noreply@github.com>2023-04-25 15:36:12 -0400
commitaeb711bca1bd33e762157fdca3f8e175dc2ef4af (patch)
tree28214a9c390a3552b2beaaab27db6645b547a864
parentd3d32598e8e568e1a7296445c149adf1edb4d726 (diff)
downloadchef-aeb711bca1bd33e762157fdca3f8e175dc2ef4af.tar.gz
[launchd] Force string values for program_arguments property (#13682)
Signed-off-by: Greg Batye <gbatye@gmail.com>
-rw-r--r--lib/chef/resource/launchd.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/chef/resource/launchd.rb b/lib/chef/resource/launchd.rb
index 719938dec2..2c15694ef3 100644
--- a/lib/chef/resource/launchd.rb
+++ b/lib/chef/resource/launchd.rb
@@ -202,7 +202,11 @@ class Chef
description: "The first argument of `execvp`, typically the file name associated with the file to be executed. This value must be specified if `program_arguments` is not specified, and vice-versa."
property :program_arguments, Array,
- description: "The second argument of `execvp`. If program is not specified, this property must be specified and will be handled as if it were the first argument."
+ description: "The second argument of `execvp`. If program is not specified, this property must be specified and will be handled as if it were the first argument.",
+ coerce: proc { |args|
+ # Cast all values to a string. Launchd only supports string values
+ args.map(&:to_s)
+ }
property :queue_directories, Array,
description: "An array of non-empty directories which, if any are modified, will cause a job to be started."