From 567b82e91cb4ae1b72eec8632d1712dd8608ebcc Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Thu, 16 Aug 2018 14:29:44 -0700 Subject: Add specs for the x509_cert and x509_request resources Fix the defaults that should be lazied and fix the duplicate class name I was using. Signed-off-by: Tim Smith --- lib/chef/resource/openssl_x509_certificate.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/chef/resource/openssl_x509_certificate.rb') diff --git a/lib/chef/resource/openssl_x509_certificate.rb b/lib/chef/resource/openssl_x509_certificate.rb index 7c354588af..04641e877b 100644 --- a/lib/chef/resource/openssl_x509_certificate.rb +++ b/lib/chef/resource/openssl_x509_certificate.rb @@ -70,11 +70,11 @@ class Chef property :extensions, Hash, description: "Hash of X509 Extensions entries, in format { 'keyUsage' => { 'values' => %w( keyEncipherment digitalSignature), 'critical' => true } }.", - default: {} + default: lazy { Hash.new } property :subject_alt_name, Array, description: "Array of Subject Alternative Name entries, in format DNS:example.com or IP:1.2.3.4.", - default: [] + default: lazy { [] } property :key_file, String, description: "The path to a certificate key file on the filesystem. If the key_file attribute is specified, the resource will attempt to source a key from this location. If no key file is found, the resource will generate a new key file at this location. If the key_file attribute is not specified, the resource will generate a key file in the same directory as the generated certificate, with the same name as the generated certificate." -- cgit v1.2.1