Skip to content

Commit

Permalink
fixing rubocop errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jardleex committed Feb 20, 2024
1 parent 37fec3d commit 53303c0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions lib/puppet/provider/consul_acl/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def self.list_resources(acl_api_token, port, hostname, protocol, tries)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true if uri.instance_of? URI::HTTPS

path = uri.request_uri + "/list"
http_headers = { 'X-Consul-Token' => "#{acl_api_token}" }
path = "#{uri.request_uri}/list"
http_headers = { 'X-Consul-Token' => acl_api_token.to_s }
req = Net::HTTP::Get.new(path, http_headers)
res = nil
res_code = nil
Expand Down Expand Up @@ -96,7 +96,7 @@ def put_acl(method, body)
http.use_ssl = true if uri.instance_of? URI::HTTPS
acl_api_token = @resource[:acl_api_token]
path = uri.request_uri + "/#{method}"
http_headers = { 'X-Consul-Token' => "#{acl_api_token}" }
http_headers = { 'X-Consul-Token' => acl_api_token.to_s }
req = Net::HTTP::Put.new(path, http_headers)
req.body = body.to_json if body
res = http.request(req)
Expand Down
4 changes: 2 additions & 2 deletions lib/puppet/provider/consul_key_value/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def self.list_resources(acl_api_token, port, hostname, protocol, tries, datacent
uri = URI(consul_url)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true if uri.instance_of? URI::HTTPS
http_headers = { 'X-Consul-Token' => "#{acl_api_token}" }
http_headers = { 'X-Consul-Token' => acl_api_token.to_s }
req = Net::HTTP::Get.new(uri.request_uri, http_headers)
res = nil

Expand Down Expand Up @@ -91,7 +91,7 @@ def get_path(name)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true if uri.instance_of? URI::HTTPS
acl_api_token = @resource[:acl_api_token]
http_headers = { 'X-Consul-Token' => "#{acl_api_token}" }
http_headers = { 'X-Consul-Token' => acl_api_token.to_s }
[uri.request_uri, http, http_headers]
end

Expand Down
4 changes: 2 additions & 2 deletions lib/puppet/provider/consul_prepared_query/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def self.list_resources(acl_api_token, port, hostname, protocol, tries)
uri = URI("#{protocol}://#{hostname}:#{port}/v1/query")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true if uri.instance_of? URI::HTTPS
http_headers = { 'X-Consul-Token' => "#{acl_api_token}" }
http_headers = { 'X-Consul-Token' => acl_api_token.to_s }
req = Net::HTTP::Get.new(uri.request_uri, http_headers)
res = nil

Expand Down Expand Up @@ -81,7 +81,7 @@ def get_path(id)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true if uri.instance_of? URI::HTTPS
acl_api_token = @resource[:acl_api_token]
http_headers = { 'X-Consul-Token' => "#{acl_api_token}" }
http_headers = { 'X-Consul-Token' => acl_api_token.to_s }
[uri.request_uri, http, http_headers]
end

Expand Down

0 comments on commit 53303c0

Please sign in to comment.