Skip to content

Commit 4d7bed3

Browse files
committed
api_objects: change validate_tls to a parameter
1 parent f3425a8 commit 4d7bed3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/puppet/provider/elastic_rest.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def self.api_objects(protocol = 'http',
9292
password = nil,
9393
ca_file = nil,
9494
ca_path = nil,
95-
validate_tls: true)
95+
validate_tls = true)
9696

9797
uri = URI("#{protocol}://#{host}:#{port}/#{format_uri(api_discovery_uri)}")
9898
http = Net::HTTP.new uri.host, uri.port
@@ -158,7 +158,7 @@ def self.prefetch(resources)
158158
(p.key?(:password) ? p[:password].value : nil),
159159
(p.key?(:ca_file) ? p[:ca_file].value : nil),
160160
(p.key?(:ca_path) ? p[:ca_path].value : nil),
161-
{ validate_tls: p[:validate_tls].value },
161+
(p.key?(:validate_tls) ? p[:validate_tls].value : true),
162162
]
163163
# Deduplicate identical settings, and fetch templates
164164
end.uniq
@@ -264,7 +264,7 @@ def flush
264264
resource[:password],
265265
resource[:ca_file],
266266
resource[:ca_path],
267-
validate_tls: resource[:validate_tls]
267+
resource[:validate_tls].nil? ? true : resource[:validate_tls]
268268
).find do |t|
269269
t[:name] == resource[:name]
270270
end

0 commit comments

Comments
 (0)