summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-04-14 12:07:05 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2016-04-14 12:07:05 -0700
commit5474a7b6a3fc4b20889f356d9bae3fb2e6197223 (patch)
treef31568d262c31f46e27ce9720588b6a109514856
parent03503d7352ccad45107b055fc711e86c7c5d2918 (diff)
downloadchef-lcg/nillable-apt-repository-distribution.tar.gz
allow true to mean nil via coercsionslcg/nillable-apt-repository-distribution
-rw-r--r--lib/chef/resource/apt_repository.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/chef/resource/apt_repository.rb b/lib/chef/resource/apt_repository.rb
index bba753638c..8b87371824 100644
--- a/lib/chef/resource/apt_repository.rb
+++ b/lib/chef/resource/apt_repository.rb
@@ -26,17 +26,17 @@ class Chef
property :repo_name, String, name_property: true
property :uri, String
- property :distribution, [ String, nil ], default: lazy { node["lsb"]["codename"] }, nillable: true
+ property :distribution, [ String, nil, false ], default: lazy { node["lsb"]["codename"] }, nillable: true, coerce: proc { |x| x ? x : nil }
property :components, Array, default: []
- property :arch, [String, nil], default: nil
+ property :arch, [String, nil, false], default: nil, nillable: true, coerce: proc { |x| x ? x : nil }
property :trusted, [TrueClass, FalseClass], default: false
# whether or not to add the repository as a source repo, too
property :deb_src, [TrueClass, FalseClass], default: false
- property :keyserver, [String, nil], default: "keyserver.ubuntu.com"
- property :key, [String, nil], default: nil
- property :key_proxy, [String, nil], default: nil
+ property :keyserver, [String, nil, false], default: "keyserver.ubuntu.com", nillable: true, coerce: proc { |x| x ? x : nil }
+ property :key, [String, nil, false], default: nil, nillable: true, coerce: proc { |x| x ? x : nil }
+ property :key_proxy, [String, nil, false], default: nil, nillable: true, coerce: proc { |x| x ? x : nil }
- property :cookbook, [String, nil], default: nil, desired_state: false
+ property :cookbook, [String, nil, false], default: nil, desired_state: false, nillable: true, coerce: proc { |x| x ? x : nil }
property :cache_rebuild, [TrueClass, FalseClass], default: true, desired_state: false
property :sensitive, [TrueClass, FalseClass], default: false, desired_state: false