chef-telemetry 1.0.5 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fadb2572549a87ab3ab291da2d85e79bf6912118375b041d053c5eabd8282858
4
- data.tar.gz: db7882a4e2e9744dbc63b2f8810067cc52bd6615b856cb7b4b1ae1f43e4a76eb
3
+ metadata.gz: 563360c0827f3a72a43fb999c62480e92573557adf831773aaff7167019ce1e0
4
+ data.tar.gz: c042e45199fd850f0e7e5fc9a457a7dab626a97894f2cda5ef03a4114ee723d0
5
5
  SHA512:
6
- metadata.gz: 448fec2cee300d509288608fc6790eb59120c76c574a6c2aada934703853cc5c5d6eecfd35c42e8d4ae98cd07cdd7bea250c75d2004509583a65fb620e97d8a8
7
- data.tar.gz: 941d97e1795056ed611d801d6213628e2e765cb4590a1457bd51b64ec7a338d246da1fbca456c7673f5258bf65566822c3e428d5041c9ed62ca9f6e188dd8e4a
6
+ metadata.gz: 5e2bdcc2924f00ec7e7f18c5b0a8c0396f29fb971fafe2766f4cbc43d0c5ec67354f542ee03c788f48b5d0b95e2d91696a22549130e4c4214e1a880673cc031f
7
+ data.tar.gz: ff4df5c15d93b936cb29df71da21b537b19416ac8b033c4c887a382ac5365ef5e7af856b031dcb2c09fa09146a1d9bc0d4964137295df25a41959301eb2b26a0
@@ -16,13 +16,13 @@
16
16
  #
17
17
 
18
18
  require_relative "telemetry/version"
19
- require "benchmark"
20
- require "forwardable"
21
- require "singleton"
22
- require "json"
23
- require "digest/sha1"
24
- require "securerandom"
25
- require "yaml"
19
+ require "benchmark" unless defined?(Benchmark)
20
+ require "forwardable" unless defined?(Forwardable)
21
+ require "singleton" unless defined?(Singleton)
22
+ require "json" unless defined?(JSON)
23
+ require "digest/sha1" unless defined?(Digest::SHA1)
24
+ require "securerandom" unless defined?(SecureRandom)
25
+ require "yaml" unless defined?(YAML)
26
26
 
27
27
  class Chef
28
28
  # This definites the Telemeter interface. Implementation thoughts for
@@ -66,6 +66,7 @@ class Chef
66
66
  Telemeter::Log.info("Telemetry disabled, clearing any existing session captures without sending them.")
67
67
  session_files.each { |path| FileUtils.rm_rf(path) }
68
68
  end
69
+ require "fileutils" unless defined?(FileUtils)
69
70
  FileUtils.rm_rf(config[:session_file])
70
71
  Telemeter::Log.info("Terminating, nothing more to do.")
71
72
  rescue => e
@@ -1,4 +1,6 @@
1
- require "http"
1
+ require "net/http" unless defined?(Net::HTTP)
2
+ require "uri" unless defined?(URI)
3
+ require "json" unless defined?(JSON)
2
4
  require "concurrent"
3
5
 
4
6
  class Chef
@@ -11,11 +13,18 @@ class Chef
11
13
  attr_reader :http
12
14
  def initialize(endpoint = TELEMETRY_ENDPOINT)
13
15
  super()
14
- @http = ::HTTP.persistent(endpoint)
16
+ uri = URI(endpoint)
17
+ @http = Net::HTTP.new(uri.host, uri.port)
18
+ @http.use_ssl = uri.scheme == "https"
19
+ @http.start
15
20
  end
16
21
 
17
22
  def fire(event)
18
- http.post("/events", json: event).flush
23
+ req = Net::HTTP::Post.new("/events")
24
+ req["Content-Type"] = "application/json"
25
+ req.body = JSON.dump(event)
26
+ # TODO: @cwolfe use response and at least debug log status
27
+ http.request req
19
28
  end
20
29
  end
21
30
 
@@ -1,4 +1,5 @@
1
- require "securerandom"
1
+ require "securerandom" unless defined?(SecureRandom)
2
+ require "fileutils" unless defined?(FileUtils)
2
3
  require "chef-config/path_helper"
3
4
 
4
5
  class Chef
@@ -1,5 +1,5 @@
1
1
  class Chef
2
2
  class Telemetry
3
- VERSION = "1.0.5".freeze
3
+ VERSION = "1.1.1".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,57 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-telemetry
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef Software, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-29 00:00:00.000000000 Z
11
+ date: 2021-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: http
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '4'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '4'
41
- - !ruby/object:Gem::Dependency
42
- name: ffi-yajl
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '2.2'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '2.2'
55
13
  - !ruby/object:Gem::Dependency
56
14
  name: concurrent-ruby
57
15
  requirement: !ruby/object:Gem::Requirement
@@ -107,14 +65,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
107
65
  requirements:
108
66
  - - ">="
109
67
  - !ruby/object:Gem::Version
110
- version: '0'
68
+ version: '2.5'
111
69
  required_rubygems_version: !ruby/object:Gem::Requirement
112
70
  requirements:
113
71
  - - ">="
114
72
  - !ruby/object:Gem::Version
115
73
  version: '0'
116
74
  requirements: []
117
- rubygems_version: 3.0.3
75
+ rubygems_version: 3.1.4
118
76
  signing_key:
119
77
  specification_version: 4
120
78
  summary: Send user actions to the Chef telemetry system. See Chef RFC-051 for further