diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2017-04-02 10:36:21 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2017-04-02 10:36:21 -0700 |
commit | 5daf9335db751d651ed215c012cb932ff2ef425d (patch) | |
tree | db0692cd03271926d0b474fca748c63d9285df26 /lib/chef/resource | |
parent | 40b8dbcc1be0454873b79b04537baa074c221361 (diff) | |
download | chef-5daf9335db751d651ed215c012cb932ff2ef425d.tar.gz |
Chef-13: coerce package options property to a Stringlcg/package-options
Windows side we still can't support this kind of API, this
is for Unix-ey stuff.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/resource')
-rw-r--r-- | lib/chef/resource/chocolatey_package.rb | 5 | ||||
-rw-r--r-- | lib/chef/resource/package.rb | 2 | ||||
-rw-r--r-- | lib/chef/resource/windows_package.rb | 5 |
3 files changed, 9 insertions, 3 deletions
diff --git a/lib/chef/resource/chocolatey_package.rb b/lib/chef/resource/chocolatey_package.rb index 5460661f6d..a443b9a1d7 100644 --- a/lib/chef/resource/chocolatey_package.rb +++ b/lib/chef/resource/chocolatey_package.rb @@ -1,6 +1,6 @@ # # Author:: Adam Jacob (<adam@chef.io>) -# Copyright:: Copyright 2008-2016, Chef Software, Inc. +# Copyright:: Copyright 2008-2017, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -31,6 +31,9 @@ class Chef @resource_name = :chocolatey_package end + # windows can't take Array options yet + property :options, String + property :package_name, [String, Array], coerce: proc { |x| [x].flatten } property :version, [String, Array], coerce: proc { |x| [x].flatten } diff --git a/lib/chef/resource/package.rb b/lib/chef/resource/package.rb index a1f174a6f3..5647f203d2 100644 --- a/lib/chef/resource/package.rb +++ b/lib/chef/resource/package.rb @@ -36,7 +36,7 @@ class Chef property :package_name, [ String, Array ], identity: true property :version, [ String, Array ] - property :options, [ String, Array ] + property :options, [ String, Array ], coerce: proc { |x| x.is_a?(String) ? x.shellsplit : x } property :response_file, String, desired_state: false property :response_file_variables, Hash, default: lazy { {} }, desired_state: false property :source, String, desired_state: false diff --git a/lib/chef/resource/windows_package.rb b/lib/chef/resource/windows_package.rb index 0e8dd39672..e37bad4b0a 100644 --- a/lib/chef/resource/windows_package.rb +++ b/lib/chef/resource/windows_package.rb @@ -1,6 +1,6 @@ # # Author:: Bryan McLellan <btm@loftninjas.org> -# Copyright:: Copyright 2014-2016, Chef Software, Inc. +# Copyright:: Copyright 2014-2017, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -37,6 +37,9 @@ class Chef @source ||= source(@package_name) if @package_name.downcase.end_with?(".msi") end + # windows can't take array options yet + property :options, String + # Unique to this resource property :installer_type, Symbol property :timeout, [ String, Integer ], default: 600 |